Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinssgh committed Oct 31, 2023
2 parents 5c80adb + c324935 commit 3a82e2d
Show file tree
Hide file tree
Showing 334 changed files with 20,499 additions and 16 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/generate-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ jobs:
run: |
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Generate Go code from proto files
run: make proto

- name: Generate OpenAPI
run: make openapi

- name: Generate Module Documentation
run: make specs
- name: Generate Go code, docs and specs
run: make generate

- name: Check for changes
run: |
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ proto:
@buf format -w
.PHONY: proto

typescript:
@echo "--> Generating TypeScript bindings"
@bash ./scripts/protoc-gen-typescript.sh
.PHONY: typescript

proto-format:
@bash ./scripts/proto-format.sh

Expand All @@ -174,11 +179,17 @@ specs:
@go run ./scripts/gen-spec.go
.PHONY: specs

docs-zetacored:
@echo "--> Generating zetacored documentation"
@bash ./scripts/gen-docs-zetacored.sh
.PHONY: docs-zetacored

mocks:
@echo "--> Generating mocks"
@bash ./scripts/mocks-generate.sh
.PHONY: mocks

generate: proto openapi specs
generate: proto openapi specs typescript docs-zetacored
.PHONY: generate

###############################################################################
Expand Down
7 changes: 5 additions & 2 deletions cmd/zetacore_utils/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ func main() {

distributionList := make([]TokenDistribution, len(addresses))
for i, address := range addresses {
cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node) // #nosec G204
// #nosec G204
cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node)
output, err := cmd.CombinedOutput()
if err != nil {
fmt.Println(cmd.String())
Expand Down Expand Up @@ -85,6 +86,7 @@ func main() {
args = append(args, []string{distributionList[0].TokensDistributed.String(), "--keyring-backend", "test", "--chain-id", chainID, "--yes",
"--broadcast-mode", broadcastMode, "--gas=auto", "--gas-adjustment=2", "--gas-prices=0.001azeta", "--node", node}...)

// #nosec G204
cmd := exec.Command("zetacored", args...)
output, err := cmd.CombinedOutput()
if err != nil {
Expand All @@ -97,7 +99,8 @@ func main() {
time.Sleep(7 * time.Second)

for i, address := range addresses {
cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node) // #nosec G204
// #nosec G204
cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node)
output, err := cmd.CombinedOutput()
if err != nil {
fmt.Println(cmd.String())
Expand Down
1 change: 1 addition & 0 deletions cmd/zetacored/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func SetBech32Prefixes(config *sdk.Config) {
const (
DisplayDenom = "zeta"
BaseDenom = "azeta"
AppName = "zetacored"
)

// RegisterDenoms registers the base and display denominations to the SDK.
Expand Down
49 changes: 49 additions & 0 deletions cmd/zetacored/docs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package main

import (
"os"

"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
)

func docsCmd(cmd *cobra.Command, args []string) error {
var path string

// If path is provided as an argument, use it. Else, get from flag.
if len(args) > 0 {
path = args[0]
} else {
var err error
path, err = cmd.Flags().GetString("path")
if err != nil {
return err
}
}

if _, err := os.Stat(path); os.IsNotExist(err) {
err = os.MkdirAll(path, 0750)
if err != nil {
return err
}
}

err := doc.GenMarkdownTree(cmd.Root(), path)
if err != nil {
return err
}
return nil
}

func docsCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "docs [path]",
Short: "Generate markdown documentation for zetacored",
RunE: docsCmd,
Args: cobra.MaximumNArgs(1),
}

cmd.Flags().String("path", "docs/cli/zetacored", "Path where the docs will be generated")

return cmd
}
5 changes: 2 additions & 3 deletions cmd/zetacored/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/cosmos/cosmos-sdk/snapshots"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand Down Expand Up @@ -69,7 +68,7 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) {
WithViper(EnvPrefix)

rootCmd := &cobra.Command{
Use: version.AppName,
Use: zetacoredconfig.AppName,
Short: "Zetacore Daemon (server)",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs
Expand Down Expand Up @@ -152,6 +151,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig
rpc.StatusCommand(),
queryCommand(),
txCommand(),
docsCommand(),
ethermintclient.KeyCommands(app.DefaultNodeHome),
)

Expand Down Expand Up @@ -206,7 +206,6 @@ func txCommand() *cobra.Command {
authcmd.GetMultiSignCommand(),
authcmd.GetMultiSignBatchCmd(),
authcmd.GetValidateSignaturesCommand(),
flags.LineBreak,
authcmd.GetBroadcastCommand(),
authcmd.GetEncodeCommand(),
authcmd.GetDecodeCommand(),
Expand Down
42 changes: 42 additions & 0 deletions docs/cli/zetacored/zetacored.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## zetacored

Zetacore Daemon (server)

### Options

```
-h, --help help for zetacored
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored add-genesis-account](zetacored_add-genesis-account.md) - Add a genesis account to genesis.json
* [zetacored add-observer-list](zetacored_add-observer-list.md) - Add a list of observers to the observer mapper ,default path is ~/.zetacored/os_info/observer_info.json
* [zetacored addr-conversion](zetacored_addr-conversion.md) - convert a zeta1xxx address to validator operator address zetavaloper1xxx
* [zetacored collect-gentxs](zetacored_collect-gentxs.md) - Collect genesis txs and output a genesis.json file
* [zetacored collect-observer-info](zetacored_collect-observer-info.md) - collect observer info from a folder , default path is ~/.zetacored/os_info/

* [zetacored config](zetacored_config.md) - Create or query an application CLI configuration file
* [zetacored debug](zetacored_debug.md) - Tool for helping with debugging your application
* [zetacored docs](zetacored_docs.md) - Generate markdown documentation for zetacored
* [zetacored export](zetacored_export.md) - Export state to JSON
* [zetacored gentx](zetacored_gentx.md) - Generate a genesis tx carrying a self delegation
* [zetacored get-pubkey](zetacored_get-pubkey.md) - Get you node account
* [zetacored index-eth-tx](zetacored_index-eth-tx.md) - Index historical eth txs
* [zetacored init](zetacored_init.md) - Initialize private validator, p2p, genesis, and application configuration files
* [zetacored keys](zetacored_keys.md) - Manage your application's keys
* [zetacored query](zetacored_query.md) - Querying subcommands
* [zetacored rollback](zetacored_rollback.md) - rollback cosmos-sdk and tendermint state by one height
* [zetacored rosetta](zetacored_rosetta.md) - spin up a rosetta server
* [zetacored start](zetacored_start.md) - Run the full node
* [zetacored status](zetacored_status.md) - Query remote node for status
* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands
* [zetacored testnet](zetacored_testnet.md) - subcommands for starting or configuring local testnets
* [zetacored tx](zetacored_tx.md) - Transactions subcommands
* [zetacored validate-genesis](zetacored_validate-genesis.md) - validates the genesis file at the default location or at the location passed as an arg
* [zetacored version](zetacored_version.md) - Print the application binary version information

44 changes: 44 additions & 0 deletions docs/cli/zetacored/zetacored_add-genesis-account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# add-genesis-account

Add a genesis account to genesis.json

### Synopsis

Add a genesis account to genesis.json. The provided account must specify
the account address or key name and a list of initial coins. If a key name is given,
the address will be looked up in the local Keybase. The list of initial tokens must
contain valid denominations. Accounts may optionally be supplied with vesting parameters.


```
zetacored add-genesis-account [address_or_key_name] [coin][,[coin]] [flags]
```

### Options

```
--grpc-addr string the gRPC endpoint to use for this chain
--grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS
--height int Use a specific height to query state at (this can error if the node is pruning state)
-h, --help help for add-genesis-account
--home string The application home directory
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test)
--node string [host]:[port] to Tendermint RPC interface for this chain
-o, --output string Output format (text|json)
--vesting-amount string amount of coins for vesting accounts
--vesting-end-time int schedule end time (unix epoch) for vesting accounts
--vesting-start-time int schedule start time (unix epoch) for vesting accounts
```

### Options inherited from parent commands

```
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored](zetacored.md) - Zetacore Daemon (server)

29 changes: 29 additions & 0 deletions docs/cli/zetacored/zetacored_add-observer-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# add-observer-list

Add a list of observers to the observer mapper ,default path is ~/.zetacored/os_info/observer_info.json

```
zetacored add-observer-list [observer-list.json] [flags]
```

### Options

```
-h, --help help for add-observer-list
--keygen-block int set keygen block , default is 20 (default 20)
--tss-pubkey string set TSS pubkey if using older keygen
```

### Options inherited from parent commands

```
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored](zetacored.md) - Zetacore Daemon (server)

35 changes: 35 additions & 0 deletions docs/cli/zetacored/zetacored_addr-conversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# addr-conversion

convert a zeta1xxx address to validator operator address zetavaloper1xxx

### Synopsis


read a zeta1xxx or zetavaloper1xxx address and convert it to the other type;
it always outputs three lines; the first line is the zeta1xxx address, the second line is the zetavaloper1xxx address
and the third line is the ethereum address.


```
zetacored addr-conversion [zeta address] [flags]
```

### Options

```
-h, --help help for addr-conversion
```

### Options inherited from parent commands

```
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored](zetacored.md) - Zetacore Daemon (server)

28 changes: 28 additions & 0 deletions docs/cli/zetacored/zetacored_collect-gentxs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# collect-gentxs

Collect genesis txs and output a genesis.json file

```
zetacored collect-gentxs [flags]
```

### Options

```
--gentx-dir string override default "gentx" directory from which collect and execute genesis transactions; default [--home]/config/gentx/
-h, --help help for collect-gentxs
--home string The application home directory
```

### Options inherited from parent commands

```
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored](zetacored.md) - Zetacore Daemon (server)

28 changes: 28 additions & 0 deletions docs/cli/zetacored/zetacored_collect-observer-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# collect-observer-info

collect observer info from a folder , default path is ~/.zetacored/os_info/


```
zetacored collect-observer-info [folder] [flags]
```

### Options

```
-h, --help help for collect-observer-info
```

### Options inherited from parent commands

```
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored](zetacored.md) - Zetacore Daemon (server)

Loading

0 comments on commit 3a82e2d

Please sign in to comment.