From dfb83f1988ccb6cfb687fd366637b1ad9d5fc04a Mon Sep 17 00:00:00 2001 From: ducphamle2 Date: Wed, 15 Mar 2023 11:35:07 -0700 Subject: [PATCH] updated setup network script --- orchestrator/relayer/examples/send_trc20.rs | 2 ++ setup-network-fresh.sh | 14 +++++++++----- start-network.sh | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/orchestrator/relayer/examples/send_trc20.rs b/orchestrator/relayer/examples/send_trc20.rs index 723998192..e42890a27 100644 --- a/orchestrator/relayer/examples/send_trc20.rs +++ b/orchestrator/relayer/examples/send_trc20.rs @@ -39,3 +39,5 @@ fn main() { ); }); } + +// PRIVATE_KEY= cargo run --package relayer --example send_trc20 diff --git a/setup-network-fresh.sh b/setup-network-fresh.sh index 6e5c77984..a3e840eee 100755 --- a/setup-network-fresh.sh +++ b/setup-network-fresh.sh @@ -9,15 +9,16 @@ ALLOCATION="10000000000uoraib,10000000000000000000000000uairi" # first we start a genesis.json with validator 1 # validator 1 will also collect the gentx's once gnerated -GRAVITY_HOME=${1:-$PWD/data} +GRAVITY_HOME=${GRAVITY_HOME:-$PWD/data} VALIDATOR=${VALIDATOR:-validator1} ORCHESTRATOR=${ORCHESTRATOR:-orchestrator1} DATA_HOME=$GRAVITY_HOME/$VALIDATOR STARTING_VALIDATOR_HOME="--home $DATA_HOME" # todo add git hash to chain name - -# rm -rf $DATA_HOME +if [ $REMOVE_DATA_HOME ]; then + rm -rf $DATA_HOME +fi $BIN init $STARTING_VALIDATOR_HOME --chain-id=$CHAIN_ID $VALIDATOR @@ -26,7 +27,8 @@ $BIN init $STARTING_VALIDATOR_HOME --chain-id=$CHAIN_ID $VALIDATOR ## testing the generated one with the default values provided by the module. # add in denom metadata for both native tokens -jq '.app_state.gravity.evm_chains = [{"evm_chain":{"evm_chain_prefix":"goerli-testnet","evm_chain_name":"Goerli network"}}] | .app_state.staking.params.bond_denom = "uoraib" | .app_state.gov.voting_params.voting_period = "60s" | .app_state.crisis.constant_fee.denom = "uoraib" | .app_state.gov.deposit_params.min_deposit[0].denom = "uoraib" | .app_state.mint.params.mint_denom = "uoraib" | .app_state.bank.denom_metadata += [{"name": "ORAIB Token", "symbol": "ORAIB", "base": "oraib", display: "oraib", "description": "A native staking & minting token", "denom_units": [{"denom": "oraib", "exponent": 0}, {"denom": "uoraib", "exponent": 6}, {"denom": "uairi", "exponent": 18}]}]' $GRAVITY_HOME/$VALIDATOR/config/genesis.json > ./genesis.json +# how to get net version: curl -X POST 'https://nile.trongrid.io/jsonrpc' --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":79}' +jq '.app_state.bech32ibc.nativeHRP = "oraib" | .app_state.gravity.params.evm_chain_params = [{"evm_chain_prefix":"goerli-testnet","average_ethereum_block_time":"15000","bridge_active":true,"bridge_chain_id":"420","bridge_ethereum_address":"0x0000000000000000000000000000000000000000","contract_source_hash":"","ethereum_blacklist":[],"gravity_id":"defaultgravityid"},{"evm_chain_prefix":"tron-testnet","average_ethereum_block_time":"3000","bridge_active":true,"bridge_chain_id":"3448148188","bridge_ethereum_address":"0x0000000000000000000000000000000000000000","contract_source_hash":"","ethereum_blacklist":[],"gravity_id":"defaultgravityid"}] | .app_state.gravity.evm_chains = [{"evm_chain":{"evm_chain_prefix":"goerli-testnet","evm_chain_name":"Goerli network","evm_chain_net_version":"5"}},{"evm_chain":{"evm_chain_prefix":"tron-testnet","evm_chain_name":"Tron Nile Network","evm_chain_net_version":"3448148188"}}] | .app_state.staking.params.bond_denom = "uoraib" | .app_state.gov.voting_params.voting_period = "60s" | .app_state.crisis.constant_fee.denom = "uoraib" | .app_state.gov.deposit_params.min_deposit[0].denom = "uoraib" | .app_state.mint.params.mint_denom = "uoraib" | .app_state.bank.denom_metadata += [{"name": "ORAIB Token", "symbol": "ORAIB", "base": "oraib", display: "oraib", "description": "A native staking & minting token", "denom_units": [{"denom": "oraib", "exponent": 0}, {"denom": "uoraib", "exponent": 6}, {"denom": "uairi", "exponent": 18}]}]' $GRAVITY_HOME/$VALIDATOR/config/genesis.json > ./genesis.json # Sets up an arbitrary number of validators on a single machine by manipulating # the --home parameter on gaiad @@ -85,4 +87,6 @@ echo "Collected $GENTXS gentx" # put the now final genesis.json into the correct folders mv ./genesis.json $GRAVITY_HOME/$VALIDATOR/config/genesis.json -# gravity tx ibc-transfer transfer transfer channel-0 orai18hr8jggl3xnrutfujy2jwpeu0l76azprlvgrwt 10000000000000000000000uairi --from validator1 --keyring-backend test --chain-id gravity-test -y --home /gravity/data/validator1 \ No newline at end of file +# gravity tx ibc-transfer transfer transfer channel-0 orai18hr8jggl3xnrutfujy2jwpeu0l76azprlvgrwt 10000000000000000000000uairi --from validator1 --keyring-backend test --chain-id gravity-test -y --home /gravity/data/validator1 + +# REMOVE_DATA_HOME=true GRAVITY_HOME=./upgrade-tests/data-local VALIDATOR=local ./setup-network-fresh.sh \ No newline at end of file diff --git a/start-network.sh b/start-network.sh index b1f3933da..d0ea7e5f1 100755 --- a/start-network.sh +++ b/start-network.sh @@ -2,7 +2,7 @@ set -eux # first we start a genesis.json with validator 1 # validator 1 will also collect the gentx's once gnerated -GRAVITY_HOME=${1:-$PWD/data} +GRAVITY_HOME=${GRAVITY_HOME:-$PWD/data} VALIDATOR=${VALIDATOR:-validator1} DATA_HOME=$GRAVITY_HOME/$VALIDATOR STARTING_VALIDATOR_HOME="--home $DATA_HOME" @@ -12,4 +12,6 @@ then echo '{"height":"0","round":0,"step":0}' > $DATA_HOME/data/priv_validator_state.json fi -gravity start $STARTING_VALIDATOR_HOME \ No newline at end of file +gravity start $STARTING_VALIDATOR_HOME + +# GRAVITY_HOME=./upgrade-tests/data-local VALIDATOR=local ./start-network.sh \ No newline at end of file