From b3a4ba3d7e6ed7670cfb921bdbf346f58ae0b785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Hern=C3=A1ndez?= <3452489+jhernandezb@users.noreply.github.com> Date: Wed, 17 Mar 2021 16:57:36 -0600 Subject: [PATCH] add bellatrix-1 readme (#30) * add bellatrix-1 readme * handle comments * update instructions * update note * update install instructions * add seed, remove rpi, fix amounts * update chain-id * update tldr * update mac mention on releases --- README.md | 2 +- bellatrix-1/README.md | 275 +++++++++++++++++++++++++++++++++++++ bellatrix-1/gentx/.gitkeep | 0 hatching.sh | 9 +- ubuntu.md | 11 +- 5 files changed, 284 insertions(+), 13 deletions(-) create mode 100644 bellatrix-1/README.md create mode 100644 bellatrix-1/gentx/.gitkeep diff --git a/README.md b/README.md index 0f24c96e..163e6d8d 120000 --- a/README.md +++ b/README.md @@ -1 +1 @@ -albatross-1/README.md \ No newline at end of file +bellatrix-1/README.md \ No newline at end of file diff --git a/bellatrix-1/README.md b/bellatrix-1/README.md new file mode 100644 index 00000000..f99fce40 --- /dev/null +++ b/bellatrix-1/README.md @@ -0,0 +1,275 @@ +# Stargaze Bellatrix Testnet Instructions + +## TLDR + +Block explorer: [https://explorer.bellatrix-1.publicawesome.dev/](https://explorer.bellatrix-1.publicawesome.dev/) (Coming soon) + +Binaries: [v0.6.0](https://github.com/public-awesome/stargaze/releases/tag/v0.6.0) + +Genesis file: to be released + +Seeds: `c36b75183e4047fb788dcc526e751439a6fda1f0@seed.bellatrix-1.publicawesome.dev:36656` + +## Minimum hardware requirements + +- 2GB RAM +- 25GB of disk space +- 1.4 GHz CPU + +## Software requirements + +Stargaze has releases for Linux [here](https://github.com/public-awesome/stargaze/releases/tag/v0.6.0). + +- [Ubuntu Setup Guide](./ubuntu.md) +- Latest version : [v0.6.0](https://github.com/public-awesome/stargaze/releases/tag/v0.6.0) + +### Install Stargaze + +You can install Stargaze by downloading the binary (easiest), or compiling from source. + +#### Option 1: Download binary + +1. Download the binary for your platform: [releases](https://github.com/public-awesome/stargaze/releases/tag/v0.6.0). +2. Copy it to a location in your PATH, i.e: `/usr/local/bin` or `$HOME/bin`. + +i.e: + +```sh +# libwasmvm.so is needed by cgo bindings +> sudo wget https://github.com/CosmWasm/wasmvm/raw/v0.13.0/api/libwasmvm.so -O /lib/libwasmvm.so +> wget https://github.com/public-awesome/stargaze/releases/download/v0.6.0/stargaze_0.6.0_linux_amd64.tar.gz +> sudo tar -C /usr/local/bin -zxvf stargaze_0.6.0_linux_amd64.tar.gz +``` + +#### Option 2: Build from source + +Requires [Go version v1.15+](https://golang.org/doc/install). + +```sh +> mkdir -p $GOPATH/src/github.com/public-awesome +> cd $GOPATH/src/github.com/public-awesome +> git clone https://github.com/public-awesome/stargaze && cd stargaze +> git fetch origin --tags +> git checkout v0.6.0 +> FAUCET_ENABLED=true make install +``` + +#### Verify installation + +To verify if the installation was successful, execute the following command: + +```sh +> starsd version --long +``` + +It will display the version of starsd currently installed: + +```sh +name: stargaze +server_name: starsd +version: 0.6.0 +commit: 3f7bed1cd9384eeca878277e4dcb92d1aa3aea1b +build_tags: netgo,faucet +go: go version go1.15.8 linux/amd64 +``` + +NOTE: Make sure `build_tags` includes "faucet", which is required for testnet. + +## Setup validator node + +If you are looking to join the testnet post genesis time (_MAR 23 2021 1600 UTC_), skip to [Create Testnet Validator](#create-testnet-validator) + +Below are the instructions to generate & submit your genesis transaction + +### Generate genesis transaction (gentx) + +1. Initialize the Stargaze directories and create the local genesis file with the correct + chain-id + + ```sh + > starsd init --chain-id=bellatrix-1 + ``` + +2. Create a local key pair + + ```sh + > starsd keys add + ``` + +3. Add your account to your local genesis file with a given amount and the key you + just created. Use only `100000000ustarx`, other amounts will be ignored. STARX is testnet STAR. + + ```sh + > starsd add-genesis-account $(starsd keys show -a) 100000000ustarx + ``` + +4. Create the gentx + + ```sh + > starsd gentx --amount=90000000ustarx --chain-id=bellatrix-1 + ``` + + If all goes well, you will see a message similar to the following: + + ```sh + Genesis transaction written to "/home/user/.starsd/config/gentx/gentx-******.json" + ``` + +### Submit genesis transaction + +> NOTE: To prevent malicious validators, and to ensure a fair and decentralized launch, the following rules will be enforced: +> +> 1. Github accounts must be at least a year old and have history; accounts with little activity may not be accepted. +> 2. Only one gentx per Github account is allowed +> 3. We reserve the right to exercise our best judgement to protect the network against Sybil attacks. Preference will be given to validators with a proven track record of validating for other networks. + +Submit your gentx in a PR [here](https://github.com/public-awesome/stargaze-testnets) + +- Fork [the testnets repo](https://github.com/public-awesome/stargaze-testnets) into your Github account + +- Clone your repo using + + ```sh + > git clone https://github.com//stargaze-testnets + ``` + +- Copy the generated gentx json file to `/bellatrix-1/gentx/` + + ```sh + > cd stargaze-testnets + > cp ~/.starsd/config/gentx/gentx*.json ./bellatrix-1/gentx/ + ``` + +- Commit and push to your repo +- Create a PR onto https://github.com/public-awesome/stargaze-testnets + +### Start your validator node + +Once after the genesis is released (_MAR 22 2021 1600 UTC_), follow the instructions below to start your validator node. + +#### Genesis & seeds + +Fetch `genesis.json` into `starsd`'s `config` directory. + +```sh +> curl https://raw.githubusercontent.com/public-awesome/stargaze-testnets/master/bellatrix-1/genesis.json > $HOME/.starsd/config/genesis.json +``` + +Verify you have the correct genesis file: + +```sh +> shasum -a 256 ~/.starsd/config/genesis.json +fb13172f39d0e888601b828aea104e830aa64c3893ff478194e4d41b2e61f793 genesis.json +``` + +Add seed nodes in `config.toml`. + +```sh +> vi $HOME/.starsd/config/config.toml +``` + +Find the following section and add the seed nodes. + +```sh +# Comma separated list of seed nodes to connect to +seeds = "c36b75183e4047fb788dcc526e751439a6fda1f0@seed.bellatrix-1.publicawesome.dev:36656" +``` + +```sh +# Comma separated list of persistent peers to connect to +persistent_peers = "" +``` + +#### Set validator gas fees + +You can set the minimum gas prices for transactions to be accepted into your node's mempool. This sets a lower bound on gas prices, preventing spam. Stargaze can accept gas in _any_ currency. To accept both ATOM and STARX for example, set `minimum-gas-prices` in `app.toml`. + +```sh +> vi $HOME/.starsd/config/app.toml +``` + +```sh +minimum-gas-prices = "0.025ustarx" +``` + +#### Start node automatically (Linux only) + +Create a `systemd` service + +```sh +> sudo vi /etc/systemd/system/starsd.service +``` + +Copy and paste the following and update `` and ``: + +```sh +[Unit] +Description=starsd +After=network-online.target + +[Service] +User= +ExecStart=/home///bin/starsd start +Restart=always +RestartSec=3 +LimitNOFILE=4096 + +[Install] +WantedBy=multi-user.target +``` + +**This assumes `$HOME/go_workspace` to be your Go workspace. Your actual workspace directory may vary.** + +```sh +> sudo systemctl enable starsd +> sudo systemctl start starsd +``` + +Check node status + +```sh +> starsd status +``` + +Check logs + +```sh +> journalctl -u starsd -f +``` + +## Create testnet validator + +This section applies to those who are looking to join the testnet post genesis. + +1. Init Chain and start your node + + ```sh + > starsd init --chain-id=bellatrix-1 --stake-denom=ustarx + ``` + + After that, please follow all the instructions from [Start your validator node](#start-your-validator-node) + +2. Create a local key pair + + ```sh + > starsd keys add + > starsd keys show -a + ``` + +3. Create validator + + ```sh + $ starsd tx staking create-validator \ + --amount 9000000000ustarx \ + --commission-max-change-rate "0.1" \ + --commission-max-rate "0.20" \ + --commission-rate "0.1" \ + --min-self-delegation "1" \ + --details "validators write bios too" \ + --pubkey=$(starsd tendermint show-validator) \ + --moniker \ + --chain-id bellatrix-1 \ + --from + ``` + +4. Request tokens from the [Stargaze Discord #validator channel](https://discord.gg/QeJWCrE) if you need more. diff --git a/bellatrix-1/gentx/.gitkeep b/bellatrix-1/gentx/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/hatching.sh b/hatching.sh index 4c630cc2..3825cf02 100755 --- a/hatching.sh +++ b/hatching.sh @@ -1,15 +1,16 @@ #!/bin/bash -NETWORK=albatross-1 -CONFIG=~/.staked/config +NETWORK=bellatrix-1 +CONFIG=~/.starsd/config +INITIAL_COINS=100000000ustarx rm -rf $CONFIG/gentx && mkdir $CONFIG/gentx for i in $NETWORK/gentx/*.json; do echo $i - staked add-genesis-account $(jq -r '.body.messages[0].delegator_address' $i) $(jq -r '.body.messages[0].value.amount' $i)$(jq -r '.body.messages[0].value.denom' $i) + starsd add-genesis-account $(jq -r '.body.messages[0].delegator_address' $i) $INITIAL_COINS cp $i $CONFIG/gentx/ done -staked collect-gentxs +starsd collect-gentxs cp $CONFIG/genesis.json $NETWORK diff --git a/ubuntu.md b/ubuntu.md index dbc9f3c2..322d8f7f 100644 --- a/ubuntu.md +++ b/ubuntu.md @@ -10,21 +10,16 @@ > sudo apt-get install build-essential # install gcc -> sudo apt-get install gcc +> sudo apt-get install cmake gcc ``` ## Install Go ### x86 -```bash -> wget https://golang.org/dl/go1.15.3.linux-amd64.tar.gz -> tar -C /usr/local -xzf go1.15.3.linux-amd64.tar.gz -``` -### ARMv8 (Raspberry Pi 3+) ```bash -> wget https://golang.org/dl/go1.15.3.linux-arm64.tar.gz -> tar -C /usr/local -xzf go1.15.3.linux-arm64.tar.gz +> wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz +> tar -C /usr/local -xzf go1.15.8.linux-amd64.tar.gz ``` Setup paths in .profile