From e21660136635c458b775e226c99386cb2bbfe074 Mon Sep 17 00:00:00 2001 From: albttx Date: Fri, 27 Sep 2024 16:27:59 +0200 Subject: [PATCH 1/2] chore: AtomOne gentx informations --- atomone-1/README.md | 91 ++++++++++++++++++++++++++++++++++ atomone-1/gentx/.keep | 0 atomone-1/persistent_peers.txt | 0 atomone-1/seeds.txt | 0 4 files changed, 91 insertions(+) create mode 100644 atomone-1/README.md create mode 100644 atomone-1/gentx/.keep create mode 100644 atomone-1/persistent_peers.txt create mode 100644 atomone-1/seeds.txt diff --git a/atomone-1/README.md b/atomone-1/README.md new file mode 100644 index 0000000..9ee7aad --- /dev/null +++ b/atomone-1/README.md @@ -0,0 +1,91 @@ +# 🔗 `atomone-1` + +![chain-id](https://img.shields.io/badge/chain%20id-atomone--1-blue?style=for-the-badge) +![version: v1.0.0](https://img.shields.io/badge/version-v1.0.0-green?style=for-the-badge) + + + +## Register in the Genesis + +To register your validator node in the `genesis.json` you just need to provide a signed `gentx` with an initial delegation of `1000000uatone`. + +```sh +# Init node +atomeoned init your-moniker --chain-id atomone-1 + +# Create keys, be careful with the mnemonic 👀 +atomeoned keys add your-key-name + +# Set account necessary balance +atomeoned add-genesis-account your-key-name 10000000uatone +``` +*NOTE*: if you are submitting a gentx for a new account, (meaning you had to run the command above because the account did not have balance) be aware that you will be granted some funds (including the 1000000uatone required as min self-delegation), enough to pay for fees. The amount above is indicative of the actual amount of funds you will be granted, but the final amount might change. + +Then create your own genesis transaction (`gentx`). You will have to choose the following parameters for your validator: `commission-rate`, `commission-max-rate`, `commission-max-change-rate` all set to 0, `min-self-delegation` (>=1), `website` (optional), `details` (optional), `identity` ([keybase](https://keybase.io) key hash, used to get validator logos in block explorers - optional), `security-contact` (email - optional). + +The `commission-rate`, `commission-max-rate`, `commission-max-change-rate` are recommended to be set to 0 since rewards and inflations are both set to 0. + +```sh +# Create the gentx +atomeoned gentx your-key-name 1000000uatone \ + --node-id $(atomeoned tendermint show-node-id) \ + --chain-id atomone-1 \ + --commission-rate 0.0 \ + --commission-max-rate 0.0 \ + --commission-max-change-rate 0.0 \ + --min-self-delegation 1 \ + --website "https://foo.network" \ + --details "My validator" \ + --identity "id-from-keybase" \ + --security-contact "security@foo.network" +``` + +## Operate the node + +### Install the binary + +- You can install the binary from github release page + +https://github.com/atomone-hub/atomone/releases/tag/v1.0.0 + +- Build from the source + +You need to have [go](https://go.dev/doc/install) installed + +```sh +$ git clone https://github.com/atomone-hub/atomone.git +$ cd atomone +$ make install +``` + +### Genesis file [download link](https://atomone.fra1.digitaloceanspaces.com/atomone/atomone-1/genesis.json) + +The final genesis is avalable at [this link](https://atomone.fra1.digitaloceanspaces.com/atomone/atomone-1/genesis.json). + +```sh +$ wget -O ~/.atomone/config/genesis.json https://atomone.fra1.digitaloceanspaces.com/atomone/atomone-1/genesis.json + +$ md5sum ~/.atomone/config/genesis.json +[TBD] +``` + +### Recommendations + +| minimum-gas-prices | 0.001uatone | +|--------------------|------------------------------------------------------| +| seeds | see [./seeds.txt](./seeds.txt) | +| persistent_peers | see [./persistent_peers.txt](./persistent_peers.txt) | + + +## Hardware recommendation + +AtomOne is a relatively simple and vanilla Cosmos SDK chain with minor modifications. The recommended minimum hardware requirements should be enough to comfortably be able to run a validator node. + +- 4 Cores +- 8 GB RAM +- 512 GB disk space (could increase over time, will need to monitor disk usage) + + +## Network informations + +You can get a list of public Explorers, RPCs, seed node, persistent_peers... on [cosmos.directory/atomone](https://cosmos.directory/atomone) diff --git a/atomone-1/gentx/.keep b/atomone-1/gentx/.keep new file mode 100644 index 0000000..e69de29 diff --git a/atomone-1/persistent_peers.txt b/atomone-1/persistent_peers.txt new file mode 100644 index 0000000..e69de29 diff --git a/atomone-1/seeds.txt b/atomone-1/seeds.txt new file mode 100644 index 0000000..e69de29 From a801c1fb301816cc91731e47a413f87dde63a085 Mon Sep 17 00:00:00 2001 From: albttx Date: Fri, 27 Sep 2024 16:39:18 +0200 Subject: [PATCH 2/2] chore(ci): add gentx checker --- .github/workflows/genxtx-atomone.yml | 82 ++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/genxtx-atomone.yml diff --git a/.github/workflows/genxtx-atomone.yml b/.github/workflows/genxtx-atomone.yml new file mode 100644 index 0000000..bb81d4f --- /dev/null +++ b/.github/workflows/genxtx-atomone.yml @@ -0,0 +1,82 @@ +name: Gentx checker + +on: + pull_request: {} + +env: + ATOMONED_VERSION: "v1.0.0" + GENESIS_URL: "https://atomone.fra1.digitaloceanspaces.com/atomone/atomone-1/genesis.json" + MUST_STAKED_AMOUNT: "1000000" + +jobs: + check-gentx: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get changed files + id: files + uses: jitterbit/get-changed-files@v1 + with: + format: json + + - name: Check gentx values + run: | + for f in ${{ steps.files.outputs.all }}; do + if [[ "$f" == "*gentx/*.json" ]]; then + echo "checking file: $f" + COMMISSION_RATE=$(cat $f | jq -r '.body.messages[0].commission.rate') + COMMISSION_MAX_RATE=$(cat $f | jq -r '.body.messages[0].commission.max_rate') + COMMISSION_MAX_CHANGE_RATE=$(cat $f | jq -r '.body.messages[0].commission.max_change_rate') + STAKED_AMOUNT=$(cat $f | jq -r '.body.messages[0].value.amount') + # bc return 1 when success + + if [ "${COMMISSION_RATE}" != "0" ]; then + echo error="Invalid commission rate." >> ${GITHUB_OUTPUT} + exit 1 + fi + + if [ "${COMMISSION_MAX_RATE}" != "0" ]; then + echo error="Invalid commission max rate." >> ${GITHUB_OUTPUT} + exit 1 + fi + + if [ "${COMMISSION_MAX_CHANGE_RATE}" != "0" ]; then + echo error="Invalid commission max change rate." >> ${GITHUB_OUTPUT} + exit 1 + fi + + if [ "${STALED_AMOUNT}" != "${MUST_STAKED_AMOUNT}" ]; then + echo error="Invalid staked amount." >> ${GITHUB_OUTPUT} + exit 1 + fi + fi + done + + validate-gentx: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download atomoned + run: | + wget -O /usr/local/bin/atomoned https://github.com/atomone-hub/atomone/releases/download/${ATOMONED_VERSION}/atomoned-${ATOMONED_VERSION}-linux-amd64 + chmod +x /usr/local/bin/atomoned + + - name: Collect gentxs + run: | + atomoned init github-ci --chain-id atomone-1 + + # wget -O $HOME/.atomone/config/genesis.json $GENESIS_URL + + for f in "atomone-1/gentx/*.json"; do + ADDR=$(cat $f | jq -r '.body.messages[0].delegator_address') + atomoned add-genesis-account $ADDR 10000000uatone + done + atomoned collect-gentxs --gentx-dir ./atomone-1/gentx + + - name: Validate genesis + run: | + atomoned validate-genesis