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

[DNM] Test network launch #15

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ linters-settings:
- prefix(cosmossdk.io)
- prefix(github.com/cosmos/cosmos-sdk)
- prefix(github.com/strangelove-ventures/poa)
- prefix(github.com/reecepbcups/tokenfactory)
- prefix(github.com/strangelove-ventures/tokenfactory)
- prefix(github.com/liftedinit/manifest-ledger)
gosec:
excludes:
Expand Down
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ import (
poakeeper "github.com/strangelove-ventures/poa/keeper"
poamodule "github.com/strangelove-ventures/poa/module"

"github.com/reecepbcups/tokenfactory/x/tokenfactory"
tokenfactorykeeper "github.com/reecepbcups/tokenfactory/x/tokenfactory/keeper"
tokenfactorytypes "github.com/reecepbcups/tokenfactory/x/tokenfactory/types"
"github.com/strangelove-ventures/tokenfactory/x/tokenfactory"
tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper"
tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types"

manifest "github.com/liftedinit/manifest-ledger/x/manifest"
manifestkeeper "github.com/liftedinit/manifest-ledger/x/manifest/keeper"
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ replace (
// https://github.com/liftedinit/cosmos-sdk/pull/1
github.com/cosmos/cosmos-sdk => github.com/liftedinit/cosmos-sdk v0.50.5-0.20240222003859-24d6e6cf46be

// TODO: testnet only
github.com/cosmos/ibc-go/v8 => github.com/cosmos/ibc-go/v8 v8.0.0

// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0
github.com/spf13/viper => github.com/spf13/viper v1.17.0 // v1.18+ breaks app overrides
Expand Down Expand Up @@ -42,16 +45,16 @@ require (
github.com/cosmos/cosmos-sdk v0.50.4
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/cosmos/ibc-go/v8 v8.0.0
github.com/cosmos/ibc-go/v8 v8.1.0
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/reecepbcups/tokenfactory v0.50.0-alpha.3
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/strangelove-ventures/poa v0.0.1-alpha.3
github.com/strangelove-ventures/tokenfactory v0.50.0
github.com/stretchr/testify v1.8.4
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f
google.golang.org/grpc v1.60.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1618,8 +1618,6 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/reecepbcups/tokenfactory v0.50.0-alpha.3 h1:BNB22IzvbB9VDuvbvyr7Cke62uMDQgUXkYWJWKlI2oQ=
github.com/reecepbcups/tokenfactory v0.50.0-alpha.3/go.mod h1:qPchGcgRjxe1b6rnQOl+Rr2ruZmq8T4FcRBuLEuPICo=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
Expand Down Expand Up @@ -1691,6 +1689,8 @@ github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
github.com/strangelove-ventures/poa v0.0.1-alpha.3 h1:BtmF6nJDBARDNefO0axuMD82+nkZQWa2OkZXQaQTwpI=
github.com/strangelove-ventures/poa v0.0.1-alpha.3/go.mod h1:LcmorSGWRyn/M5hch7dAW7l0aYL+VSw28uzdsjdOduc=
github.com/strangelove-ventures/tokenfactory v0.50.0 h1:r5ja0CDrACAeCdP/LMhfdXZQFK6YEXE7yfNZ1+jZyg4=
github.com/strangelove-ventures/tokenfactory v0.50.0/go.mod h1:tiTj1dTlSM5p6dquGIggAZSClx/gnBT9DXIYxhHcEEE=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
Expand Down
4 changes: 2 additions & 2 deletions interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ replace (
require (
cosmossdk.io/math v1.2.0
github.com/cosmos/cosmos-sdk v0.50.4
github.com/cosmos/ibc-go/v8 v8.0.0
github.com/cosmos/ibc-go/v8 v8.1.0
github.com/liftedinit/manifest-ledger v0.0.0-00000000000000-000000000000
github.com/reecepbcups/tokenfactory v0.50.0-alpha.3
github.com/strangelove-ventures/interchaintest/v8 v8.1.0
github.com/strangelove-ventures/poa v0.0.1-alpha.3
github.com/strangelove-ventures/tokenfactory v0.50.0
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.26.0
)
Expand Down
8 changes: 4 additions & 4 deletions interchaintest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw=
github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY=
github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE=
github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco=
github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOhg=
github.com/cosmos/ibc-go/v8 v8.0.0/go.mod h1:C6IiJom0F3cIQCD5fKwVPDrDK9j/xTu563AWuOmXois=
github.com/cosmos/ibc-go/v8 v8.1.0 h1:pf1106wl0Cf+p1+FjXzV6odlS9DnqVunPVWCH1Uz+lQ=
github.com/cosmos/ibc-go/v8 v8.1.0/go.mod h1:o1ipS95xpdjqNcB8Drq0eI3Sn4FRLigjll42ec1ECuU=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=
Expand Down Expand Up @@ -982,8 +982,6 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/reecepbcups/tokenfactory v0.50.0-alpha.3 h1:BNB22IzvbB9VDuvbvyr7Cke62uMDQgUXkYWJWKlI2oQ=
github.com/reecepbcups/tokenfactory v0.50.0-alpha.3/go.mod h1:qPchGcgRjxe1b6rnQOl+Rr2ruZmq8T4FcRBuLEuPICo=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
Expand Down Expand Up @@ -1052,6 +1050,8 @@ github.com/strangelove-ventures/interchaintest/v8 v8.1.0 h1:+VOGGR2sEP2gLvx0ojRO
github.com/strangelove-ventures/interchaintest/v8 v8.1.0/go.mod h1:kXw3vLQdEEcvyJ3ZindGPigpHgIdwrywNsQKkARb+qM=
github.com/strangelove-ventures/poa v0.0.1-alpha.3 h1:BtmF6nJDBARDNefO0axuMD82+nkZQWa2OkZXQaQTwpI=
github.com/strangelove-ventures/poa v0.0.1-alpha.3/go.mod h1:LcmorSGWRyn/M5hch7dAW7l0aYL+VSw28uzdsjdOduc=
github.com/strangelove-ventures/tokenfactory v0.50.0 h1:r5ja0CDrACAeCdP/LMhfdXZQFK6YEXE7yfNZ1+jZyg4=
github.com/strangelove-ventures/tokenfactory v0.50.0/go.mod h1:tiTj1dTlSM5p6dquGIggAZSClx/gnBT9DXIYxhHcEEE=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/setup.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package interchaintest

import (
tokenfactorytypes "github.com/reecepbcups/tokenfactory/x/tokenfactory/types"
poatypes "github.com/strangelove-ventures/poa"
tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types"

types "github.com/liftedinit/manifest-ledger/x/manifest/types"

Expand Down
2 changes: 1 addition & 1 deletion network/manifest-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rm $HOME/.manifest/config/gentx/*.json

# Give yourself 1POASTAKE for the genesis Tx signed
manifestd init "$MONIKER" --chain-id $CHAIN_ID --staking-bond-denom poastake
manifestd add-genesis-account $KEYNAME_ADDR 1000000poastake
manifestd add-genesis-account $KEYNAME_ADDR 1000000poastake --append

# genesis transaction using all above variables
manifestd gentx $KEYNAME 1000000poastake \
Expand Down
11 changes: 9 additions & 2 deletions network/manifest-1/from_scratch.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Takes a default genesis from manifestd and creates a new genesis file.

CHAIN_ID=manifest-1

make install

export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.manifest"}")

rm -rf $HOME_DIR && echo "Removed $HOME_DIR"

manifestd init moniker --chain-id=manifest-1 --default-denom=umfx
manifestd init moniker --chain-id=$CHAIN_ID --default-denom=umfx

update_genesis () {
cat $HOME_DIR/config/genesis.json | jq "$1" > $HOME_DIR/config/tmp_genesis.json && mv $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json
Expand Down Expand Up @@ -77,6 +79,11 @@ update_genesis '.app_state["staking"]["params"]["bond_denom"]="poastake"'
update_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]="250000"'

# TODO: gov,multisig
# update_genesis '.app_state["poa"]["params"]["admins"]=["manifest10d07y265gmmuvt4z0w9aw880jnsr700jmq3jzm","MULTISIG-HERE"]'

# add genesis accounts
# TODO:
manifestd genesis add-genesis-account manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct 1umfx --append
manifestd genesis add-genesis-account manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct 1umfx --append

cp ~/.manifest/config/genesis.json ./network/$CHAIN_ID/genesis.json
28 changes: 28 additions & 0 deletions network/obvious-1/POST_GENESIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Post-Genesis

### Become a validator
* Install the manifest binary
* manifestd init <moniker> --chain-id obvious-1 --default-denom poastake
* Replace your genesis with the public one found in this repo
* Find peers and seeds here.
* Update your minimum-gas-prices in the app.toml
* Start the node and sync up
* Once completed, `manifestd tx poa create-validator path/to/validator.json --from keyname`. This command shows the JSON needed.
```json
{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"oWg2ISpLF405Jcm2vXV+2v4fnjodh6aafuIdeoW+rUw="},
"amount": "1poastake", # ignored
"moniker": "myvalidator",
"identity": "keybase-identity",
"website": "validator's (optional) website",
"security": "validator's (optional) security contact email",
"details": "validator's (optional) details",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1" # ignored
}
```

Following these instructions, your validator will be put into a queue for the chain admins to accept or reject. Once accepted, you will be a validator on the network.
The chain admin's will set your amount if they accept.
151 changes: 151 additions & 0 deletions network/obvious-1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Testnet Genesis

## Cosmos Multisig (testnet)

```sh
CHAIN_ID='obvious-1'

# Add keys for multisig
manifestd keys add chandrastation --pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A9hZjm7++QBixsH4QTQadXPrnhVBDk+MPLE74U0/GoJp"}' # manifest1wxjfftrc0emj5f7ldcvtpj05lxtz3t2npghwsf
manifestd keys add reece-testnet --pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A57Cxv5vgwE6pAJ9oYtnOdU4ehKixMj6gufF8jBRq4IC"}' # manifest1aucdev30u9505dx9t6q5fkcm70sjg4rh7rn5nf

# Create multisig with those keys and name it
manifestd keys add obvious-1-multisig --multisig reece-testnet,chandrastation --multisig-threshold 1

# - address: manifest1nzpct7tq52rckgnvr55e2m0kmyr0asdrgayq9p
# name: obvious-1-multisig
# pubkey: '{"@type":"/cosmos.crypto.multisig.LegacyAminoPubKey","threshold":1,"public_keys":[{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A9hZjm7++QBixsH4QTQadXPrnhVBDk+MPLE74U0/GoJp"},{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A57Cxv5vgwE6pAJ9oYtnOdU4ehKixMj6gufF8jBRq4IC"}]}'
# type: multi

# Generate a Tx
manifestd tx bank send $(manifestd keys show obvious-1-multisig -a) manifest1aucdev30u9505dx9t6q5fkcm70sjg4rh7rn5nf 10000000umfx --generate-only --chain-id=$CHAIN_ID | jq . > tx.json

# both sign
manifestd tx sign --from $(manifestd keys show -a reece-testnet) --multisig $(manifestd keys show -a obvious-1-multisig) tx.json --sign-mode amino-json --chain-id=$CHAIN_ID >> tx-signed-reece.json
# and for chandra station

# combine into a single Tx
manifestd tx multisign --from obvious-1-multisig tx.json obvious-1-multisig tx-signed-reece.json tx-signed-chandra.json --chain-id=$CHAIN_ID > tx_ms.json

# Anyone can Broadcast tx
manifestd tx broadcast tx_ms.json --chain-id=$CHAIN_ID
```


# Post Genesis Validators
If you are a validator joining the network after the initial genesis launch, follow the [post genesis document here](./POST_GENESIS.md).

## Hardware Requirements
**Minimal**
* 4 GB RAM
* 100 GB SSD
* 3.2 x4 GHz CPU

**Recommended**
* 8 GB RAM
* 100 GB NVME SSD
* 4.2 GHz x6 CPU

**Operating System**
* Linux (x86_64) or Linux (amd64) Recommended Arch Linux

### Dependencies
>Prerequisite: go1.21+, git, gcc, make, jq

**Arch Linux:**
```
pacman -S go git gcc make
```

**Ubuntu Linux:**
```
sudo snap install go --classic
sudo apt-get install git gcc make jq
```

## manifestd Installation Steps

```bash
# Clone git repository
git clone https://github.com/liftedinit/manifest-ledger.git
cd manifest-ledger
git checkout v0.0.1-alpha.1

make install # go install ./...
# For ledger support `go install -tags ledger ./...`

manifestd config set client chain-id obvious-1
```

### Generate keys
* `manifestd keys add [key_name]`
* `manifestd keys add [key_name] --recover` to regenerate keys with your BIP39 mnemonic to add ledger key
* `manifestd keys add [key_name] --ledger` to add a ledger key

Copy link
Member Author

@Reecepbcups Reecepbcups Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO:

  • setting config values (chain id, app toml gas prices)
  • note to save priv val key

# Validator setup instructions
## Genesis Tx:
```bash
# Validator variables
KEYNAME='validator' # your keyname
MONIKER='pbcups'
SECURITY_CONTACT="[email protected]"
WEBSITE="https://domain.com"
MAX_RATE='0.20' # 20%
COMMISSION_RATE='0.00' # 0%
MAX_CHANGE='0.01' # 1%
CHAIN_ID='obvious-1'
PROJECT_HOME="${HOME}/.manifest"
KEYNAME_ADDR=$(manifestd keys show $KEYNAME -a)

# Remove old files if they exist
manifestd tendermint unsafe-reset-all
rm $HOME/.manifest/config/genesis.json
rm $HOME/.manifest/config/gentx/*.json

# Give yourself 1POASTAKE for the genesis Tx signed
manifestd init "$MONIKER" --chain-id $CHAIN_ID --default-denom poastake
manifestd genesis add-genesis-account $KEYNAME_ADDR 1000000poastake --append

# genesis transaction using all above variables
manifestd genesis gentx $KEYNAME 1000000poastake \
--home=$PROJECT_HOME \
--chain-id=$CHAIN_ID \
--moniker="$MONIKER" \
--commission-max-change-rate=$MAX_CHANGE \
--commission-max-rate=$MAX_RATE \
--commission-rate=$COMMISSION_RATE \
--security-contact=$SECURITY_CONTACT \
--website=$WEBSITE \
--details=""

# Get that gentx data easily -> your home directory
cat ${PROJECT_HOME}/config/gentx/gentx-*.json

# get your peer
echo $(manifestd tendermint show-node-id)@$(curl -s ifconfig.me):26656
```


maintainer only:
```bash

cd networks/obvious-1

cp genesis.json $HOME/.manifest/config

# iterate through the gentx directory, print the files
# https://github.com/strangelove-ventures/bech32cli
for filename in gentx/*.json; do
addr=`cat $filename | jq -r .body.messages[0].validator_address | xargs -I {} bech32 transform {} manifest`
raw_coin=`cat $filename | jq -r .body.messages[0].value` # { "denom": "poastake", "amount": "1000000" }
coin=$(echo $raw_coin | jq -r '.amount + .denom') # make coin = 1000000poastake
manifestd genesis add-genesis-account $addr $coin --append
done

manifestd genesis collect-gentxs --gentx-dir gentx --home $HOME/.manifest

cp $HOME/.manifest/config/genesis.json live_genesis.json

# curl https://raw.githubusercontent.com/liftedinit/manifest-ledger/reece/test-network-launch/network/obvious-1/live_genesis.json > $HOME/.manifest/config/genesis.json

```
Loading