-
Notifications
You must be signed in to change notification settings - Fork 351
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
Ethermint support #1295
Ethermint support #1295
Conversation
@devashishdxt @xlab @leejw51crypto see if this works -- I'll try rebasing the change onto the 0.43 branch and test it later. @adizere @hu55a1n1 FYI the protobuf definitions: |
Wow, many thanks Tomas!
The 0.43 branch (PR #948) will be merged within a couple of days. It's pretty much ready we're just adding support for legacy SDK chains (0.42). |
tested it locally with two chains (one pure Cosmos SDK-based, and one with the Ethermint module) using this 0.43-based branch: https://github.com/tomtau/ibc-rs/commits/test/ethermint-0.43 and it seems to work:
|
@RiccardoM AFAIK #1155 is for validator signature verification, so it's orthogonal to the Ethermint support (which requires account and transaction signing changes) |
) - collected changes from informalsystems#1267 (comment) - EthAccount definition was directly pasted into the proto library (as different chains the same proto definition, but under a different package path) - added a new configuration option that allows specifying the address derivation as well as the proto type of public keys (e.g. "/injective.crypto.v1beta1.ethsecp256k1.PubKey" or "/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey")
c6eaba0
to
b5990f2
Compare
…back to BaseAccount
Hi @tomtau! Thank you for your patience. I've been trying to run some tests against this PR with @romac's help. I patched our scripts to be able to run two Ethermint (0.5.0) chains. Here are some of my findings and suggestions.
$ cargo run -- -c /home/hussaini/.hermes/config.toml tx raw create-client ethermint_901-1 ethermint_902-2
Compiling ibc-relayer v0.6.2 (/home/hussaini/Documents/ibc-rs/relayer)
Compiling ibc-relayer-rest v0.1.0 (/home/hussaini/Documents/ibc-rs/relayer-rest)
Compiling ibc-relayer-cli v0.6.2 (/home/hussaini/Documents/ibc-rs/relayer-cli)
Finished dev [unoptimized + debuginfo] target(s) in 25.50s
Running `target/debug/hermes -c /home/hussaini/.hermes/config.toml tx raw create-client ethermint_901-1 ethermint_902-2`
Success: ChainError(
"deliver_tx on chain ethermint_901-1 for Tx hash E95AE4451496F4E360193D384FFCC75CFCF1763B5F2C443ED550BCAFED5E7794 reports error: code=Err(4), log=Log(\"signature verification failed; please verify account number (0) and chain-id (ethermint_901-1): unauthorized\")",
) Here's the config I am using - [global]
strategy = 'packets'
log_level = 'error'
[[chains]]
id = 'ethermint_901-1'
rpc_addr = 'http://127.0.0.1:26657'
grpc_addr = 'http://127.0.0.1:9090'
websocket_addr = 'ws://localhost:26657/websocket'
rpc_timeout = '10s'
account_prefix = 'eth'
key_name = 'testkey'
store_prefix = 'ibc'
max_gas = 200000
gas_price = { price = 0.001, denom = 'stake' }
max_msg_num = 4
max_tx_size = 1048576
clock_drift = '5s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/cosmos.crypto.secp256k1.PubKey' } }
[[chains]]
id = 'ethermint_902-2'
rpc_addr = 'http://127.0.0.1:26557'
grpc_addr = 'http://127.0.0.1:9091'
websocket_addr = 'ws://localhost:26557/websocket'
rpc_timeout = '10s'
account_prefix = 'eth'
key_name = 'testkey'
store_prefix = 'ibc'
gas_price = { price = 0.001, denom = 'stake' }
clock_drift = '5s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/cosmos.crypto.secp256k1.PubKey' } }
$ cargo run -- -c /home/hussaini/.hermes/config.toml tx raw create-client ethermint_901-1 ethermint_902-2
Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/hermes -c /home/hussaini/.hermes/config.toml tx raw create-client ethermint_901-1 ethermint_902-2`
Success: CreateClient(
CreateClient(
Attributes {
height: Height {
revision: 1,
height: 64,
},
client_id: ClientId(
"07-tendermint-0",
),
client_type: Tendermint,
consensus_height: Height {
revision: 2,
height: 50,
},
},
),
)
And the corresponding Config.toml -> [global]
strategy = 'packets'
log_level = 'error'
[[chains]]
id = 'ethermint_901-1'
rpc_addr = 'http://127.0.0.1:26657'
grpc_addr = 'http://127.0.0.1:9090'
websocket_addr = 'ws://localhost:26657/websocket'
rpc_timeout = '10s'
account_prefix = 'eth'
key_name = 'testkey'
store_prefix = 'ibc'
max_gas = 200000
gas_price = { price = 0.001, denom = 'stake' }
max_msg_num = 4
max_tx_size = 1048576
clock_drift = '5s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
[[chains]]
id = 'ethermint_902-2'
rpc_addr = 'http://127.0.0.1:26557'
grpc_addr = 'http://127.0.0.1:9091'
websocket_addr = 'ws://localhost:26557/websocket'
rpc_timeout = '10s'
account_prefix = 'eth'
key_name = 'testkey'
store_prefix = 'ibc'
gas_price = { price = 0.001, denom = 'stake' }
clock_drift = '5s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } } I think it would be nice to have a config paramter -> |
Thanks @hu55a1n1 ! yeah, I haven't tested ethermint signing with a different signing algo, but I've added a check based on the public key similar to your suggestion. As for the coin type check, that may be a good idea regardless of Ethermint -- e.g. some Cosmos SDK-only chains have custom coin types... we can perhaps open an issue for it? I'm not sure if an extra optional config + check is the simplest UX (as one may still omit that config option / leave it as default) -- maybe a simpler way would be just to always print the HD path that was used in those key operations + a reminder note for the user to verify it |
Hi @tomtau, I noticed that you added the check to fix the
All tests are passing with the previously suggested fix. 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to try and document the Ethermint version(s) which Hermes is now becoming compatible with, as of this PR.
)] | ||
pub enum AddressType { | ||
Cosmos, | ||
Ethermint { pk_type: String }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if it's a good idea to restrict the possible values that pk_type
can take, either by making this an enum, or checking the String against a predefined list of accepted values.
Beside '/injective.crypto.v1beta1.ethsecp256k1.PubKey'
and "/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey"
are there numerous other values that pk_type
can take?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are potentially many more : /ethermint.crypto.v1beta1.ethsecp256k1.PubKey
, /ethermint.crypto.v1.ethsecp256k1.PubKey
, /cosmos.crypto.ethsecp256k1.PubKey
...
Right now, in order to be useful (given Ethermint has been copied over and modified), it makes sense to keep it a bit flexible -- otherwise, every chain would need to open a PR to modify the enum.
Later, once the ethsecp256k1 support lands in Cosmos SDK, it'll make sense to deprecate this with that Cosmos SDK release and recommend chains to migrate to /cosmos.crypto.ethsecp256k1.PubKey
(or whatever the canonical proto ends up being)... and after that, remove this extra config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a plan, thanks for the detailed rationale! I agree with you.
@adizere I've added extra comments: e07d221 As I mentioned: #1295 (comment) -- I'm not sure how many Ethermint proto types are out there in the wild, so it may make sense to keep this flexible until networks migrate to the future canonical Cosmos SDK ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you Tomas!
I have two more concerns:
- We have no Ethermint chain in our CI pipeline. It will be difficult to assert that future PRs will not break compatibility with
EthAccount
s. Adding to CI is complex, but at the very least, we should have a documentation (or pointer to a document) describing how to instantiate ethermintd w/ and w/out--algo=secp256k1
, so that we know some basic steps for future (manual) testing of Hermes against ethermint-based chains.
Is this the best place to get started with starting/working with ethermint?
As a side note, a better fix would be to add support in gm
for running ethermintd, but that's also a bit more complex and need not block this PR.
- Is there anyone from crypto team that should give their input before we merge this?
|
lgtm |
Here's the patch that I used for running our E2E tests to test the changes in this PR against other ethermint/gaia chains. Note that Ethermint expects the chain id to be in a certain format as described here. The patched ./scripts/dev-env ~/.hermes/config.toml gaiad ibc-0 ethermintd ethermint_902-2 diff --git a/relayer/tests/config/fixtures/relayer_conf_example.toml b/relayer/tests/config/fixtures/relayer_conf_example.toml
index 44d001bc..35edd920 100644
--- a/relayer/tests/config/fixtures/relayer_conf_example.toml
+++ b/relayer/tests/config/fixtures/relayer_conf_example.toml
@@ -3,34 +3,35 @@ strategy = 'packets'
log_level = 'error'
[[chains]]
-id = 'chain_A'
+id = 'ethermint_901-1'
rpc_addr = 'http://127.0.0.1:26657'
grpc_addr = 'http://127.0.0.1:9090'
websocket_addr = 'ws://localhost:26657/websocket'
rpc_timeout = '10s'
-account_prefix = 'cosmos'
+account_prefix = 'eth'
key_name = 'testkey'
store_prefix = 'ibc'
-max_gas = 200000
+max_gas = 3000000
gas_price = { price = 0.001, denom = 'stake' }
max_msg_num = 4
max_tx_size = 1048576
clock_drift = '5s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
-address_type = { derivation = 'cosmos' }
+address_type = { derivation = 'ethermint', proto_type = { pk_type = '/cosmos.crypto.secp256k1.PubKey' } }
[[chains]]
-id = 'chain_B'
+id = 'ethermint_902-2'
rpc_addr = 'http://127.0.0.1:26557'
-grpc_addr = 'http://127.0.0.1:9090'
+grpc_addr = 'http://127.0.0.1:9091'
websocket_addr = 'ws://localhost:26557/websocket'
rpc_timeout = '10s'
-account_prefix = 'cosmos'
+account_prefix = 'eth'
key_name = 'testkey'
store_prefix = 'ibc'
+max_gas = 3000000
gas_price = { price = 0.001, denom = 'stake' }
clock_drift = '5s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
-address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } }
+address_type = { derivation = 'ethermint', proto_type = { pk_type = '/cosmos.crypto.secp256k1.PubKey' } }
diff --git a/scripts/dev-env b/scripts/dev-env
index eeb3dd87..9cfa8c66 100755
--- a/scripts/dev-env
+++ b/scripts/dev-env
@@ -23,19 +23,27 @@ if [ -z "$3" ]; then
missing "CHAIN_1_ID"
fi
+if [ -z "$4" ]; then
+ missing "CHAIN_0_ID"
+fi
+
+if [ -z "$5" ]; then
+ missing "CHAIN_1_ID"
+fi
-if [ "$#" -gt 4 ]; then
+if [ "$#" -gt 5 ]; then
echo "Incorrect number of parameters."
usage
fi
CONFIG_FILE="$1"
-CHAIN_0_ID="$2"
-CHAIN_1_ID="$3"
-CHAIN_2_ID="$4"
+CHAIN_0="$2"
+CHAIN_0_ID="$3"
+CHAIN_1="$4"
+CHAIN_1_ID="$5"
SETUP_CHAINS="$(dirname "$0")/setup-chains"
INIT_CLIENTS="$(dirname "$0")/init-hermes"
-"$SETUP_CHAINS" "$CHAIN_0_ID" "$CHAIN_1_ID" "$CHAIN_2_ID"
-"$INIT_CLIENTS" "$CONFIG_FILE" "$CHAIN_0_ID" "$CHAIN_1_ID" "$CHAIN_2_ID"
+"$SETUP_CHAINS" "$CHAIN_0" "$CHAIN_0_ID" "$CHAIN_1" "$CHAIN_1_ID"
+"$INIT_CLIENTS" "$CONFIG_FILE" "$CHAIN_0_ID" "$CHAIN_1_ID"
diff --git a/scripts/init-hermes b/scripts/init-hermes
index 22d2a81d..0b697725 100755
--- a/scripts/init-hermes
+++ b/scripts/init-hermes
@@ -25,8 +25,7 @@ if [ -z "$3" ]; then
missing "CHAIN_1_ID"
fi
-
-if [ "$#" -gt 4 ]; then
+if [ "$#" -gt 3 ]; then
echo "Incorrect number of parameters."
usage
fi
@@ -34,7 +33,6 @@ fi
CONFIG_FILE="$1"
CHAIN_0_ID="$2"
CHAIN_1_ID="$3"
-CHAIN_2_ID="$4"
if ! [ -f "$CONFIG_FILE" ]; then
echo "[CONFIG_FILE] ($1) does not exist or is not a file."
@@ -51,26 +49,16 @@ if ! grep -q -s "$CHAIN_1_ID" "$CONFIG_FILE"; then
usage
fi
-if [ -n "$CHAIN_2_ID" ] && ! grep -q -s "$CHAIN_2_ID" "$CONFIG_FILE"; then
- echo "error: configuration for chain [$CHAIN_2_ID] does not exist in file $CONFIG_FILE."
- usage
-fi
-
-GAIA_DATA="$(pwd)/data"
+DATA="$(pwd)/data"
echo "Building the Rust relayer..."
cargo build -q --locked
# add the key seeds to the keyring of each chain
echo "Importing keys..."
-cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_0_ID" -f "$GAIA_DATA/$CHAIN_0_ID/user_seed.json"
-cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_0_ID" -f "$GAIA_DATA/$CHAIN_0_ID/user2_seed.json" -n user2
-cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_1_ID" -f "$GAIA_DATA/$CHAIN_1_ID/user_seed.json"
-cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_1_ID" -f "$GAIA_DATA/$CHAIN_1_ID/user2_seed.json" -n user2
-
-if [ -n "$CHAIN_2_ID" ]; then
- cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_2_ID" -f "$GAIA_DATA/$CHAIN_2_ID/user_seed.json"
- cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_2_ID" -f "$GAIA_DATA/$CHAIN_2_ID/user2_seed.json" -n user2
-fi
+cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_0_ID" -f "$DATA/$CHAIN_0_ID/user_seed.json" -p "m/44'/60'/0'/0/0"
+cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_0_ID" -f "$DATA/$CHAIN_0_ID/user2_seed.json" -p "m/44'/60'/0'/0/0" -n user2
+cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_1_ID" -f "$DATA/$CHAIN_1_ID/user_seed.json" -p "m/44'/60'/0'/0/0"
+cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_1_ID" -f "$DATA/$CHAIN_1_ID/user2_seed.json" -p "m/44'/60'/0'/0/0" -n user2
echo "Done!"
diff --git a/scripts/one-chain b/scripts/one-chain
index 0fd34068..4ce2478c 100755
--- a/scripts/one-chain
+++ b/scripts/one-chain
@@ -13,7 +13,7 @@ missing() {
}
if [ -z "$1" ]; then
- missing "[BINARY] (gaiad|akash)"
+ missing "[BINARY] (gaiad|ethermint)"
fi
if [ -z "$2" ]; then
@@ -58,7 +58,12 @@ PROF_PORT=$6
GRPC_PORT=$7
SAMOLEANS=$8
-echo "Creating $BINARY instance: home=$CHAIN_DIR | chain-id=$CHAIN_ID | p2p=:$P2P_PORT | rpc=:$RPC_PORT | profiling=:$PROF_PORT | grpc=:$GRPC_PORT | samoleans=:$SAMOLEANS"
+GRPC_WEB_PORT=$((GRPC_PORT + 100))
+JRPC_PORT=$((GRPC_PORT + 10))
+
+echo -e "Creating $BINARY instance:
+ \t home=$CHAIN_DIR | chain-id=$CHAIN_ID | p2p=:$P2P_PORT | rpc=:$RPC_PORT | profiling=:$PROF_PORT |
+ \t grpc=:$GRPC_PORT | grpc-web=:$GRPC_WEB_PORT | samoleans=:$SAMOLEANS"
# Add dir for chain, exit if error
if ! mkdir -p $CHAIN_DIR/$CHAIN_ID 2>/dev/null; then
@@ -77,11 +82,11 @@ HERMES_COINS="${STAKE},${SAMOLEANS}samoleans"
$BINARY --home $CHAIN_DIR/$CHAIN_ID --chain-id $CHAIN_ID init $CHAIN_ID &> /dev/null
sleep 1
-$BINARY --home $CHAIN_DIR/$CHAIN_ID keys add validator --keyring-backend="test" --output json > $CHAIN_DIR/$CHAIN_ID/validator_seed.json 2> /dev/null
+$BINARY --home $CHAIN_DIR/$CHAIN_ID keys add validator --keyring-backend="test" --algo="secp256k1" --output json > $CHAIN_DIR/$CHAIN_ID/validator_seed.json 2> /dev/null
sleep 1
-$BINARY --home $CHAIN_DIR/$CHAIN_ID keys add user --keyring-backend="test" --output json > $CHAIN_DIR/$CHAIN_ID/user_seed.json 2> /dev/null
+$BINARY --home $CHAIN_DIR/$CHAIN_ID keys add user --keyring-backend="test" --algo="secp256k1" --output json > $CHAIN_DIR/$CHAIN_ID/user_seed.json 2> /dev/null
sleep 1
-$BINARY --home $CHAIN_DIR/$CHAIN_ID keys add user2 --keyring-backend="test" --output json > $CHAIN_DIR/$CHAIN_ID/user2_seed.json 2> /dev/null
+$BINARY --home $CHAIN_DIR/$CHAIN_ID keys add user2 --keyring-backend="test" --algo="secp256k1" --output json > $CHAIN_DIR/$CHAIN_ID/user2_seed.json 2> /dev/null
sleep 1
# Add samoleans to user
@@ -139,9 +144,10 @@ else
# sed -i '' 's/info/debug/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
fi
-# Start gaia
-echo "Start gaia on grpc port: $GRPC_PORT..."
-$BINARY --home $CHAIN_DIR/$CHAIN_ID start --pruning=nothing --grpc.address="0.0.0.0:$GRPC_PORT" --log_level error > $CHAIN_DIR/$CHAIN_ID.log 2>&1 &
+# Start chain
+echo "Start $BINARY on grpc port: $GRPC_PORT & grpc-web port: $GRPC_WEB_PORT..."
+$BINARY --home $CHAIN_DIR/$CHAIN_ID start --grpc-web.address "0.0.0.0:$GRPC_WEB_PORT" --pruning=nothing --grpc.address="0.0.0.0:$GRPC_PORT" --json-rpc.address="0.0.0.0:$JRPC_PORT" --log_level error > $CHAIN_DIR/$CHAIN_ID.log 2>&1 &
+#$BINARY --home $CHAIN_DIR/$CHAIN_ID start --pruning=nothing --grpc.address="0.0.0.0:$GRPC_PORT" --log_level error > $CHAIN_DIR/$CHAIN_ID.log 2>&1 &
# Show validator's and user's balance
sleep 3
diff --git a/scripts/setup-chains b/scripts/setup-chains
index a95e84db..ecd8f573 100755
--- a/scripts/setup-chains
+++ b/scripts/setup-chains
@@ -1,6 +1,6 @@
#!/bin/bash -e
-# Copied from https://github.com/cosmos/relayer and modified to initialize Gaia chains.
+# Copied from https://github.com/cosmos/relayer and modified to initialize multiple chains.
usage() {
echo "Usage: $0 CHAIN_0_ID CHAIN_1_ID [CHAIN_2_ID]"
@@ -14,27 +14,36 @@ missing() {
}
if [ -z "$1" ]; then
- missing "CHAIN_0_ID"
+ missing "CHAIN_0"
fi
if [ -z "$2" ]; then
+ missing "CHAIN_0_ID"
+fi
+
+if [ -z "$3" ]; then
+ missing "CHAIN_1"
+fi
+
+if [ -z "$4" ]; then
missing "CHAIN_1_ID"
fi
-if [ "$#" -gt 3 ]; then
+if [ "$#" -gt 4 ]; then
echo "Incorrect number of parameters."
usage
fi
-CHAIN_0_ID="$1"
-CHAIN_1_ID="$2"
-CHAIN_2_ID="$3"
+CHAIN_0="$1"
+CHAIN_0_ID="$2"
+CHAIN_1="$3"
+CHAIN_1_ID="$4"
-GAIA_DATA="$(pwd)/data"
+DATA_DIR="$(pwd)/data"
# Ensure user understands what will be deleted
-if [[ -d $GAIA_DATA ]] && [[ ! "$3" == "skip" ]]; then
+if [[ -d $DATA_DIR ]] && [[ ! "$3" == "skip" ]]; then
echo "WARNING: $0 will DELETE the '$(pwd)/data' folder."
read -p "> Do you wish to continue? (y/n): " -n 1 -r
echo
@@ -43,50 +52,44 @@ if [[ -d $GAIA_DATA ]] && [[ ! "$3" == "skip" ]]; then
fi
fi
-# Ensure gaiad is installed
-if ! [ -x "$(which gaiad)" ]; then
- echo "Error: gaiad is not installed. Try running 'make build-gaia'" >&2
+# Ensure chains are installed
+if ! [ -x "$(which $CHAIN_0)" ]; then
+ echo "Error: $CHAIN_0 is not installed." >&2
+ exit 1
+fi
+if ! [ -x "$(which $CHAIN_1)" ]; then
+ echo "Error: $CHAIN_1 is not installed." >&2
exit 1
fi
# Display software version
-echo "GAIA VERSION INFO: $(gaiad version --log_level info)"
+echo "$CHAIN_0 VERSION INFO: $($CHAIN_0 version --log_level info)"
+echo "$CHAIN_1 VERSION INFO: $($CHAIN_1 version --log_level info)"
# Delete data from old runs
-echo "Deleting $GAIA_DATA folder..."
-rm -rf "$GAIA_DATA"
+echo "Deleting $DATA_DIR folder..."
+rm -rf "$DATA_DIR"
-# Stop existing gaiad processes
-killall gaiad &> /dev/null || true
-killall akash &> /dev/null || true
+# Stop existing chain processes
+killall $CHAIN_0 &> /dev/null || true
+killall $CHAIN_1 &> /dev/null || true
-echo "Generating gaia configurations..."
-mkdir -p "$GAIA_DATA" && cd "$GAIA_DATA" && cd ../
+echo "Generating chains' configurations..."
+mkdir -p "$DATA_DIR" && cd "$DATA_DIR" && cd ../
ONE_CHAIN="$(dirname "$0")/one-chain"
CHAIN_0_RPC_PORT=26657
CHAIN_1_RPC_PORT=26557
-CHAIN_2_RPC_PORT=26457
CHAIN_0_GRPC_PORT=9090
CHAIN_1_GRPC_PORT=9091
-CHAIN_2_GRPC_PORT=9092
CHAIN_0_SAMOLEANS=100000000000
CHAIN_1_SAMOLEANS=100000000000
-CHAIN_2_SAMOLEANS=100000000000
-
-"$ONE_CHAIN" gaiad "$CHAIN_0_ID" ./data $CHAIN_0_RPC_PORT 26656 6060 $CHAIN_0_GRPC_PORT $CHAIN_0_SAMOLEANS
-"$ONE_CHAIN" gaiad "$CHAIN_1_ID" ./data $CHAIN_1_RPC_PORT 26556 6061 $CHAIN_1_GRPC_PORT $CHAIN_1_SAMOLEANS
-if [ -n "$CHAIN_2_ID" ]; then
- "$ONE_CHAIN" gaiad "$CHAIN_2_ID" ./data $CHAIN_2_RPC_PORT 26456 6062 $CHAIN_2_GRPC_PORT $CHAIN_2_SAMOLEANS
-fi
-
-[ -f "$GAIA_DATA/$CHAIN_0_ID.log" ] && echo "$CHAIN_0_ID initialized. Watch file $GAIA_DATA/$CHAIN_0_ID.log to see its execution."
-[ -f "$GAIA_DATA/$CHAIN_1_ID.log" ] && echo "$CHAIN_1_ID initialized. Watch file $GAIA_DATA/$CHAIN_1_ID.log to see its execution."
+"$ONE_CHAIN" $CHAIN_0 "$CHAIN_0_ID" ./data $CHAIN_0_RPC_PORT 26656 6060 $CHAIN_0_GRPC_PORT $CHAIN_0_SAMOLEANS
+"$ONE_CHAIN" $CHAIN_1 "$CHAIN_1_ID" ./data $CHAIN_1_RPC_PORT 26556 6061 $CHAIN_1_GRPC_PORT $CHAIN_1_SAMOLEANS
-if [ -n "$CHAIN_2_ID" ]; then
- [ -f "$GAIA_DATA/$CHAIN_2_ID.log" ] && echo "$CHAIN_2_ID initialized. Watch file $GAIA_DATA/$CHAIN_2_ID.log to see its execution."
-fi
+[ -f "$DATA_DIR/$CHAIN_0_ID.log" ] && echo "$CHAIN_0_ID initialized. Watch file $DATA_DIR/$CHAIN_0_ID.log to see its execution."
+[ -f "$DATA_DIR/$CHAIN_1_ID.log" ] && echo "$CHAIN_1_ID initialized. Watch file $DATA_DIR/$CHAIN_1_ID.log to see its execution." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
For visibility, there's also similar PR to gravity bridge's orchestrator(PeggyJV/gravity-bridge#150), ideally, these cosmos-related rust projects should share a common infrastructure in the future.
* added Ethermint support (fixes informalsystems#1267 informalsystems#1071) - collected changes from informalsystems#1267 (comment) - EthAccount definition was directly pasted into the proto library (as different chains the same proto definition, but under a different package path) - added a new configuration option that allows specifying the address derivation as well as the proto type of public keys (e.g. "/injective.crypto.v1beta1.ethsecp256k1.PubKey" or "/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey") * added a comment for eth address and change query_account return type back to BaseAccount * check the public key type in ethermint address generation * added a check on `sign_msg` * added comments + reordered example config * added links with information for testing Ethermint * adjusted a comment for `EthAccount` Co-authored-by: Romain Ruetschi <[email protected]>
Closes: #1267 #1071
Description
hermes
is not compatible with ethermint #1267 (comment)(as different chains use the same proto definition, but under a different package path)
as well as the proto type of public keys
(e.g. "/injective.crypto.v1beta1.ethsecp256k1.PubKey"
or "/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey")
For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.