Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atomone(ci): gentx veritfy conformity #102

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/genxtx-atomone.yml
Original file line number Diff line number Diff line change
@@ -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
91 changes: 91 additions & 0 deletions atomone-1/README.md
Original file line number Diff line number Diff line change
@@ -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)
<!-- ![genesis-time](https://img.shields.io/badge/%E2%8F%B0%20genesis%20time-2024--02--27T13%3A00%3A00Z-red?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 "[email protected]"
```

## 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)
Empty file added atomone-1/gentx/.keep
Empty file.
Empty file added atomone-1/persistent_peers.txt
Empty file.
Empty file added atomone-1/seeds.txt
Empty file.
Loading