Skip to content

Commit

Permalink
add main program for commercionetwork ignite chain
Browse files Browse the repository at this point in the history
  • Loading branch information
fabtagliaferro committed Aug 31, 2022
1 parent 3aa9353 commit 60cca3f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commercionetwork_faucet/README.md
Original file line number Diff line number Diff line change
@@ -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.
36 changes: 36 additions & 0 deletions commercionetwork_faucet/commercionetworkfaucet.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 60cca3f

Please sign in to comment.