-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add main program for commercionetwork ignite chain
- Loading branch information
1 parent
3aa9353
commit 60cca3f
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |