diff --git a/.github/workflows/gentx_format.yml b/.github/workflows/gentx_format.yml new file mode 100644 index 000000000..3aa37aa13 --- /dev/null +++ b/.github/workflows/gentx_format.yml @@ -0,0 +1,17 @@ + +name: Gentx Format +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + verify-gentx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: gentx-validation + run: | + bash -x ./scripts/validate-gentxs.sh diff --git a/README.md b/README.md index 69922c372..009a3f2ce 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ -![cover](https://user-images.githubusercontent.com/8366960/136831207-5621f14c-1505-4ada-8b1e-13d0515709a4.png) - # Testnets -This repo contains genesis files for the Evmos Testnets. - -The latest testnet is Arsia Mons. +This repo contains genesis files for the [Evmos](https://github.com/tharsis/evmos) Testnets. -[Join the testnet](https://evmos.dev/testnet/join.html). +The latest testnet is [Olympus Mons](./olympus_mons). You can find a list of [seeds](https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#seed) and [peers](https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#persistent-peer) to connect to in the respective directory. -## Seeds +[Arsia Mons](./arsia_mons) is the deprecated testnet which ran from 2021-10-07 to 2021-11-17. -- c36cec90ded95d162b85f8ecd00ecd7c8849ca75@arsiamons.seed.evmos.org:26656 +For the full instructions on how to [join the testnet](https://evmos.dev/testnet/join.html), please refer to the official [documentation](https://evmos.dev). diff --git a/arsia_mons/README.md b/arsia_mons/README.md new file mode 100644 index 000000000..6593a7fc8 --- /dev/null +++ b/arsia_mons/README.md @@ -0,0 +1,20 @@ +# Arsia Mons Testnet + +![cover](https://user-images.githubusercontent.com/8366960/136831207-5621f14c-1505-4ada-8b1e-13d0515709a4.png) + +## Instructions + +Follow the instructions on the official documentation to [join the testnet](https://evmos.dev/testnet/join.html) and how to obtain tokens using the [faucet](https://evmos.dev/testnet/faucet.html). + +## Details + +- Network Chain ID: `evmos_9000-1` +- EIP155 Chain ID: `9000` +- `evmosd` version: [`v0.1.x`](https://github.com/tharsis/evmos/releases) +- Faucet: [faucet.evmos.org](https://faucet.evmos.org) +- EVM explorer: [evm.evmos.org](https://evm.evmos.org) +- Cosmos explorer: [explorer.evmos.org](https://explorer.evmos.org) + +## Seeds & Peers + +You can find seeds & peers on the [seeds.txt](./seeds.txt) and [peers.txt](./peers.txt) files, respectively. If you want to share your seed or peer, please fork this repo and and add it to the bottom of the corresponding `.txt` file. diff --git a/arsia_mons/peers.txt b/arsia_mons/peers.txt new file mode 100644 index 000000000..69510be55 --- /dev/null +++ b/arsia_mons/peers.txt @@ -0,0 +1,15 @@ +be7593d1d2cae15a574537f9107f525200824767@194.163.187.94:26656 +78605eed3018a74d9c8c3a912cd8e6d5c9a9ca4b@65.21.232.149:26726 +3bd90caf48ddd2d6b290550ecccd63348fc51da0@95.217.107.96:26658 +f8da50943569f160854ac21c9ffb46fb4ff7bc0d@144.217.252.197:26626 +1c4c38243893889a17fd3e677999f896b2b18586@95.217.35.111:26666 +0e4dec8dd2cb74277bae3a9e7f1816603e97ce60@161.97.178.48:26656 +3e7b138c766dc6da32decca8665da1afb2b6bb88@207.244.249.17:26656 +5502b008356087cb689211bb3c4285b7ce7f6571@95.217.154.12:26656 +8227d17c3cf123108c69bf671295e5fb22d9beb3@161.97.115.68:26656 +56de4d8fe7421f5a4fb6ba75b20d749be3eecf22@95.217.84.54:26656 +06e3dfce2d729250e810bd5605ad7f05f3b1fc2c@75.119.155.119:26656 +7cb1576a6ed3dbdc62bc30908ff7d7e910c5b08f@78.46.52.20:46656 +5502b008356087cb689211bb3c4285b7ce7f6571@95.217.154.12:26656 +5576b0160761fe81ccdf88e06031a01bc8643d51@195.201.108.97:24656 +13e850d14610f966de38fc2f925f6dc35c7f4bf4@176.9.60.27:26656 diff --git a/arsia_mons/seeds.txt b/arsia_mons/seeds.txt new file mode 100644 index 000000000..23650e0c3 --- /dev/null +++ b/arsia_mons/seeds.txt @@ -0,0 +1,3 @@ +c36cec90ded95d162b85f8ecd00ecd7c8849ca75@arsiamons.seed.evmos.org:26656 +3787335176bbb91bf14a67724ebe0f0940ca5afb@evmos-seed.artifact-staking.io:26656 +faa31510d9280e74e7f2e767a62023bd5c896c27@evmos-testnet.mercury-nodes.net:29447 \ No newline at end of file diff --git a/img/olympus_mons.png b/img/olympus_mons.png new file mode 100644 index 000000000..3aba48c16 Binary files /dev/null and b/img/olympus_mons.png differ diff --git a/olympus_mons/README.md b/olympus_mons/README.md new file mode 100644 index 000000000..88d6638ae --- /dev/null +++ b/olympus_mons/README.md @@ -0,0 +1,32 @@ +# Olympus Mons Testnet + +![cover](/img/olympus_mons.png) + +## Instructions + +Follow the instructions on the official documentation to [join the testnet](https://evmos.dev/testnet/join.html) and how to obtain tokens using the [faucet](https://evmos.dev/testnet/faucet.html). + +## Details + +- Network Chain ID: `evmos_9000-2` +- EIP155 Chain ID: `9000` +- `evmosd` version: [`v0.2.x`](https://github.com/tharsis/evmos/releases) +- Faucet: [faucet.evmos.org](https://faucet.evmos.org) +- EVM explorer: [evm.evmos.org](https://evm.evmos.org) +- Cosmos explorer: [explorer.evmos.org](https://explorer.evmos.org) + +## Schedule + +### Application Period + +Submissions open on November 17, 2021 14:00 PST, participants are required to [submit gentx](./gentx.md). + +Submissions close on November 19, 2021 12:00 PST. + +### Genesis Launch + +November 19, 2021 14:00 PST. + +## Seeds & Peers + +You can find seeds & peers on the [seeds.txt](./seeds.txt) and [peers.txt](./peers.txt) files, respectively. If you want to share your seed or peer, please fork this repo and and add it to the bottom of the corresponding `.txt` file. diff --git a/olympus_mons/genesis.json b/olympus_mons/genesis.json new file mode 100644 index 000000000..5f35a075e --- /dev/null +++ b/olympus_mons/genesis.json @@ -0,0 +1,322 @@ +{ + "genesis_time": "2021-11-17T14:44:56.22806Z", + "chain_id": "evmos_9000-2", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "1048576", + "max_gas": "81500000", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "403200", + "max_age_duration": "2419200000000000", + "max_bytes": "150000" + }, + "validator": { + "pub_key_types": ["ed25519"] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "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": "/ethermint.types.v1.EthAccount", + "base_account": { + "address": "evmos1zm9wlujdfp4j95ajx2xsazqy8jk97kgznsecfr", + "pub_key": null, + "account_number": "0", + "sequence": "0" + }, + "code_hash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + }, + { + "@type": "/ethermint.types.v1.EthAccount", + "base_account": { + "address": "evmos1z4ya98ga2xnffn2mhjym7tzlsm49ec23890sze", + "pub_key": null, + "account_number": "0", + "sequence": "0" + }, + "code_hash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + } + ] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [ + { + "address": "evmos1z4ya98ga2xnffn2mhjym7tzlsm49ec23890sze", + "coins": [ + { + "denom": "aphoton", + "amount": "250000000000000000000000" + } + ] + }, + { + "address": "evmos1zm9wlujdfp4j95ajx2xsazqy8jk97kgznsecfr", + "coins": [ + { + "denom": "aphoton", + "amount": "10000000000000000000000" + } + ] + } + ], + "supply": [ + { + "denom": "aphoton", + "amount": "260000000000000000000000" + } + ], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "crisis": { + "constant_fee": { + "denom": "aphoton", + "amount": "1000" + } + }, + "distribution": { + "params": { + "community_tax": "0.020000000000000000", + "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": [] + }, + "evidence": { + "evidence": [] + }, + "evm": { + "accounts": [], + "params": { + "evm_denom": "aphoton", + "enable_create": true, + "enable_call": true, + "extra_eips": [], + "chain_config": { + "homestead_block": "0", + "dao_fork_block": "0", + "dao_fork_support": true, + "eip150_block": "0", + "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "eip155_block": "0", + "eip158_block": "0", + "byzantium_block": "0", + "constantinople_block": "0", + "petersburg_block": "0", + "istanbul_block": "0", + "muir_glacier_block": "0", + "berlin_block": "0", + "catalyst_block": null, + "london_block": "0" + } + } + }, + "feegrant": { + "allowances": [] + }, + "genutil": { + "gen_txs": [ + { + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "akash", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "0.200000000000000000", + "max_change_rate": "0.010000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "evmos1zm9wlujdfp4j95ajx2xsazqy8jk97kgznsecfr", + "validator_address": "evmosvaloper1zm9wlujdfp4j95ajx2xsazqy8jk97kgz77kgg7", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "QT7dC3UhHHCZA2o8oL6gFXLbRWCFWU/mLnNKiIOVcMA=" + }, + "value": { + "denom": "aphoton", + "amount": "1000000000000000000000" + } + } + ], + "memo": "5911ce3fe63527cff9ad1225a82d860a4c08df03@10.128.0.25:26656", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/ethermint.crypto.v1.ethsecp256k1.PubKey", + "key": "A2FSYsg/8mhJ0JsrP+SQXBZCusxfVy4QhpqTtJeyDAeM" + }, + "mode_info": { + "single": { + "mode": "SIGN_MODE_DIRECT" + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "200000", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "IikxRUJ7Z4lICyXyboT0IL+f590EkIDsIC22wpUl/MEjxqqvykF+84vPVImjOwzG8XbN+kE2WkDqMPfBiatE/QE=" + ] + } + ] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "aphoton", + "amount": "10000000" + } + ], + "max_deposit_period": "64800s" + }, + "voting_params": { + "voting_period": "64800s" + }, + "tally_params": { + "quorum": "0.200000000000000000", + "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" + } + }, + "mint": { + "minter": { + "inflation": "0.130000000000000000", + "annual_provisions": "0.000000000000000000" + }, + "params": { + "mint_denom": "aphoton", + "inflation_rate_change": "0.130000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "goal_bonded": "0.670000000000000000", + "blocks_per_year": "6311520" + } + }, + "params": null, + "slashing": { + "params": { + "signed_blocks_window": "100", + "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": "259200s", + "max_validators": 300, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "aphoton" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/olympus_mons/gentx.md b/olympus_mons/gentx.md new file mode 100644 index 000000000..c817d59dd --- /dev/null +++ b/olympus_mons/gentx.md @@ -0,0 +1,80 @@ +# Evmos Incentivized Testnet + +Thank you for becoming a genesis validator on Evmos! This guide will provide instructions on setting up a node, submitting a gentx, and other tasks needed to participate in the launch of the Evmos Olympus Mons incentivized testnet. + +A `gentx` does three things: + +- Registers the validator account you created as a validator operator account (i.e. the account that controls the validator). +- Self-delegates the provided amount of staking tokens. +- Links the operator account with a Tendermint node pubkey that will be used for signing blocks. If no `--pubkey` flag is provided, it defaults to the local node pubkey created via the `evmosd init` command. + +## Setup + +Software: + +- Go version: [v1.17+](https://golang.org/dl/) +- Evmos version: [v0.2.x](https://github.com/tharsis/evmos/releases) + +To verify that Go is installed: + +```sh +go version +# Should return go version go1.17 linux/amd64 +``` + +## Instructions (Until November 19, 2021 12:00 PST) + +These instructions are written targeting an Ubuntu 20.04 system. Relevant changes to commands should be made depending on the OS/architecture you are running on. + +1. Install `evmosd` + + ```bash + git clone https://github.com/tharsis/evmos + cd evmos && git checkout tags/v0.2.x -b + make install + ``` + + Make sure to checkout to some `v0.2.x` tag. + + Verify that everything is OK. If you get something *like* the following, you've successfully installed Evmos on your system. + + ```sh + evmosd version --long + + name: evmos + server_name: evmosd + version: '"0.1.3"' + commit: 7ad7715c59ec38fd19c06de54d03a982afebf961 + build_tags: netgo,ledger + go: go version go1.17 darwin/amd64 + ``` + +2. Initialize the `evmosd` directories and create the local file with the correct chain-id + + ```bash + evmosd init --chain-id=evmos_9000-2 + ``` + +3. Create a local key pair in the keybase + + ```bash + evmosd keys add + ``` + + Make sure to keep mnemonic seed which will be used to receive rewards at the time of mainnet launch. + +4. Add the account to your local genesis file with a given amount and key you just created. + + ```bash + evmosd add-genesis-account $(evmosd keys show -a) 1000000000000aphoton + ``` + + Make sure to use `aphoton` denom, not `photon`. + +5. Create the gentx + + ```bash + evmosd gentx 1000000000000aphoton --commission-rate=0.1 --commission-max-rate=1 --commission-max-change-rate=0.1 --pubkey $(evmosd tendermint show-validator) --chain-id=evmos_9000-2 + ``` + +6. Create Pull Request to this repository ([evmos/gentxs](./gentxs)) with the file `.json`. diff --git a/olympus_mons/gentxs/Evmos123m.json b/olympus_mons/gentxs/Evmos123m.json new file mode 100644 index 000000000..6768a57a7 --- /dev/null +++ b/olympus_mons/gentxs/Evmos123m.json @@ -0,0 +1 @@ +{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"Evmos123m","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"1.000000000000000000","max_change_rate":"0.100000000000000000"},"min_self_delegation":"1","delegator_address":"evmos1f9g405q0lrv7lamn3z8vmjryykhawckzh4pmx0","validator_address":"evmosvaloper1f9g405q0lrv7lamn3z8vmjryykhawckz6mwt8j","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"umfX6hULNac3lPgg7WDElOMQoO8ieuZtk/XO7vQWdTk="},"value":{"denom":"aphoton","amount":"1000000000000"}}],"memo":"f6443c53d55e8f042f94d184484046d56ab826a2@213.136.69.34:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"Au/LBfH566js4WikuXgRGkpds9MZ6sI8w1G4E4PBnblk"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["iOZFfTkl6HeCd6FxYgp24E4DvEQmtKM4/tlGlFon43xN+do3msfpmF5rIGuuLoC/J44JDekTmEMn9qA6srf3aAE="]} diff --git a/olympus_mons/gentxs/_example.json b/olympus_mons/gentxs/_example.json new file mode 100644 index 000000000..a69d47493 --- /dev/null +++ b/olympus_mons/gentxs/_example.json @@ -0,0 +1,49 @@ +{ + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "example", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "1.000000000000000000", + "max_change_rate": "0.100000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "evmos10edwlzh668y4lwtzujxn84f6ptrf63mtez7mhc", + "validator_address": "evmosvaloper10edwlzh668y4lwtzujxn84f6ptrf63mt5v3tk9", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "Ih3lu701mb58FdVNfmYeX9uT+kNtF25HlLwGSf3ZWv4=" + }, + "value": { "denom": "aphoton", "amount": "1000000000000" } + } + ], + "memo": "f37fae445ed5a3bc5ba77e95b3e23db5dcc619a8@192.168.1.10:26656", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/ethermint.crypto.v1.ethsecp256k1.PubKey", + "key": "A1cTqQlXKsqH/AvRK4OpYQyTBrWyPfvuTzrZdIpK1ROA" + }, + "mode_info": { "single": { "mode": "SIGN_MODE_DIRECT" } }, + "sequence": "0" + } + ], + "fee": { "amount": [], "gas_limit": "200000", "payer": "", "granter": "" } + }, + "signatures": [ + "KEkZILFGB6SaKL0Inb0eRxgUD9OMRwXx7R2Ckmod0I0rQ9Es6Bn/rzKfV1vPt8s5/hzJ8IFfsPuY+8yMBQ9+tQA=" + ] +} diff --git a/olympus_mons/peers.txt b/olympus_mons/peers.txt new file mode 100644 index 000000000..69510be55 --- /dev/null +++ b/olympus_mons/peers.txt @@ -0,0 +1,15 @@ +be7593d1d2cae15a574537f9107f525200824767@194.163.187.94:26656 +78605eed3018a74d9c8c3a912cd8e6d5c9a9ca4b@65.21.232.149:26726 +3bd90caf48ddd2d6b290550ecccd63348fc51da0@95.217.107.96:26658 +f8da50943569f160854ac21c9ffb46fb4ff7bc0d@144.217.252.197:26626 +1c4c38243893889a17fd3e677999f896b2b18586@95.217.35.111:26666 +0e4dec8dd2cb74277bae3a9e7f1816603e97ce60@161.97.178.48:26656 +3e7b138c766dc6da32decca8665da1afb2b6bb88@207.244.249.17:26656 +5502b008356087cb689211bb3c4285b7ce7f6571@95.217.154.12:26656 +8227d17c3cf123108c69bf671295e5fb22d9beb3@161.97.115.68:26656 +56de4d8fe7421f5a4fb6ba75b20d749be3eecf22@95.217.84.54:26656 +06e3dfce2d729250e810bd5605ad7f05f3b1fc2c@75.119.155.119:26656 +7cb1576a6ed3dbdc62bc30908ff7d7e910c5b08f@78.46.52.20:46656 +5502b008356087cb689211bb3c4285b7ce7f6571@95.217.154.12:26656 +5576b0160761fe81ccdf88e06031a01bc8643d51@195.201.108.97:24656 +13e850d14610f966de38fc2f925f6dc35c7f4bf4@176.9.60.27:26656 diff --git a/olympus_mons/seeds.txt b/olympus_mons/seeds.txt new file mode 100644 index 000000000..23650e0c3 --- /dev/null +++ b/olympus_mons/seeds.txt @@ -0,0 +1,3 @@ +c36cec90ded95d162b85f8ecd00ecd7c8849ca75@arsiamons.seed.evmos.org:26656 +3787335176bbb91bf14a67724ebe0f0940ca5afb@evmos-seed.artifact-staking.io:26656 +faa31510d9280e74e7f2e767a62023bd5c896c27@evmos-testnet.mercury-nodes.net:29447 \ No newline at end of file diff --git a/scripts/validate-gentxs.sh b/scripts/validate-gentxs.sh new file mode 100644 index 000000000..ba38b8585 --- /dev/null +++ b/scripts/validate-gentxs.sh @@ -0,0 +1,147 @@ +#!/usr/bin/env bash + +DAEMON_HOME="/tmp/simd$(date +%s)" +RANDOM_KEY="randomvalidatorkey" + +echo "#############################################" +echo "### Ensure to set the below ENV settings ###" +echo "#############################################" +echo " +DAEMON= evmosd +CHAIN_ID= evmos_9000-2 +DENOM= aphoton +GH_URL= https://github.com/tharsis/evmos +BINARY_VERSION= v0.2.0 +GO_VERSION=1.17 +PRELAUNCH_GENESIS_URL= https://raw.githubusercontent.com/tharsis/testnets/main/olympus_mons/genesis.json +GENTXS_DIR= $GOPATH/github.com/tharsis/testnets/olympus_mons/gentxs" +echo + +if [[ -z "${GH_URL}" ]]; then + echo "GH_URL in not set, required. Ex: https://github.com/tharsis/evmos" + exit 0 +fi +if [[ -z "${DAEMON}" ]]; then + echo "DAEMON is not set, required. Ex: evmosd, gaiad etc" + exit 0 +fi +if [[ -z "${DENOM}" ]]; then + echo "DENOM in not set, required. Ex: stake, aphoton etc" + exit 0 +fi +if [[ -z "${GO_VERSION}" ]]; then + echo "GO_VERSION in not set, required. Ex: 1.15.2, 1.16.6 etc." + exit 0 +fi +if [[ -z "${CHAIN_ID}" ]]; then + echo "CHAIN_ID in not set, required." + exit 0 +fi +if [[ -z "${PRELAUNCH_GENESIS_URL}" ]]; then + echo "PRELAUNCH_GENESIS_URL (genesis file url) in not set, required." + exit 0 +fi +if [[ -z "${GENTXS_DIR}" ]]; then + echo "GENTXS_DIR in not set, required." + exit 0 +fi + +command_exists () { + type "$1" &> /dev/null ; +} + +if command_exists go ; then + echo "Golang is already installed" +else + read -s -p "Installing go using apt. Do you want to proceed (y/n)?: " useApt + + if [ "$useApt" != "y" ]; then + echo + echo "Install go manually and execute this script" + exit 0; + fi + + sudo apt update + sudo apt install build-essential -y + + wget https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz + tar -xvf go$GO_VERSION.linux-amd64.tar.gz + sudo mv go /usr/local + + echo "" >> ~/.profile + echo 'export GOPATH=$HOME/go' >> ~/.profile + echo 'export GOROOT=/usr/local/go' >> ~/.profile + echo 'export GOBIN=$GOPATH/bin' >> ~/.profile + echo 'export PATH=$PATH:/usr/local/go/bin:$GOBIN' >> ~/.profile + + . ~/.profile + + go version +fi + +if [ "$(ls -A $GENTXS_DIR)" ]; then + echo "Install $DAEMON" + git clone $GH_URL $DAEMON + cd $DAEMON + git fetch && git checkout $BINARY_VERSION + make install + $DAEMON version + + for GENTX_FILE in $GENTXS_DIR/*.json; do + if [ -f "$GENTX_FILE" ]; then + set -e + + echo "GentxFile::::" + echo $GENTX_FILE + + echo "...........Init a testnet.............." + $DAEMON init --chain-id $CHAIN_ID validator --home $DAEMON_HOME + + $DAEMON keys add $RANDOM_KEY --keyring-backend test --home $DAEMON_HOME + + echo "..........Fetching genesis......." + curl -s $PRELAUNCH_GENESIS_URL > $DAEMON_HOME/config/genesis.json + + # this genesis time is different from original genesis time, just for validating gentx. + sed -i '/genesis_time/c\ \"genesis_time\" : \"2021-01-01T00:00:00Z\",' $DAEMON_HOME/config/genesis.json + + GENACC=$(cat $GENTX_FILE | sed -n 's|.*"delegator_address":"\([^"]*\)".*|\1|p') + denomquery=$(jq -r '.body.messages[0].value.denom' $GENTX_FILE) + amountquery=$(jq -r '.body.messages[0].value.amount' $GENTX_FILE) + + # only allow $DENOM tokens to be bonded + if [ $denomquery != $DENOM ]; then + echo "invalid denomination" + exit 1 + fi + + $DAEMON add-genesis-account $RANDOM_KEY 1000000000000000$DENOM --home $DAEMON_HOME \ + --keyring-backend test + + $DAEMON gentx $RANDOM_KEY 900000000000000$DENOM --home $DAEMON_HOME \ + --keyring-backend test --chain-id $CHAIN_ID + + cp $GENTX_FILE $DAEMON_HOME/config/gentx/ + + echo "..........Collecting gentxs......." + $DAEMON collect-gentxs --home $DAEMON_HOME + $DAEMON validate-genesis --home $DAEMON_HOME + + echo "..........Starting node......." + $DAEMON start --home $DAEMON_HOME & + + sleep 10s + + echo "...checking network status.." + echo "if this fails, most probably the gentx with address $GENACC is invalid" + $DAEMON status --node http://localhost:26657 + + echo "...Cleaning the stuff..." + killall $DAEMON >/dev/null 2>&1 + sleep 2s + rm -rf $DAEMON_HOME + fi + done +else + echo "$GENTXS_DIR is empty, nothing to validate" +fi \ No newline at end of file