From db5e39d624a8c259020395c553c5f40371be37a7 Mon Sep 17 00:00:00 2001 From: DedicatedDev Date: Sat, 19 Aug 2023 05:38:46 +0300 Subject: [PATCH] fix grpc endpoint issue and update chain configuration --- .gitignore | 3 +- JOIN_TESTNEWORK.md | 48 +++++++++++++++++++ development/deployment/Dockerfile-outsider | 4 ++ development/testnet/gentx/node0.json | 2 +- development/testnet/node0/config/client.toml | 2 +- development/testnet/node0/config/genesis.json | 20 ++++---- .../testnet/node0/config/node_key.json | 2 +- .../node0/config/priv_validator_key.json | 6 +-- local_node.sh | 11 ++--- 9 files changed, 75 insertions(+), 23 deletions(-) create mode 100644 JOIN_TESTNEWORK.md diff --git a/.gitignore b/.gitignore index 1a9992a2..60c4b451 100644 --- a/.gitignore +++ b/.gitignore @@ -84,4 +84,5 @@ dependency-graph.png contracts/@openzeppelin/* # Ignore deploy script -development/setup_testnet.sh \ No newline at end of file +development/setup_testnet.sh +development/join_testnet.sh \ No newline at end of file diff --git a/JOIN_TESTNEWORK.md b/JOIN_TESTNEWORK.md new file mode 100644 index 00000000..086be8e7 --- /dev/null +++ b/JOIN_TESTNEWORK.md @@ -0,0 +1,48 @@ +# Join a network + +## Initialize node configuration files +```shell +export TESTNET_PATH=${PWD}/testnet +cd build/ +./sidechaind init outsider --home ${TESTNET_PATH}/outsider +``` + +## Get the genesis file for the existing network + +```shell +cp ${TESTNET_PATH}/node0/config/genesis.json ${TESTNET_PATH}/outsider/config/ +``` + +## Add at least one seed peer + +### Add seed peer (you need a seed peer online for this to work) + +```shell +# export SEEDER_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps | grep docker_seeder | awk '{print $1}')) +sed -i "s/seeds = \"\"/seeds = \"6a4fa5865eda7c4f3e9d257190f4635008a3c8d6@13.212.61.41:26656\"/g" ${TESTNET_PATH}/outsider/config/config.toml +``` + +### Set node to look for peers constantly + +```shell +sed -i 's/seed_mode = false/seed_mode = true/g' ${TESTNET_PATH}/outsider/config/config.toml +``` + +### On local networks, change addr_book_strict flag to false + +```shell +sed -i 's/addr_book_strict = true/addr_book_strict = false/g' ${TESTNET_PATH}/outsider/config/config.toml +``` + +## Build docker image + +```shell +cd ../.. +docker build -f .docker/Dockerfile-outsider . -t docker_outsider +``` + +## Start the node + +```shell +docker run --name=outsider --network=docker_default -d docker_outsider +``` \ No newline at end of file diff --git a/development/deployment/Dockerfile-outsider b/development/deployment/Dockerfile-outsider index 46b6f702..d80691ea 100644 --- a/development/deployment/Dockerfile-outsider +++ b/development/deployment/Dockerfile-outsider @@ -15,6 +15,10 @@ RUN mkdir /app/config RUN mkdir -p /app/cosmovisor/genesis/bin RUN mkdir -p /app/cosmovisor/upgrades +# Copy the library into the container +COPY development/deployment/libwasmvm.x86_64.so /usr/local/lib/ +RUN ldconfig + COPY development/build/sidechaind /app/cosmovisor/genesis/bin/sidechaind COPY development/testnet/outsider ./ COPY cosmovisor/cosmovisor /app/cosmovisor/ diff --git a/development/testnet/gentx/node0.json b/development/testnet/gentx/node0.json index fde8e110..3e83adb0 100644 --- a/development/testnet/gentx/node0.json +++ b/development/testnet/gentx/node0.json @@ -1 +1 @@ -{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"node0","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"side1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhrtt9gn","validator_address":"sidevaloper1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhm40eth","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"C9Vw0Aod/SwvfjR46G1MxUjwbdJYp6R56/tIfPBRDCI="},"value":{"denom":"uside","amount":"7000000000000"}}],"memo":"ad8f2a2815751d10ea4a621532aac6c78998f286@side_testnet_node0:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Al1brB1S5HAbH4nh54XxyqmTM8pUcaH66EE7EaHa4si/"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["bkfJxomGsXXN7f9lCHBrb63ehs/SRbYec/4D/PVAJU8s+yMSZEQSV6Dt/G0oU9IjvMMm68w2ZLh3aZGXGlQe/Q=="]} +{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"node0","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"side1x2wywhhchkl6nhn24hm68n55m4jsq0lrjt4z5l","validator_address":"sidevaloper1x2wywhhchkl6nhn24hm68n55m4jsq0lr2437hm","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"jwvpLlUvxCZwOWHG68espr7oDj2sol05ZB79Xue6O88="},"value":{"denom":"uside","amount":"7000000000000"}}],"memo":"09d9fb75f1d69bff0daf77e827fad9960795ddf1@side_testnet_node0:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AwAKrTYp11GPKBo8g6XC4abLqw7S2wju6X0RQW2gok2M"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["YKzPMDwQZkeu5Mw6AbLCk4Ls9F3XslY5DaE0rgzL0AZQAFLnOqnhg0/ViHHZYUkoZ6EL9KRyEuPouU5YsxYCdQ=="]} diff --git a/development/testnet/node0/config/client.toml b/development/testnet/node0/config/client.toml index b83b3cdf..f34e3d77 100644 --- a/development/testnet/node0/config/client.toml +++ b/development/testnet/node0/config/client.toml @@ -6,7 +6,7 @@ ############################################################################### # The network chain ID -chain-id = "side-testnet-1" +chain-id = "side-devnet-1" # The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) keyring-backend = "os" # CLI output format (text|json) diff --git a/development/testnet/node0/config/genesis.json b/development/testnet/node0/config/genesis.json index 7e82e588..fe1ffd5c 100644 --- a/development/testnet/node0/config/genesis.json +++ b/development/testnet/node0/config/genesis.json @@ -1,6 +1,6 @@ { - "genesis_time": "2023-08-18T17:36:52.084904587Z", - "chain_id": "side-testnet-1", + "genesis_time": "2023-08-19T02:38:23.927391532Z", + "chain_id": "side-devnet-1", "initial_height": "1", "consensus_params": { "block": { @@ -36,7 +36,7 @@ "accounts": [ { "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "side1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhrtt9gn", + "address": "side1x2wywhhchkl6nhn24hm68n55m4jsq0lrjt4z5l", "pub_key": null, "account_number": "0", "sequence": "0" @@ -60,7 +60,7 @@ }, "balances": [ { - "address": "side1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhrtt9gn", + "address": "side1x2wywhhchkl6nhn24hm68n55m4jsq0lrjt4z5l", "coins": [ { "denom": "uside", @@ -153,11 +153,11 @@ "max_change_rate": "0.010000000000000000" }, "min_self_delegation": "1", - "delegator_address": "side1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhrtt9gn", - "validator_address": "sidevaloper1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhm40eth", + "delegator_address": "side1x2wywhhchkl6nhn24hm68n55m4jsq0lrjt4z5l", + "validator_address": "sidevaloper1x2wywhhchkl6nhn24hm68n55m4jsq0lr2437hm", "pubkey": { "@type": "/cosmos.crypto.ed25519.PubKey", - "key": "C9Vw0Aod/SwvfjR46G1MxUjwbdJYp6R56/tIfPBRDCI=" + "key": "jwvpLlUvxCZwOWHG68espr7oDj2sol05ZB79Xue6O88=" }, "value": { "denom": "uside", @@ -165,7 +165,7 @@ } } ], - "memo": "ad8f2a2815751d10ea4a621532aac6c78998f286@side_testnet_node0:26656", + "memo": "09d9fb75f1d69bff0daf77e827fad9960795ddf1@side_testnet_node0:26656", "timeout_height": "0", "extension_options": [], "non_critical_extension_options": [] @@ -175,7 +175,7 @@ { "public_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", - "key": "Al1brB1S5HAbH4nh54XxyqmTM8pUcaH66EE7EaHa4si/" + "key": "AwAKrTYp11GPKBo8g6XC4abLqw7S2wju6X0RQW2gok2M" }, "mode_info": { "single": { @@ -194,7 +194,7 @@ "tip": null }, "signatures": [ - "bkfJxomGsXXN7f9lCHBrb63ehs/SRbYec/4D/PVAJU8s+yMSZEQSV6Dt/G0oU9IjvMMm68w2ZLh3aZGXGlQe/Q==" + "YKzPMDwQZkeu5Mw6AbLCk4Ls9F3XslY5DaE0rgzL0AZQAFLnOqnhg0/ViHHZYUkoZ6EL9KRyEuPouU5YsxYCdQ==" ] } ] diff --git a/development/testnet/node0/config/node_key.json b/development/testnet/node0/config/node_key.json index 740c7b65..8d116004 100644 --- a/development/testnet/node0/config/node_key.json +++ b/development/testnet/node0/config/node_key.json @@ -1 +1 @@ -{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"7Nb6SlqeCWtLkwFiZtcJlKN27U/40V5c03UVjDcBD9a2pnPuGInLG9Zomu28dbyAtx7nQ3LRU7XKReasU5WATQ=="}} \ No newline at end of file +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"u2dJTo5VG43fVj+nebp0g8mGZEdgEFa2KuQIk18w7WQiDwlbZJLTIrvRN1trWj06e3qUHwnCaTx6vchH1ZNSsA=="}} \ No newline at end of file diff --git a/development/testnet/node0/config/priv_validator_key.json b/development/testnet/node0/config/priv_validator_key.json index 527ede73..6a050ad2 100644 --- a/development/testnet/node0/config/priv_validator_key.json +++ b/development/testnet/node0/config/priv_validator_key.json @@ -1,11 +1,11 @@ { - "address": "DA8397B74F8FC4C253F8AEE9841FE97111F232F3", + "address": "4B8E6B65A775DCCADB950B349DA0ED5B7B21AC1F", "pub_key": { "type": "tendermint/PubKeyEd25519", - "value": "C9Vw0Aod/SwvfjR46G1MxUjwbdJYp6R56/tIfPBRDCI=" + "value": "jwvpLlUvxCZwOWHG68espr7oDj2sol05ZB79Xue6O88=" }, "priv_key": { "type": "tendermint/PrivKeyEd25519", - "value": "oz7VhVSaw1n3BC1sMl67Ld3oXG1+IF90R9b2rh291SkL1XDQCh39LC9+NHjobUzFSPBt0linpHnr+0h88FEMIg==" + "value": "YYJ+g38RD5zdmpNmXX1VMCyjcBJ2XZeZXibpUWpzmliPC+kuVS/EJnA5Ycbrx6ymvugOPayiXTlkHv1e57o7zw==" } } \ No newline at end of file diff --git a/local_node.sh b/local_node.sh index a858d72f..4a13c32b 100755 --- a/local_node.sh +++ b/local_node.sh @@ -1,10 +1,9 @@ +#!/bin/bash -KEYS[0]="dev0" -KEYS[1]="dev1" -KEYS[2]="dev2" -CHAINID="sidechain_1818-1" -MONIKER="localtestnet" -BINARY="side-devnet-1" +KEYS=("dev0" "dev1" "dev2") +CHAINID="side-testnet-1" +MONIKER="freebird" +BINARY="sidechaind" DENOMS=("uside" "uusdc") INITIAL_SUPPLY="100000000000000000000" BLOCK_GAS=10000000