Skip to content

Commit

Permalink
Merge pull request #643 from okp4/feat/drunemeton-1
Browse files Browse the repository at this point in the history
Feat/drunemeton 1
  • Loading branch information
amimart authored Jan 19, 2024
2 parents 2c2ff04 + 3703976 commit 9b0afa2
Show file tree
Hide file tree
Showing 12 changed files with 551 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/register-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body:
description: Choose the OKP4 network you want to join
multiple: false
options:
- nemeton-1
- drunemeton-1
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ jobs:
- name: Check genesis files
run: |
echo "🔎 Checking 'okp4-${{ matrix.context.network }}' genesis"
docker run --rm -v ${GITHUB_WORKSPACE}/${{ matrix.context.path }}/${{ matrix.context.name }}:/genesis.json okp4/okp4d:`cat ./chains/${{ matrix.context.network }}/version.txt` validate-genesis /genesis.json
docker run --rm -v ${GITHUB_WORKSPACE}/${{ matrix.context.path }}/${{ matrix.context.name }}:/genesis.json okp4/okp4d:`cat ./chains/${{ matrix.context.network }}/version.txt` genesis validate /genesis.json
4 changes: 2 additions & 2 deletions .github/workflows/register-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ jobs:
delegator_addr=$(echo "$GENTX" | jq -r '.body.messages[0].delegator_address')
delegator_balance="`expr ${{ fromJson(needs.resolve-context.outputs.register-config).delegation.amount }} + 200000`${{ fromJson(needs.resolve-context.outputs.register-config).delegation.denom }}"
docker run --rm -v $NODE_HOME:$NODE_HOME okp4/okp4d:`cat ./chains/${{ needs.resolve-context.outputs.network }}/version.txt` add-genesis-account --home $NODE_HOME $delegator_addr $delegator_balance
docker run --rm -v $NODE_HOME:$NODE_HOME okp4/okp4d:`cat ./chains/${{ needs.resolve-context.outputs.network }}/version.txt` genesis add-genesis-account --home $NODE_HOME $delegator_addr $delegator_balance
docker run --rm -v $NODE_HOME:$NODE_HOME -v $PWD/chains/${{ needs.resolve-context.outputs.network }}/gentx:/gentx okp4/okp4d:`cat ./chains/${{ needs.resolve-context.outputs.network }}/version.txt` collect-gentxs --home $NODE_HOME --gentx-dir /gentx
docker run --rm -v $NODE_HOME:$NODE_HOME -v $PWD/chains/${{ needs.resolve-context.outputs.network }}/gentx:/gentx okp4/okp4d:`cat ./chains/${{ needs.resolve-context.outputs.network }}/version.txt` genesis collect-gentxs --home $NODE_HOME --gentx-dir /gentx
cp $NODE_HOME/config/genesis.json chains/${{ needs.resolve-context.outputs.network }}/genesis.json
- name: Prepare commit message
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ jobs:
sudo cp ${GITHUB_WORKSPACE}/${{ matrix.context.path }}/gentx/* ${GITHUB_WORKSPACE}/${{ matrix.context.path }}/config/gentx
docker run --rm -v ${GITHUB_WORKSPACE}/${{ matrix.context.path }}:/.okp4d okp4/okp4d:`cat ./chains/${{ matrix.context.network }}/version.txt` \
add-genesis-account validator 1000000000uknow \
genesis add-genesis-account validator 1000000000uknow \
--home /.okp4d \
--keyring-backend test
docker run --rm -v ${GITHUB_WORKSPACE}/${{ matrix.context.path }}:/.okp4d okp4/okp4d:`cat ./chains/${{ matrix.context.network }}/version.txt` \
gentx validator 1000000uknow \
genesis gentx validator 1000000uknow \
--home /.okp4d \
--chain-id=okp4-${{ matrix.context.network }} \
--keyring-backend test
docker run --rm -v ${GITHUB_WORKSPACE}/${{ matrix.context.path }}:/.okp4d okp4/okp4d:`cat ./chains/${{ matrix.context.network }}/version.txt` \
collect-gentxs \
genesis collect-gentxs \
--home /.okp4d
- name: Start the blockchain
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ For a complete description about nodes and validators, check out the [OKP4 Docum

## 🔗 Networks

### [`nemeton-1`](./chains/nemeton-1/README.md)
### [`drunemeton-1`](./chains/drunemeton-1/README.md)

[![stability-wip](https://img.shields.io/badge/stability-wip-lightgrey.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#work-in-progress) ![audience](https://img.shields.io/badge/audience-public-white.svg)

![stability-stable](https://img.shields.io/badge/stability-stable-green.svg) ![audience](https://img.shields.io/badge/audience-public-white.svg)
`Drunemeton` is the main OKP4 testnet. Please find more details to join the network [here](chains/drunemeton-1/).

`Nemeton` is the main OKP4 testnet. Please find more details to join the network [here](chains/nemeton-1/).
### [`nemeton-1`](./chains/nemeton-1/README.md)

![stability-discontinued](https://img.shields.io/badge/stability-discontinued%20🔚-lightgray.svg) ![audience](https://img.shields.io/badge/audience-public-white.svg)

### [`nemeton`](./chains/nemeton/README.md)

Expand Down
41 changes: 41 additions & 0 deletions chains/drunemeton-1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- generated file - do not edit -->
# 🔗 `okp4-drunemeton-1`

![chain-id](https://img.shields.io/badge/chain%20id-okp4--drunemeton--1-blue?style=for-the-badge)
[![stability-wip](https://img.shields.io/badge/stability-wip-lightgrey.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#work-in-progress)
![audience](https://img.shields.io/badge/audience-public-white.svg?style=for-the-badge)
![genesis-time](https://img.shields.io/badge/%E2%8F%B0%20genesis%20time-2024--02--06T15%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 `10000000000uknow` in a [⚖️ Register Validator issue](https://github.com/okp4/networks/issues).

The gentx generation can be done as follow (this is an example script, adapt it to your needs) with the [okp4d](https://github.com/okp4/okp4d/releases) binary matching the [network's version](/chains/drunemeton-1/version.txt):

```sh
# Init node
okp4d --home mynode init your-moniker --chain-id okp4-drunemeton-1

# Create keys, be careful with the mnemonic 👀
okp4d --home mynode keys add your-key-name

# Set account necessary balance
okp4d --home mynode genesis add-genesis-account your-key-name 10000200000uknow
```

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`, `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).

```sh
# Create the gentx
okp4d --home mynode genesis gentx your-key-name 10000000000uknow \
--node-id $(okp4d --home mynode tendermint show-node-id) \
--chain-id okp4-drunemeton-1 \
--commission-rate 0.05 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--website "https://foo.network" \
--details "My validator" \
--identity "6C36E7C076BFDCE4" \
--security-contact "[email protected]"
```
70 changes: 70 additions & 0 deletions chains/drunemeton-1/README.md.gtpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!-- generated file - do not edit -->
# 🔗 `{{ (datasource "genesis").chain_id }}`

![chain-id](https://img.shields.io/badge/chain%20id-{{ (datasource "genesis").chain_id | urlquery | strings.ReplaceAll "-" "--" }}-blue?style=for-the-badge)
[![stability-wip](https://img.shields.io/badge/stability-wip-lightgrey.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#work-in-progress)
![audience](https://img.shields.io/badge/audience-public-white.svg?style=for-the-badge)
![genesis-time](https://img.shields.io/badge/{{ "⏰" | urlquery }}%20genesis%20time-{{ (datasource "genesis").genesis_time | urlquery | strings.ReplaceAll "-" "--" }}-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 `10000000000uknow` in a [⚖️ Register Validator issue](https://github.com/okp4/networks/issues).

The gentx generation can be done as follow (this is an example script, adapt it to your needs) with the [okp4d](https://github.com/okp4/okp4d/releases) binary matching the [network's version](/chains/drunemeton-1/version.txt):

```sh
# Init node
okp4d --home mynode init your-moniker --chain-id {{ (datasource "genesis").chain_id }}

# Create keys, be careful with the mnemonic 👀
okp4d --home mynode keys add your-key-name

# Set account necessary balance
okp4d --home mynode genesis add-genesis-account your-key-name 10000200000uknow
```

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`, `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).

```sh
# Create the gentx
okp4d --home mynode genesis gentx your-key-name 10000000000uknow \
--node-id $(okp4d --home mynode tendermint show-node-id) \
--chain-id okp4-drunemeton-1 \
--commission-rate 0.05 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--website "https://foo.network" \
--details "My validator" \
--identity "6C36E7C076BFDCE4" \
--security-contact "[email protected]"
```

## Genesis validators

<table>
<tr>
<th>Moniker</th>
<th>Details</th>
<th>Identity</th>
<th>Site</th>
</tr>
{{- $txs := (datasource "genesis") | jsonpath "$..messages[?(@.min_self_delegation)]" -}}
{{- range $key, $value := $txs }}
{{- $url := "" -}}
{{- if $value.description.website | strings.HasPrefix "http" -}}
{{- $url = $value.description.website -}}
{{- else if $value.description.website -}}
{{- $url = printf "%s%s" "https://" $value.description.website -}}
{{- end -}}
{{- $userInfo := $value.description.identity | index (datasource "usersInfo") }}
<tr>
<td><pre>{{ $value.description.moniker | html }}</pre></td>
<td>{{ $value.description.details | html }}</td>
<td>{{ if (and $value.description.identity $userInfo) }}
<p align="center"><img width="80px" src="{{ $userInfo.keybase.picture_url }}"/></p>
<a href="https://keybase.io/{{ $userInfo.keybase.username }}">{{ $value.description.identity }}</a>{{ end }}</td>
<td>{{ if $url }}<a href="{{ $url }}">{{ $url }}</a>{{ end -}}
</tr>
{{- end }}
</table>
Loading

0 comments on commit 9b0afa2

Please sign in to comment.