Skip to content

Commit

Permalink
docs: create READMEs for app and cmd modules (#1195)
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonPhang authored Jan 24, 2024
2 parents b8d660b + b86ceb9 commit 5d9feee
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 204 deletions.
11 changes: 6 additions & 5 deletions networks/genesis/devnet-minimal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
MNEMONIC = "wine parrot nominee girl exchange element pudding grow area twenty next junior come render shadow evidence sentence start rough debate feed all limb real";
GENESIS_ACCOUNT_NAME = "testkey";

uniond = pkgs.lib.getExe (get-flake inputs.v0_15_0).packages.${system}.uniond;
uniond = pkgs.lib.getExe (get-flake inputs.v0_18_0).packages.${system}.uniond;

mkNodeId = name:
pkgs.runCommand "node-id" { } ''
Expand Down Expand Up @@ -35,6 +35,7 @@
dasel put --help
dasel -f $out/config/genesis.json put -t string -v 12s '.app_state.gov.params.voting_period'
dasel -f $out/config/genesis.json put -t string -v 10s '.app_state.gov.params.expedited_voting_period'
'';

mkHome = { genesisAccounts }: home:
Expand Down Expand Up @@ -64,7 +65,7 @@
echo $val_mnemonic
echo $val_mnemonic | ${uniond} keys add --recover ${key} --keyring-backend test --home $out
${uniond} add-genesis-account ${key} 100000000000000000000000000stake --keyring-backend test --home $out
${uniond} genesis add-genesis-account ${key} 100000000000000000000000000stake --keyring-backend test --home $out
'') genesisAccounts)}
'';

Expand Down Expand Up @@ -111,7 +112,7 @@
}.json | jq ."pub_key"."value"`
PUBKEY="{\"@type\":\"/cosmos.crypto.bn254.PubKey\",\"key\":$PUBKEY}"
mkdir -p $out
${uniond} gentx val-${toString i} 1000000000000000000000stake "bn254" --keyring-backend test --chain-id ${CHAIN_ID} --home ${home} --ip "0.0.0.0" --pubkey $PUBKEY --moniker validator-${toString i} --output-document $out/valgentx-${
${uniond} genesis gentx val-${toString i} 1000000000000000000000stake "bn254" --keyring-backend test --chain-id ${CHAIN_ID} --home ${home} --ip "0.0.0.0" --pubkey $PUBKEY --moniker validator-${toString i} --output-document $out/valgentx-${
toString i
}.json
'')
Expand All @@ -137,8 +138,8 @@
cp ${valGentx}/valgentx-${toString i}.json ./config/gentx/
'') validatorGentxs)}
${uniond} collect-gentxs --home $HOME 2> /dev/null
${uniond} validate-genesis --home $HOME
${uniond} genesis collect-gentxs --home $HOME 2> /dev/null
${uniond} genesis validate-genesis --home $HOME
'';

packages.minimal-validator-keys = pkgs.symlinkJoin {
Expand Down
6 changes: 3 additions & 3 deletions networks/genesis/devnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
--keyring-backend test \
--home $out
${uniond} add-genesis-account ${genesisAccountName} 10000000000000000000000000stake \
${uniond} genesis add-genesis-account ${genesisAccountName} 10000000000000000000000000stake \
--keyring-backend test \
--home $out
Expand All @@ -51,7 +51,7 @@
--recover ${genesisAccountName}-${toString i} \
--keyring-backend test \
--home $out
${uniond} add-genesis-account ${genesisAccountName}-${toString i} 10000000000000000000000000stake \
${uniond} genesis add-genesis-account ${genesisAccountName}-${toString i} 10000000000000000000000000stake \
--keyring-backend test \
--home $out
'') devMnemonics)}
Expand Down Expand Up @@ -437,7 +437,7 @@
echo $val_mnemonic
echo $val_mnemonic | ${uniond} keys add --recover ${key} --keyring-backend test --home $out
${uniond} add-genesis-account ${key} 100000000000000000000000000stake --keyring-backend test --home $out
${uniond} genesis add-genesis-account ${key} 100000000000000000000000000stake --keyring-backend test --home $out
'') genesisAccounts)}
'';
mkValidatorKeys = { validatorCount, home }:
Expand Down
23 changes: 23 additions & 0 deletions uniond/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# App

The app module of `uniond` initializes the structure and tooling of the `uniond` node.

## Design

The structure of our app module is based off the app_v1 design from the cosmos-sdk simapp.

### Custom Query

The `custom_query` submodule is used for native BLS aggregation and verification of custom queries from light clients.

### IBC

The `ibc` submodule contains a keeper and functions used for maintaining the client and consensus state for IBC connections.

### Params

The `params` submodule contains default parameters used when initializing the application.

### Upgrades

The `upgrades` submodule contains runtime migrations used while upgrading the network.
15 changes: 15 additions & 0 deletions uniond/cmd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# CMD

The `cmd` module is responsible for initializing the root command used in the CLI interface for `uniond`.

## Sub-Commands

In addition to initializing the `uniond` command, we use this module to add a few of our own sub-commands.

### `genbn`

Used to generate a bn254 key-pair for use as a consensus key.

### `genstateproof`

Generates a state proof for the current node.
195 changes: 0 additions & 195 deletions uniond/cmd/uniond/cmd/genaccounts.go

This file was deleted.

1 change: 0 additions & 1 deletion uniond/cmd/uniond/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func initRootCmd(

rootCmd.AddCommand(
genutilcli.InitCmd(basicManager, app.DefaultNodeHome),
AddGenesisAccountCmd(app.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
debug.Cmd(),
confixcmd.ConfigCommand(),
Expand Down

0 comments on commit 5d9feee

Please sign in to comment.