Skip to content

Commit

Permalink
fix grpc endpoint issue and update chain configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
soring323 committed Aug 19, 2023
1 parent 5c356a3 commit db5e39d
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ dependency-graph.png
contracts/@openzeppelin/*

# Ignore deploy script
development/setup_testnet.sh
development/setup_testnet.sh
development/join_testnet.sh
48 changes: 48 additions & 0 deletions JOIN_TESTNEWORK.md
Original file line number Diff line number Diff line change
@@ -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 = \"[email protected]: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
```
4 changes: 4 additions & 0 deletions development/deployment/Dockerfile-outsider
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion development/testnet/gentx/node0.json
Original file line number Diff line number Diff line change
@@ -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=="]}
2 changes: 1 addition & 1 deletion development/testnet/node0/config/client.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions development/testnet/node0/config/genesis.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "side1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhrtt9gn",
"address": "side1x2wywhhchkl6nhn24hm68n55m4jsq0lrjt4z5l",
"pub_key": null,
"account_number": "0",
"sequence": "0"
Expand All @@ -60,7 +60,7 @@
},
"balances": [
{
"address": "side1rmad8n79ct8vzg4vk6zu7j8tu95x5lnhrtt9gn",
"address": "side1x2wywhhchkl6nhn24hm68n55m4jsq0lrjt4z5l",
"coins": [
{
"denom": "uside",
Expand Down Expand Up @@ -153,19 +153,19 @@
"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",
"amount": "7000000000000"
}
}
],
"memo": "ad8f2a2815751d10ea4a621532aac6c78998f286@side_testnet_node0:26656",
"memo": "09d9fb75f1d69bff0daf77e827fad9960795ddf1@side_testnet_node0:26656",
"timeout_height": "0",
"extension_options": [],
"non_critical_extension_options": []
Expand All @@ -175,7 +175,7 @@
{
"public_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "Al1brB1S5HAbH4nh54XxyqmTM8pUcaH66EE7EaHa4si/"
"key": "AwAKrTYp11GPKBo8g6XC4abLqw7S2wju6X0RQW2gok2M"
},
"mode_info": {
"single": {
Expand All @@ -194,7 +194,7 @@
"tip": null
},
"signatures": [
"bkfJxomGsXXN7f9lCHBrb63ehs/SRbYec/4D/PVAJU8s+yMSZEQSV6Dt/G0oU9IjvMMm68w2ZLh3aZGXGlQe/Q=="
"YKzPMDwQZkeu5Mw6AbLCk4Ls9F3XslY5DaE0rgzL0AZQAFLnOqnhg0/ViHHZYUkoZ6EL9KRyEuPouU5YsxYCdQ=="
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion development/testnet/node0/config/node_key.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"7Nb6SlqeCWtLkwFiZtcJlKN27U/40V5c03UVjDcBD9a2pnPuGInLG9Zomu28dbyAtx7nQ3LRU7XKReasU5WATQ=="}}
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"u2dJTo5VG43fVj+nebp0g8mGZEdgEFa2KuQIk18w7WQiDwlbZJLTIrvRN1trWj06e3qUHwnCaTx6vchH1ZNSsA=="}}
6 changes: 3 additions & 3 deletions development/testnet/node0/config/priv_validator_key.json
Original file line number Diff line number Diff line change
@@ -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=="
}
}
11 changes: 5 additions & 6 deletions local_node.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit db5e39d

Please sign in to comment.