-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Docker images for gaia chains * Added GitHub Actions to run integration test with two chains * Relayer GitHub Actions configuration and testing * Integration test fixes * Integration fixes * HEIGHT fix * Separated cargo runs * Another test for build and config * Moved chain_a creation into one shell space * Fix for chain_b config * Integration tests fail because they don't exist * Trying test command * Docs update * Simapp and new genesis * Added pruning=nothing for simd config * Update ci/simapp/README.md Co-authored-by: Ethan Buchman <ethan@coinculture.info>
- Loading branch information
1 parent
6ef76fa
commit f5469f1
Showing
19 changed files
with
1,139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Integration test | ||
on: [push] | ||
jobs: | ||
test-integration-stable: | ||
runs-on: ubuntu-latest | ||
services: | ||
chain1: | ||
image: informaldev/chain_a | ||
ports: | ||
- 26656:26656 | ||
- 26657:26657 | ||
chain2: | ||
image: informaldev/chain_b | ||
ports: | ||
- 26556:26656 | ||
- 26557:26657 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: -p relayer-cli --bins | ||
- name: Set up chain_a | ||
run: | | ||
TRUSTED_HEADER="$(curl -s http://localhost:26657/status)" | ||
HASH="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_hash)" | ||
HEIGHT="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_height)" | ||
cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml light init -x "${HASH}" -h "${HEIGHT}" chain_A | ||
- name: Set up chain_b | ||
run: | | ||
TRUSTED_HEADER="$(curl -s http://localhost:26557/status)" | ||
HASH="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_hash)" | ||
HEIGHT="$(echo "${TRUSTED_HEADER}" | jq -r .result.sync_info.latest_block_height)" | ||
cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml light init -x "${HASH}" -h "${HEIGHT}" chain_B | ||
- name: Run relayer in the background | ||
run: | | ||
cargo run --bin relayer -- -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml start --reset & | ||
sleep 3 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: run | ||
args: --bin relayer -- -v -c relayer/relay/tests/config/fixtures/relayer_conf_example.toml query connection end chain_A testconnection | ||
# - uses: actions-rs/cargo@v1 | ||
# with: | ||
# command: test | ||
# args: --test integration --no-fail-fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gaia/ | ||
cosmos-sdk/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Programmatic list for creating Gaia Hub chains for testing IBC. | ||
## Instead of blindly running this code, read it line by line and understand the dependecies and tasks. | ||
## Prerequisites: Log into Docker Hub | ||
set -eou pipefail | ||
GAIA_BRANCH="master" # Requires a version with the `--keyring-backend` option. v2.1 and above. | ||
|
||
echo "*** Requirements" | ||
which git && which go && which make && which sed && which jq && which docker | ||
|
||
echo "*** Fetch gaiad source code" | ||
git clone https://github.com/cosmos/gaia || echo "Already cloned." | ||
cd gaia | ||
git checkout "${GAIA_BRANCH}" -q | ||
|
||
echo "*** Build binary" | ||
GOOS=linux make build | ||
|
||
echo "*** Create config using the built binary" | ||
docker run -it --rm -v $(pwd)/build:/root:z alpine /root/gaiad testnet -o /root/chain_a --v 1 --chain-id chain_A --keyring-backend test | ||
sed -i.bak -e 's/^index_all_keys[[:space:]]*=.*/index_all_keys = true/' build/chain_a/node0/gaiad/config/config.toml | ||
sed -i.bak -e 's/^timeout_commit[[:space:]]*=.*/timeout_commit = "1s"/' build/chain_a/node0/gaiad/config/config.toml | ||
sed -i.bak -e 's/^timeout_propose[[:space:]]*=.*/timeout_propose = "1s"/' build/chain_a/node0/gaiad/config/config.toml | ||
|
||
docker run -it --rm -v $(pwd)/build:/root:z alpine /root/gaiad testnet -o /root/chain_b --v 1 --chain-id chain_B --keyring-backend test | ||
sed -i.bak -e 's/^index_all_keys[[:space:]]*=.*/index_all_keys = true/' build/chain_b/node0/gaiad/config/config.toml | ||
sed -i.bak -e 's/^timeout_commit[[:space:]]*=.*/timeout_commit = "1s"/' build/chain_b/node0/gaiad/config/config.toml | ||
sed -i.bak -e 's/^timeout_propose[[:space:]]*=.*/timeout_propose = "1s"/' build/chain_b/node0/gaiad/config/config.toml | ||
|
||
echo "*** Create Docker image and upload to Docker Hub" | ||
cd .. | ||
docker build -t informaldev/chain_a -f chain_a.Dockerfile . | ||
docker build -t informaldev/chain_b -f chain_b.Dockerfile . | ||
|
||
# Get details from the config files | ||
echo SECRET_A=$(jq -r .secret gaia/build/chain_a/node0/gaiacli/key_seed.json) | ||
echo SECRET_B=$(jq -r .secret gaia/build/chain_b/node0/gaiacli/key_seed.json) | ||
echo NODEID_A=$(jq -r .app_state.genutil.gentxs[0].value.memo gaia/build/chain_a/node0/gaiad/config/genesis.json) | ||
echo NODEID_B=$(jq -r .app_state.genutil.gentxs[0].value.memo gaia/build/chain_b/node0/gaiad/config/genesis.json) | ||
|
||
read -p "Press ENTER to push image to Docker Hub or CTRL-C to cancel. " dontcare | ||
docker push informaldev/chain_a | ||
docker push informaldev/chain_b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Programmatic list for creating a simd chain for testing IBC. | ||
## Instead of blindly running this code, read it line by line and understand the dependecies and tasks. | ||
## Prerequisites: Log into Docker Hub | ||
set -eou pipefail | ||
GAIA_BRANCH="master" | ||
|
||
echo "*** Requirements" | ||
which git && which go && which make && which docker | ||
|
||
echo "*** Fetch gaiad source code" | ||
git clone https://github.com/cosmos/cosmos-sdk || echo "Already cloned." | ||
cd cosmos-sdk | ||
git checkout "${GAIA_BRANCH}" -q | ||
|
||
echo "*** Build binary" | ||
GOOS=linux make build-simd | ||
|
||
echo "*** Create Docker image and upload to Docker Hub" | ||
cd .. | ||
docker build -t informaldev/simd -f simd.Dockerfile . | ||
read -p "Press ENTER to push image to Docker Hub or CTRL-C to cancel. " dontcare | ||
docker push informaldev/simd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM alpine | ||
LABEL maintainer="hello@informal.systems" | ||
|
||
EXPOSE 26656 26657 26660 | ||
|
||
ENTRYPOINT ["/usr/bin/gaiad"] | ||
|
||
CMD ["start"] | ||
|
||
VOLUME [ "/root" ] | ||
|
||
COPY gaia/build/gaiad /usr/bin/gaiad | ||
COPY gaia/build/chain_a/node0/gaiad /root/.gaiad | ||
COPY gaia/build/chain_a/node0/gaiacli/key_seed.json /root/key_seed.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM alpine | ||
LABEL maintainer="hello@informal.systems" | ||
|
||
EXPOSE 26656 26657 26660 | ||
|
||
ENTRYPOINT ["/usr/bin/gaiad"] | ||
|
||
CMD ["start"] | ||
|
||
VOLUME [ "/root" ] | ||
|
||
COPY gaia/build/gaiad /usr/bin/gaiad | ||
COPY gaia/build/chain_b/node0/gaiad /root/.gaiad | ||
COPY gaia/build/chain_b/node0/gaiacli/key_seed.json /root/key_seed.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# IBC Test | ||
|
||
The `simapp` directory contains complete data for running an IBC enabled | ||
blockchain using the `simd` app from the `Cosmos-SDK`. | ||
|
||
It also comes with an account key for sending txs - the password is `asdfghjkl;'` | ||
|
||
Run using Docker: | ||
``` | ||
docker run --rm -p 26657:26657 informaldev/simd | ||
``` | ||
|
||
Or install `simd` from the cosmos-sdk repo and run it with this genesis data: | ||
|
||
``` | ||
git clone https://github.com/comsos/cosmos-sdk | ||
cd cosmos-sdk | ||
make build-simd | ||
build/simd --home simapp start | ||
``` | ||
|
||
This will start an IBC enabled blockchain with some initial IBC state that you | ||
can then query. For instance: | ||
|
||
``` | ||
curl 'localhost:26657/abci_query?path="store/ibc/key"&data="connections/connectionidone"' | ||
curl 'localhost:26657/abci_query?path="store/ibc/key"&data="clients/ethbridge"' | ||
curl 'localhost:26657/abci_query?path="store/ibc/key"&data="channels/firstchannel"' | ||
``` | ||
|
||
will return the relevent proto encoded data. | ||
|
||
|
||
:D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# This is a TOML config file. | ||
# For more information, see https://github.com/toml-lang/toml | ||
|
||
############################################################################### | ||
### Base Configuration ### | ||
############################################################################### | ||
|
||
# The minimum gas prices a validator is willing to accept for processing a | ||
# transaction. A transaction's fees must meet the minimum of any denomination | ||
# specified in this config (e.g. 0.25token1;0.0001token2). | ||
minimum-gas-prices = "" | ||
|
||
# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals | ||
# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) | ||
# everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals | ||
# custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' | ||
pruning = "nothing" | ||
|
||
# These are applied if and only if the pruning strategy is custom. | ||
pruning-keep-recent = "0" | ||
pruning-keep-every = "0" | ||
pruning-interval = "0" | ||
|
||
# HaltHeight contains a non-zero block height at which a node will gracefully | ||
# halt and shutdown that can be used to assist upgrades and testing. | ||
# | ||
# Note: Commitment of state will be attempted on the corresponding block. | ||
halt-height = 0 | ||
|
||
# HaltTime contains a non-zero minimum block time (in Unix seconds) at which | ||
# a node will gracefully halt and shutdown that can be used to assist upgrades | ||
# and testing. | ||
# | ||
# Note: Commitment of state will be attempted on the corresponding block. | ||
halt-time = 0 | ||
|
||
# InterBlockCache enables inter-block caching. | ||
inter-block-cache = true | ||
|
||
############################################################################### | ||
### Telemetry Configuration ### | ||
############################################################################### | ||
|
||
[telemetry] | ||
|
||
# Prefixed with keys to separate services | ||
service-name = "" | ||
|
||
# Enabled enables the application telemetry functionality. When enabled, | ||
# an in-memory sink is also enabled by default. Operators may also enabled | ||
# other sinks such as Prometheus. | ||
enabled = false | ||
|
||
# Enable prefixing gauge values with hostname | ||
enable-hostname = false | ||
|
||
# Enable adding hostname to labels | ||
enable-hostname-label = false | ||
|
||
# Enable adding service to labels | ||
enable-service-label = false | ||
|
||
# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. | ||
prometheus-retention-time = 0 | ||
|
||
# GlobalLabels defines a global set of name/value label tuples applied to all | ||
# metrics emitted using the wrapper functions defined in telemetry package. | ||
# | ||
# Example: | ||
# [["chain_id", "cosmoshub-1"]] | ||
global-labels = [ | ||
] | ||
|
||
############################################################################### | ||
### API Configuration ### | ||
############################################################################### | ||
|
||
[api] | ||
|
||
# Enable defines if the API server should be enabled. | ||
enable = false | ||
|
||
# Swagger defines if swagger documentation should automatically be registered. | ||
swagger = false | ||
|
||
# Address defines the API server to listen on | ||
address = "tcp://0.0.0.0:1317" | ||
|
||
# MaxOpenConnections defines the number of maximum open connections | ||
max-open-connections = 1000 | ||
|
||
# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds) | ||
rpc-read-timeout = 10 | ||
|
||
# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds) | ||
rpc-write-timeout = 0 | ||
|
||
# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes) | ||
rpc-max-body-bytes = 1000000 | ||
|
||
# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk) | ||
enabled-unsafe-cors = false |
Oops, something went wrong.