Skip to content

Commit

Permalink
feat: add genesis command suite (gnolang#1252)
Browse files Browse the repository at this point in the history
## Description

This PR introduces the genesis.json command suite, as outlined in gnolang#1203.

Closes gnolang#1203 and gnolang#1189

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
  • Loading branch information
zivkovicmilos authored and gfanton committed Nov 9, 2023
1 parent f3d63e1 commit e7b87e2
Show file tree
Hide file tree
Showing 32 changed files with 4,220 additions and 13 deletions.
6 changes: 4 additions & 2 deletions gno.land/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ rundep=go run -modfile ../misc/devdeps/go.mod
gnoland.start:; go run ./cmd/gnoland start

.PHONY: build
build: build.gnoland build.gnokey build.gnoweb build.gnofaucet build.gnotxsync
build: build.gnoland build.gnokey build.gnoweb build.gnofaucet build.gnotxsync build.genesis

build.gnoland:; go build -o build/gnoland ./cmd/gnoland
build.gnoweb:; go build -o build/gnoweb ./cmd/gnoweb
build.gnofaucet:; go build -o build/gnofaucet ./cmd/gnofaucet
build.gnokey:; go build -o build/gnokey ./cmd/gnokey
build.gnotxsync:; go build -o build/gnotxsync ./cmd/gnotxsync
build.genesis:; go build -o build/genesis ./cmd/genesis

.PHONY: install
install: install.gnoland install.gnoweb install.gnofaucet install.gnokey install.gnotxsync
install: install.gnoland install.gnoweb install.gnofaucet install.gnokey install.gnotxsync install.genesis

install.gnoland:; go install ./cmd/gnoland
install.gnoweb:; go install ./cmd/gnoweb
install.gnofaucet:; go install ./cmd/gnofaucet
install.gnokey:; go install ./cmd/gnokey
install.gnotxsync:; go install ./cmd/gnotxsync
install.genesis:; go install ./cmd/genesis

.PHONY: fclean
fclean: clean
Expand Down
39 changes: 39 additions & 0 deletions gno.land/cmd/genesis/balances.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package main

import (
"flag"

"github.com/gnolang/gno/tm2/pkg/commands"
)

type balancesCfg struct {
commonCfg
}

// newBalancesCmd creates the genesis balances subcommand
func newBalancesCmd(io *commands.IO) *commands.Command {
cfg := &balancesCfg{}

cmd := commands.NewCommand(
commands.Metadata{
Name: "balances",
ShortUsage: "balances <subcommand> [flags]",
LongHelp: "Manipulates the initial genesis.json account balances (pre-mines)",
ShortHelp: "Manages genesis.json account balances",
},
cfg,
commands.HelpExec,
)

cmd.AddSubCommands(
newBalancesAddCmd(cfg, io),
newBalancesRemoveCmd(cfg, io),
newBalancesExportCmd(cfg, io),
)

return cmd
}

func (c *balancesCfg) RegisterFlags(fs *flag.FlagSet) {
c.commonCfg.RegisterFlags(fs)
}
Loading

0 comments on commit e7b87e2

Please sign in to comment.