From 480b2478289154fdb74e1564970238e83bbce5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Havel?= Date: Wed, 12 May 2021 00:51:20 +0000 Subject: [PATCH] Add NETWORK_ID variable (#2330) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same variable BOOTNODE_PORT was used for p2p port of bootnode and testnet Chain and Network ID. Adding variable NETWORK_ID to make scripts less confusing and create option to choose arbitrary ID. Co-authored-by: Mário Havel <61149543+taxmeifyoucan@users.noreply.github.com> Co-authored-by: Michael Sproul --- scripts/local_testnet/ganache_test_node.sh | 4 ++-- scripts/local_testnet/setup.sh | 4 ++-- scripts/local_testnet/vars.env | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/local_testnet/ganache_test_node.sh b/scripts/local_testnet/ganache_test_node.sh index c6bf47031a..43a0e0e5dc 100755 --- a/scripts/local_testnet/ganache_test_node.sh +++ b/scripts/local_testnet/ganache_test_node.sh @@ -9,5 +9,5 @@ ganache-cli \ --mnemonic "$ETH1_NETWORK_MNEMONIC" \ --port 8545 \ --blockTime 3 \ - --networkId 4242 \ - --chainId 4242 + --networkId "$NETWORK_ID" \ + --chainId "$NETWORK_ID" diff --git a/scripts/local_testnet/setup.sh b/scripts/local_testnet/setup.sh index 42fe217ac8..ad0e053752 100755 --- a/scripts/local_testnet/setup.sh +++ b/scripts/local_testnet/setup.sh @@ -30,7 +30,7 @@ lcli \ --min-genesis-time $GENESIS_TIME \ --genesis-delay $GENESIS_DELAY \ --genesis-fork-version $GENESIS_FORK_VERSION \ - --eth1-id $BOOTNODE_PORT \ + --eth1-id $NETWORK_ID \ --eth1-follow-distance 1 \ --seconds-per-eth1-block 1 \ --force @@ -54,4 +54,4 @@ lcli \ --testnet-dir $TESTNET_DIR \ $GENESIS_VALIDATOR_COUNT -echo Created genesis state in $TESTNET_DIR \ No newline at end of file +echo Created genesis state in $TESTNET_DIR diff --git a/scripts/local_testnet/vars.env b/scripts/local_testnet/vars.env index 7320210533..356ddc9d98 100644 --- a/scripts/local_testnet/vars.env +++ b/scripts/local_testnet/vars.env @@ -19,4 +19,9 @@ GENESIS_VALIDATOR_COUNT=80 NODE_COUNT=4 GENESIS_DELAY=180 + +# Port for P2P communication with bootnode BOOTNODE_PORT=4242 + +# Network ID and Chain ID of local eth1 test network +NETWORK_ID=4242