Skip to content

Commit

Permalink
Merge pull request #77 from Fairblock/chore/update-denom-add-testnet-…
Browse files Browse the repository at this point in the history
…docs

Update denom & Add fairytest-3
  • Loading branch information
p0p3yee authored Dec 29, 2023
2 parents ad36416 + f9013c6 commit 838bc88
Show file tree
Hide file tree
Showing 23 changed files with 936 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:

- name: Prepare Release Variables
id: vars
uses: ignite/cli/actions/release/vars@v0.25.2
uses: ignite/cli/actions/release/vars@v0.27.2

- name: Issue Release Assets
uses: ignite/cli/actions/cli@v0.25.2
uses: ignite/cli/actions/cli@v0.27.2
if: ${{ steps.vars.outputs.should_release == 'true' }}
with:
args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64
Expand Down
6 changes: 3 additions & 3 deletions fairyring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ build:
accounts:
- name: alice
coins:
- 100000000frt
- 100000000ufairy
- 100000000stake
- name: bob
coins:
- 100000000frt
- 100000000ufairy
- 100000000stake
faucet:
name: bob
coins:
- 100000frt
- 100000ufairy
- 100000stake
host: 0.0.0.0:4500
genesis:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module fairyring

go 1.19
go 1.21

require (
cosmossdk.io/api v0.3.1
Expand Down
29 changes: 29 additions & 0 deletions go.sum

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions hermes_config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[global]
log_level = 'info'

[mode.clients]
enabled = true
refresh = true
Expand All @@ -16,6 +17,7 @@ enabled = true
clear_interval = 100
clear_on_start = true
tx_confirmation = false
auto_register_counterparty_payee = false

[rest]
enabled = false
Expand Down Expand Up @@ -44,6 +46,7 @@ max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '14days'
memo_prefix = ''
sequential_batch_tx = false

Expand All @@ -53,7 +56,7 @@ denominator = '3'

[chains.gas_price]
price = 1
denom = 'frt'
denom = 'ufairy'

[chains.address_type]
derivation = 'cosmos'
Expand All @@ -76,6 +79,7 @@ max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '14days'
memo_prefix = ''
sequential_batch_tx = false

Expand All @@ -85,7 +89,7 @@ denominator = '3'

[chains.gas_price]
price = 1
denom = 'frt'
denom = 'ufairy'

[chains.address_type]
derivation = 'cosmos'
245 changes: 245 additions & 0 deletions networks/testnets/fairytest-3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
# fairytest-3

> This chain is a testnet.
3rd testnet for FairyRing.

## Hardware Requirements

- **Minimal**
- 4 GB RAM
- 250 GB HDD
- 1.4 GHz x2 CPU
- **Recommended**
- 8 GB RAM
- 500 GB HDD
- 2.0 GHz x4 CPU

---

## Operating System

- Linux/Windows/MacOS(x86)
- **Recommended**
- Linux(x86_64)
- Ubuntu 20.04 LTS

---

## Network

- Sentry node architecture and secure firewall configurations are highly recommended [ref](https://forum.cosmos.network/t/sentry-node-architecture-overview/454)
- Port & Firewall settings (Ports Allowed)
- rpc port: 26657
- p2p port: 26656
- grpc port: 9090

---

## Installation Steps

> Prerequisite: go1.21+ required [ref](https://golang.org/doc/install)
```shell
sudo snap install --classic go
```

> Prerequisite: git [ref](https://github.com/git/git)
```shell
sudo apt install -y git gcc make
```

> Prerequisite: Set environment variables
```shell
sudo nano $HOME/.profile
# Add the following two lines at the end of the file
GOPATH=$HOME/go
PATH=$GOPATH/bin:$PATH
# Save the file and exit the editor
source $HOME/.profile
# Now you should be able to see your variables like this:
echo $GOPATH
/home/[your_username]/go
echo $PATH
/home/[your_username]/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
```

> Recommended requirement: Increase 'number of open files' limit
```shell
sudo nano /etc/security/limits.conf
# Before the end of the file, add:
[your_username] soft nofile 4096
# Then reboot the instance for it to take effect and check with:
ulimit -Sn
```

> Optional requirement: GNU make [ref](https://www.gnu.org/software/make/manual/html_node/index.html)
- Clone git repository

```shell
git clone [email protected]:FairBlock/fairyring.git
```

- Checkout release tag

```shell
cd fairyring
git fetch --tags
git checkout v0.3.0
```

- Install

```shell
cd fairyring
go mod tidy
make install
```

### Generate keys

`fairyringd keys add [key_name]`

or

`fairyringd keys add [key_name] --recover` to regenerate keys with your [BIP39](https://github.com/bitcoin/bips/tree/master/bip-0039) mnemonic

---

## Node start and validator setup

### Upgrading from v0.2.1 to v0.3.0

### Prior to genesis creation and network launch

- [Install](#installation-steps) FairyRing application
- Remove data from previous run of `fairyringd`

```shell
fairyringd tendermint unsafe-reset-all
```

- Make a genesis transaction to become a validator

```shell
fairyringd gentx \
[account_key_name] \
100000000000stake \
--commission-max-change-rate 0.01 \
--commission-max-rate 0.2 \
--commission-rate 0.05 \
--min-self-delegation 1 \
--details [optional-details] \
--identity [optional-identity] \
--security-contact "[[email protected]]" \
--website [optional.web.page.com] \
--moniker [node_moniker] \
--chain-id fairytest-3
```

- Copy the contents of `${HOME}/.fairyring/config/gentx/gentx-XXXXXXXX.json`
- Clone the [fairyring repository](https://github.com/FairBlock/fairyring) and create a new branch
- Create a file `gentx-{{VALIDATOR_NAME}}.json` under the `networks/testnets/fairytest-3/gentxs` folder in the newly created branch, paste the copied text into the file (note: find reference file `gentx-examplexxxxxxxx.json` in the same folder)
- Run `fairyringd tendermint show-node-id` and copy your nodeID
- Run `ifconfig` or `curl ipinfo.io/ip` and copy your publicly reachable IP address
- Create a file `peers-{{VALIDATOR_NAME}}.json` under the `networks/testnets/fairytest-3/peers` folder in the new branch, paste the copied text from the last two steps into the file (note: find reference file `peers-examplexxxxxxxx.json` in the same folder)
- Create a Pull Request to the `main` branch of the [fairyring repository](https://github.com/FairBlock/fairyring)
> **NOTE:** the Pull Request will be merged by the maintainers to confirm the inclusion of the validator at the genesis. The final genesis file will be published under the file `networks/testnets/fairytest-3/genesis.json`.
- Once the submission process has closed and the genesis file has been created, replace the contents of your `${HOME}/.fairyring/config/genesis.json` with that of `networks/testnets/fairytest-3/genesis.json`
- Add the required `persistent_peers` or `seeds` in `${HOME}/.fairyring/config/config.toml` from `networks/testnets/fairytest-3/peers-nodes.txt`
- Update the `~/.fairyring/config/config.toml` file and make sure that the peer-port (26656) is publicly reachable. If you are running sentry nodes, make sure that the peer-port of your sentry is publicly reachable
- Start node

```shell
fairyringd start
```

---

## After genesis creation and network launch

### Step 1: Start a full node

- [Install](#installation-steps) FairyRing application
- Initialize node

```shell
fairyringd init {{NODE_NAME}}
```

- Replace the contents of your `${HOME}/.fairyring/config/genesis.json` with that of `networks/testnets/fairytest-3/genesis.json` from the `main` branch of [FairyRing repository](https://github.com/FairBlock/fairyring)

```shell
curl https://github.com/FairBlock/blob/main/fairyring/networks/testnets/fairytest-3/genesis.json > $HOME/.fairyring/config/genesis.json
```

- Add `persistent_peers` or `seeds` in `${HOME}/.fairyring/config/config.toml` from `networks/testnets/fairytest-3/peers-nodes.txt` from the `main` branch of [FairyRing repository](https://github.com/FairBlock/fairyring)
- Start node

```shell
fairyringd start
```

> Note: if you are only planning to run a full node, you can stop here
### Step 2: Create a validator

- Acquire FAIRY tokens (contact maintainers on telegram)
- Wait for your full node to catch up to the latest block
- Run `fairyringd tendermint show-validator` and copy your consensus public key
- Send a create-validator transaction

```shell
fairyringd tx staking create-validator \
--amount 100000000000stake \
--commission-max-change-rate 0.01 \
--commission-max-rate 0.2 \
--commission-rate 0.1 \
--from [account_key_name] \
--fees 400000stake \
--min-self-delegation 1 \
--moniker [validator_moniker] \
--pubkey $(fairyringd tendermint show-validator) \
--chain-id fairytest-3 \
-y
```

---

## Persistent Peers

The `persistent_peers` needs a comma-separated list of trusted peers on the network, you can acquire it from the [peer-nodes.txt](https://github.com/FairBlock/blob/main/networks/testnets/fairytest-3/peer-nodes.txt) for example:

```shell
[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:24756,[email protected]:26656,[email protected]:26656
```

## Version

This chain is currently running on fairyring [v0.3.0](https://github.com/FairBlock/fairyring/releases/tag/v0.3.0)
Commit Hash: [8e6f6deea6a04b260d190fcd5787bcc4ff85f149](https://github.com/FairBlock/fairyring/commit/8e6f6deea6a04b260d190fcd5787bcc4ff85f149)

## Binary

The binary can be downloaded from [here](https://github.com/FairBlock/fairyring/releases/tag/v0.3.0)

## Explorer

Coming Soon!!

<!-- >The Block Explorer for this chain is available [here]() -->

## Faucet

Coming Soon!!
<!-- > Discord Faucet is available [here]() -->

### RPC & API

Coming Soon!!
<!-- >- RPC is available [here]() -->
<!-- >- API is available [here]() -->
Loading

0 comments on commit 838bc88

Please sign in to comment.