diff --git a/commercionetwork_faucet/README.md b/commercionetwork_faucet/README.md new file mode 100644 index 0000000000..8925874a79 --- /dev/null +++ b/commercionetwork_faucet/README.md @@ -0,0 +1,3 @@ +Execute the faucet with `go run .` while in a terminal in this folder. + +This program has been tested with a `ignite chain serve` local network launched from a `commercionetwork` repo folder. \ No newline at end of file diff --git a/commercionetwork_faucet/commercionetworkfaucet.go b/commercionetwork_faucet/commercionetworkfaucet.go new file mode 100644 index 0000000000..d1e803d2da --- /dev/null +++ b/commercionetwork_faucet/commercionetworkfaucet.go @@ -0,0 +1,36 @@ +package main + +import ( + "context" + "net/http" + + "github.com/ignite/cli/ignite/pkg/cosmosfaucet" + + "github.com/ignite/cli/ignite/pkg/chaincmd" + chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" +) + +func main() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + cmd := chaincmd.New("commercionetworkd") + + runner, err := chaincmdrunner.New(ctx, cmd) + if err != nil { + panic(err) + } + + comDenom := "ucommercio" + + faucet, err := cosmosfaucet.New(ctx, runner, + cosmosfaucet.Account("bob", "special chest leaf section reunion inflict busy blouse inflict kid alcohol hazard embody mosquito green turkey street very lab forest gain disease hollow bomb", "com"), + cosmosfaucet.Coin(1000, 2000, comDenom), + cosmosfaucet.ChainID("commercionetwork"), + ) + if err != nil { + panic(err) + } + + http.ListenAndServe(":8181", faucet) +}