Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up scripts folder #919

Merged
merged 15 commits into from
Aug 19, 2022
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build/
data/
examples/demo/data
coverage.out
release.tar.gz
.env
Expand All @@ -15,6 +15,7 @@ test/keys/
_test/setup/valkeys/*.json
_test/keys/
.DS_Store
.vscode/

# Don't commit the vendor directory if anyone runs 'go mod vendor'.
/vendor
24 changes: 1 addition & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,6 @@ get-gaia:
@git clone --branch $(GAIA_VERSION) --depth=1 https://github.com/cosmos/gaia.git ./chain-code/gaia

build-gaia:
@./scripts/build-gaia

build-akash:
@./scripts/build-akash

get-akash:
@mkdir -p ./chain-code/
@git clone --branch $(AKASH_VERSION) git@github.com:ovrclk/akash.git ./chain-code/akash

get-chains: get-gaia get-akash get-wasmd

get-wasmd:
@mkdir -p ./chain-code/
@git clone --branch $(WASMD_VERSION) git@github.com:CosmWasm/wasmd.git ./chain-code/wasmd

build-wasmd:
@./scripts/build-wasmd

build-chains: build-akash build-gaia build-wasmd

delete-chains:
@echo "Removing the ./chain-code/ directory..."
@rm -rf ./chain-code
@./examples/demo/scripts/build-gaia

.PHONY: two-chains test test-integration ibctest install build lint coverage clean
4 changes: 2 additions & 2 deletions cmd/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ func pathsAddDirCmd(a *appState) *cobra.Command {
Short: `Add path configuration data in bulk from a directory. Example dir: 'configs/demo/paths'`,
Long: `Add path configuration data in bulk from a directory housing individual path config files. This is useful for spinning up testnets.

See 'configs/demo/paths' for an example of individual path config files.`,
See 'examples/demo/configs/paths' for an example of individual path config files.`,
Example: strings.TrimSpace(fmt.Sprintf(`
$ %s config add-paths configs/paths`, appName)),
$ %s config add-paths examples/demo/configs/paths`, appName)),
RunE: func(cmd *cobra.Command, args []string) (err error) {
if err := addPathsFromDirectory(cmd.Context(), cmd.ErrOrStderr(), a, args[0]); err != nil {
return err
Expand Down
14 changes: 0 additions & 14 deletions configs/agoric.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/agoric/chains/ibc-0.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/agoric/chains/ibc-1.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/agoric/paths/demo.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/akash/chains/ibc-0.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/akash/chains/ibc-1.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/akash/paths/demo.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/chains/ibc-0.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/chains/ibc-1.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/chains/ibc-2.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/chains/ibc-3.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/paths/onetwo.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/paths/threezero.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/paths/twothree.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/four/paths/zeroone.json

This file was deleted.

11 changes: 0 additions & 11 deletions configs/gaia.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/gaia/chains/ibc-0.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/gaia/chains/ibc-1.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/gaia/paths/demo.json

This file was deleted.

19 changes: 0 additions & 19 deletions configs/three/chains/ibc-0.json

This file was deleted.

19 changes: 0 additions & 19 deletions configs/three/chains/ibc-1.json

This file was deleted.

19 changes: 0 additions & 19 deletions configs/three/chains/ibc-2.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/three/paths/demo.json

This file was deleted.

1 change: 0 additions & 1 deletion configs/three/paths/demo2.json

This file was deleted.

17 changes: 0 additions & 17 deletions configs/wasmd/chains/ibc-0.json

This file was deleted.

17 changes: 0 additions & 17 deletions configs/wasmd/chains/ibc-1.json

This file was deleted.

12 changes: 0 additions & 12 deletions configs/wasmd/paths/demo.json

This file was deleted.

5 changes: 4 additions & 1 deletion dev-env
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ fi
cd $RELAYER_DIR
rm -rf $RELAYER_CONF &> /dev/null
pwd
bash scripts/two-chainz-wasmd "skip"
bash scripts/two-chainz "skip"

echo "waiting for blocks..."
sleep 3

# creates client, connection, and channel all in one command
rly tx link demo -d -t 3s
sleep 2
echo "Initial balances"
Expand All @@ -28,8 +29,10 @@ echo "balance 1 $(rly q bal ibc-1)"
rly tx transfer ibc-0 ibc-1 100000samoleans "$(rly keys show ibc-1)" channel-0 -d
rly tx transfer ibc-1 ibc-0 100000samoleans "$(rly keys show ibc-0)" channel-0 -d
sleep 5
# relay remaining packets and then finishes as opposed to starting a continuous listening loop with `rly start`
rly tx relay-packets demo channel-0 -d
sleep 5
# relay remaining acknowledgments and then finishes as opposed to starting a continuous listening loop with `rly start`
rly tx relay-acknowledgements demo channel-0 -d
sleep 5
echo "Balances after packets are sent"
Expand Down
2 changes: 1 addition & 1 deletion docs/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ make get-gaia build-gaia

# two-chainz creates two gaia-based chains with data directories in this repo
# it also builds and configures the relayer for operations with those chains
$ ./scripts/two-chainz
$ ./examples/demo/scripts/two-chainz
# NOTE: If you want to stop the two gaia-based chains running in the background use `killall gaiad`

# At this point the relayer --home directory is ready for normal operations between
Expand Down
39 changes: 39 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Demo/Dev-Environment

The demo environment is a series of bash scripts that:

1) Spins up two IBC enabled blockchains chains (gaia) in your local environment
2) Creates an IBC connection between both chains
3) Sends an IBC transaction between both chains

This can be used to learn about the inter workings of IBC. Follow along with the commands inside of the bash scripts to get a better idea.

This can also be used to spin up a quick testing environment.

To run:

```bash
cd examples/demo/
./dev-env
```

This script creates a folder called "data": `examples/demo/data/`.
Logs and config info for each chain can be found here.


Note: After running, two `gaiad` instances will be running on your machine.
To kill ALL `gaiad` instances run:
```bash
killall gaiad
```

---

## Example Config: [examples/config.yaml](./config_EXAMPLE.yaml)

This is an example of a config file with:

- Three chains added: `cosmoshub`, `juno`, and `osmosis`
- Three paths configured: `cosmoshub-juno`, `cosmoshub-osmosis`, `juno-osmosis`
- Path `cosmoshub-juno` does not filter any channels while the other two paths have filters set.
- All three chains have a wallet/key called "default"
Loading