-
Notifications
You must be signed in to change notification settings - Fork 17
/
localnet_test.go
51 lines (39 loc) · 1.94 KB
/
localnet_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//go:build bdd
package emoney_test
import (
"fmt"
"github.com/e-money/em-ledger/networktest"
. "github.com/onsi/ginkgo"
)
// Setup a testnet and leave it running for local experimentation
var _ = Describe("Local Testnet", func() {
tearDownAfterTests = false
Describe("Authority manages issuers", func() {
It("creates a new testnet", createNewTestnet)
It("Prints information to the user", func() {
var (
keystore = testnet.Keystore.GetPath()
chainid = testnet.ChainID()
acc1 = testnet.Keystore.Key1
node = networktest.DefaultNode
defaultPassword = networktest.KeyPwd
)
fmt.Println("\nKeystore location", keystore)
fmt.Println("Key store passwords", defaultPassword)
fmt.Println("Local net chain-id", chainid)
fmt.Println("Node address", node)
// todo (reviewer) : rest server must be enabled in config/app.toml
// fmt.Println("Lite client interface available at http://localhost:1317/swagger-ui/")
fmt.Println("Command-line flags for testnet:")
fmt.Printf("--home %v --node %v --chain-id %v\n", keystore, node, chainid)
fmt.Println("\n -- Example commands:")
fmt.Printf("./build/emd keys list --home %v --keyring-backend test\n\n", keystore)
fmt.Printf("./build/emd q staking validators --home %v --node %v --chain-id %v\n\n", keystore, node, chainid)
fmt.Printf("./build/emd q account %v --node %v\n\n", acc1.GetAddress(), node)
fmt.Printf("./build/emd tx market add-limit 50000eeur 45000echf orderid1 --from %v --node %v --chain-id %v --home %v --yes --keyring-backend test\n\n", acc1.GetAddress(), node, chainid, keystore)
fmt.Printf("./build/emd q market instrument eeur echf --node %v\n\n", node)
fmt.Println(" -- Run this command for a pre-configured local environment:")
fmt.Printf("EMD_NODE=%v EMD_HOME=%v EMD_KEYRING_BACKEND=test EMD_CHAIN_ID=%v EMD_KEYRING_DIR=%v PS1=\"$PS1 [testnet] $\" bash\n", node, keystore, chainid, keystore)
})
})
})