Join the Public Testnet
Configure your machine become to the public testnet validator
Now at ShareRing are maintaining various blockchain networks, in addition to the mainnet we also have a public testnet. The public testnet is a place where developers can test their contracts before running them on the mainnet with real money.
There are two ways to join the testnet: State Sync and Full Sync.
State Sync works by replaying larger chunks of application state directly rather than replaying individual blocks or consensus rounds.
Full Sync works by replaying every single block from the very beginning of the blockchain.
1. State Sync
When you join the network with State Sync it is much quicker than Full Sync because you don't need to run all blocks and transactions from genesis.
1.1 Download ShareLedger binary and init
the home folder:
# Download Libwasm used for cosmwasm module
curl -LJ https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a > /lib/libwasmvm_muslc.a
# download shareledger binary
curl -LJ https://github.com/ShareRing/Shareledger/releases/tag/v1.4.1/shareledger > /usr/bin/shareledger
chmod +x /usr/bin/shareledger
shareledger init <your node name> --chain-id ShareRing-KUD
Next, check the ~/.shareledger
directory contains the following:
~/.shareledger
├── config
│ ├── addrbook.json
│ ├── app.toml
│ ├── client.toml
│ ├── config.toml
│ ├── genesis.json
│ ├── gentx
│ ├── node_key.json
│ └── priv_validator_key.json
├── data
└── wasm
├── cache
│ └── modules
└── state
└── wasm
1.2 Add the public testnet genesis
Replace the contents of the genesis.json
file with following genesis data:
{
"genesis_time": "2022-10-06T03:43:36.492323Z",
"chain_id": "ShareRing-KUD",
"initial_height": "1",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
"max_age_num_blocks": "100000",
"max_age_duration": "172800000000000",
"max_bytes": "1048576"
},
"validator": {
"pub_key_types": [
"ed25519"
]
},
"version": {}
},
"app_hash": "",
"app_state": {
"asset": {
"assets": []
},
"auth": {
"params": {
"max_memo_characters": "256",
"tx_sig_limit": "7",
"tx_size_cost_per_byte": "10",
"sig_verify_cost_ed25519": "590",
"sig_verify_cost_secp256k1": "1000"
},
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "shareledger1k8rv5lrq26scy6y2jmrnd7g0f9zep8e5zjxd0e",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "shareledger1rnnwgye759stgs8nszuj6secjsm79chrz544wf",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "shareledger1pd44jluffrc4gxu5h9ajnequ44hspplazr2uxs",
"pub_key": null,
"account_number": "0",
"sequence": "0"
}
]
},
"authz": {
"authorization": []
},
"bank": {
"params": {
"send_enabled": [],
"default_send_enabled": true
},
"balances": [
{
"address": "shareledger1pd44jluffrc4gxu5h9ajnequ44hspplazr2uxs",
"coins": [
{
"denom": "nshr",
"amount": "2500000000000000"
}
]
},
{
"address": "shareledger1rnnwgye759stgs8nszuj6secjsm79chrz544wf",
"coins": [
{
"denom": "nshr",
"amount": "1000000000000"
}
]
},
{
"address": "shareledger1k8rv5lrq26scy6y2jmrnd7g0f9zep8e5zjxd0e",
"coins": [
{
"denom": "nshr",
"amount": "1000000000000"
}
]
}
],
"supply": [],
"denom_metadata": []
},
"booking": {
"bookings": []
},
"capability": {
"index": "1",
"owners": []
},
"crisis": {
"constant_fee": {
"denom": "nshr",
"amount": "1000000000000"
}
},
"distribution": {
"params": {
"community_tax": "0",
"base_proposer_reward": "0.010000000000000000",
"bonus_proposer_reward": "0.040000000000000000",
"withdraw_addr_enabled": true
},
"fee_pool": {
"community_pool": []
},
"delegator_withdraw_infos": [],
"previous_proposer": "",
"outstanding_rewards": [],
"validator_accumulated_commissions": [],
"validator_historical_rewards": [],
"validator_current_rewards": [],
"delegator_starting_infos": [],
"validator_slash_events": []
},
"document": {
"documents": []
},
"electoral": {
"accStateList": [
{
"key": "accopshareledger1yc3k6chl6sn370k66r83ly50npd9xr4z8t52y0",
"address": "shareledger1yc3k6chl6sn370k66r83ly50npd9xr4z8t52y0",
"status": "active"
},
{
"key": "votershareledger1pd44jluffrc4gxu5h9ajnequ44hspplazr2uxs",
"address": "shareledger1pd44jluffrc4gxu5h9ajnequ44hspplazr2uxs",
"status": "active"
}
],
"authority": {
"address": "shareledger1k8rv5lrq26scy6y2jmrnd7g0f9zep8e5zjxd0e"
},
"treasurer": {
"address": "shareledger1rnnwgye759stgs8nszuj6secjsm79chrz544wf"
}
},
"evidence": {
"evidence": []
},
"feegrant": {
"allowances": []
},
"gentlemint": {
"exchangeRate": null,
"levelFeeList": [],
"actionLevelFeeList": []
},
"genutil": {
"gen_txs": [
{
"body": {
"messages": [
{
"@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
"description": {
"moniker": "Sapphire",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
},
"commission": {
"rate": "0.100000000000000000",
"max_rate": "0.200000000000000000",
"max_change_rate": "0.010000000000000000"
},
"min_self_delegation": "1",
"delegator_address": "shareledger1pd44jluffrc4gxu5h9ajnequ44hspplazr2uxs",
"validator_address": "shareledgervaloper1pd44jluffrc4gxu5h9ajnequ44hsppla270ewm",
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "btNtrQc0zfZYaBlAnzfen/7yO5p1szgwd8ar9dj0Euc="
},
"value": {
"denom": "nshr",
"amount": "2500000000000000"
}
}
],
"memo": "30351e72ce595c23079b5df8a92764a67fc50084@10.0.196.13:26656",
"timeout_height": "0",
"extension_options": [],
"non_critical_extension_options": []
},
"auth_info": {
"signer_infos": [
{
"public_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "AqoWOHV6q2FM6ffr1WVJnOSLIvV3K/GsBLqRlE3z0jRE"
},
"mode_info": {
"single": {
"mode": "SIGN_MODE_DIRECT"
}
},
"sequence": "0"
}
],
"fee": {
"amount": [],
"gas_limit": "200000",
"payer": "",
"granter": ""
}
},
"signatures": [
"SEDjK6+3G5GYbOfGEBNPQwu7+jnz/x3mGZjEhGMoh0NuEWnFhbLiQ5e1GLOyciUDlYjxq3bUVczO6KFojXpyiw=="
]
}
]
},
"gov": {
"starting_proposal_id": "1",
"deposits": [],
"votes": [],
"proposals": [],
"deposit_params": {
"min_deposit": [
{
"denom": "nshr",
"amount": "10000000000000000"
}
],
"max_deposit_period": "172800s"
},
"voting_params": {
"voting_period": "172800s"
},
"tally_params": {
"quorum": "0.334000000000000000",
"threshold": "0.500000000000000000",
"veto_threshold": "0.334000000000000000"
}
},
"ibc": {
"client_genesis": {
"clients": [],
"clients_consensus": [],
"clients_metadata": [],
"params": {
"allowed_clients": [
"06-solomachine",
"07-tendermint"
]
},
"create_localhost": false,
"next_client_sequence": "0"
},
"connection_genesis": {
"connections": [],
"client_connection_paths": [],
"next_connection_sequence": "0",
"params": {
"max_expected_time_per_block": "30000000000"
}
},
"channel_genesis": {
"channels": [],
"acknowledgements": [],
"commitments": [],
"receipts": [],
"send_sequences": [],
"recv_sequences": [],
"ack_sequences": [],
"next_channel_sequence": "0"
}
},
"id": {
"IDs": []
},
"interchainaccounts": {
"controller_genesis_state": {
"active_channels": [],
"interchain_accounts": [],
"ports": [],
"params": {
"controller_enabled": true
}
},
"host_genesis_state": {
"active_channels": [],
"interchain_accounts": [],
"port": "icahost",
"params": {
"host_enabled": true,
"allow_messages": []
}
}
},
"mint": {
"minter": {
"inflation": "0",
"annual_provisions": "0.000000000000000000"
},
"params": {
"mint_denom": "nshr",
"inflation_rate_change": "0",
"inflation_max": "0",
"inflation_min": "0",
"goal_bonded": "0.670000000000000000",
"blocks_per_year": "6311520"
}
},
"params": null,
"slashing": {
"params": {
"signed_blocks_window": "50000",
"min_signed_per_window": "0.500000000000000000",
"downtime_jail_duration": "600s",
"slash_fraction_double_sign": "0.050000000000000000",
"slash_fraction_downtime": "0.010000000000000000"
},
"signing_infos": [],
"missed_blocks": []
},
"staking": {
"params": {
"unbonding_time": "1814400s",
"max_validators": 100,
"max_entries": 7,
"historical_entries": 0,
"bond_denom": "nshr"
},
"last_total_power": "0",
"last_validator_powers": [],
"validators": [],
"delegations": [],
"unbonding_delegations": [],
"redelegations": [],
"exported": false
},
"swap": {
"params": {},
"requests": [],
"requestCount": "0",
"batches": [],
"batchCount": "0",
"schemas": []
},
"transfer": {
"port_id": "transfer",
"denom_traces": [],
"params": {
"send_enabled": true,
"receive_enabled": true
}
},
"upgrade": {},
"vesting": {},
"wasm": {
"params": {
"code_upload_access": {
"permission": "Everybody",
"address": ""
},
"instantiate_default_permission": "Everybody"
},
"codes": [],
"contracts": [],
"sequences": [],
"gen_msgs": []
}
}
}
Get the current block height and hash for configuration state sync:
RPC=https://rpc-testnet.shareri.ng
LATEST_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height)
BLOCK_HEIGHT=$(($LATEST_HEIGHT - 10000))
TRUST_HASH=$(curl -s "$RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
SNAPSHOT_RPC1=http://43.130.107.123:26657/
SNAPSHOT_RPC2=http://43.130.72.123:26657/
SNAPSHOT_RPC3=http://170.106.52.207:26657/
SNAPSHOT_RPC4=http://43.130.139.132:26657/
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAPSHOT_RPC1,$SNAPSHOT_RPC2,$SNAPSHOT_RPC3,$SNAPSHOT_RPC4\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" ~/.shareledger/config/config.toml
shareledger start --home ~/.shareledger --p2p.seeds 30351e72ce595c23079b5df8a92764a67fc50084@43.130.107.123:26656,b234b56e9ad3dad6bd6e30c59e45c9c916960f34@43.130.72.123:26656,ae87db11132e52bdc5e055bdd4380091fd6edc3c@170.106.52.207:26656, ce6a6b53409ec9b523c4895278c5a0047033a5ad@43.130.139.132:26656,24da27bb5ce294f108403e18c2699615ed121dcb@43.130.67.94:26656,ae87db11132e52bdc5e055bdd4380091fd6edc3c@43.130.79.120:26656,96a0cd9b0f2bb582c03f84bad0700acbd30feeef@43.130.74.119,:26656,bc28a3cea04ef99fa874c58ddc0072d52eb86ef9@43.130.77.179:26656
2. Full Sync
You also have the option to join the network with Full Sync. With Full Sync you re-run the blocks and transactions from beginning genesis. It takes longer to complete this process before you can create a validator.
After the step 1.2 instead configuration state sync. You should start enter the following command:
--home
is the place for the ShareLedger home directory.
--p2p.seeds
is a list of the p2p nodeID and the IP address of our genesis node.
shareledger start --home ~/.shareledger --p2p.seeds 30351e72ce595c23079b5df8a92764a67fc50084@43.130.107.123:26656,b234b56e9ad3dad6bd6e30c59e45c9c916960f34@43.130.72.123:26656,ae87db11132e52bdc5e055bdd4380091fd6edc3c@170.106.52.207:26656, ce6a6b53409ec9b523c4895278c5a0047033a5ad@43.130.139.132:26656,24da27bb5ce294f108403e18c2699615ed121dcb@43.130.67.94:26656,ae87db11132e52bdc5e055bdd4380091fd6edc3c@43.130.79.120:26656,96a0cd9b0f2bb582c03f84bad0700acbd30feeef@43.130.74.119,:26656,bc28a3cea04ef99fa874c58ddc0072d52eb86ef9@43.130.77.179:26656