Skip to content
Snippets Groups Projects
Commit 633ccff1 authored by Benjamin Bollen's avatar Benjamin Bollen
Browse files

Merge branch 'develop-tmsp' into tmroot

parents 16be7fd1 9317cb64
No related branches found
No related tags found
No related merge requests found
package erisdb
import (
cfg "github.com/tendermint/go-config"
)
var config cfg.Config
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}
......@@ -22,11 +22,13 @@ type BlockStore interface {
// The blockchain struct.
type blockchain struct {
chainID string
genDocFile string // XXX
blockStore BlockStore
filterFactory *FilterFactory
}
func newBlockchain(blockStore BlockStore) *blockchain {
func newBlockchain(chainID, genDocFile string, blockStore BlockStore) *blockchain {
ff := NewFilterFactory()
ff.RegisterFilterPool("height", &sync.Pool{
......@@ -35,15 +37,14 @@ func newBlockchain(blockStore BlockStore) *blockchain {
},
})
return &blockchain{blockStore, ff}
return &blockchain{chainID, genDocFile, blockStore, ff}
}
// Get the status.
func (this *blockchain) Info() (*BlockchainInfo, error) {
chainId := config.GetString("erisdb.chain_id")
db := dbm.NewMemDB()
_, genesisState := state.MakeGenesisStateFromFile(db, config.GetString("erisdb.genesis_file"))
_, genesisState := state.MakeGenesisStateFromFile(db, this.genDocFile)
genesisHash := genesisState.Hash()
latestHeight := this.blockStore.Height()
......@@ -54,7 +55,7 @@ func (this *blockchain) Info() (*BlockchainInfo, error) {
}
return &BlockchainInfo{
chainId,
this.chainID,
genesisHash,
latestHeight,
latestBlockMeta,
......@@ -63,13 +64,13 @@ func (this *blockchain) Info() (*BlockchainInfo, error) {
// Get the chain id.
func (this *blockchain) ChainId() (string, error) {
return config.GetString("erisdb.chain_id"), nil
return this.chainID, nil
}
// Get the hash of the genesis block.
func (this *blockchain) GenesisHash() ([]byte, error) {
db := dbm.NewMemDB()
_, genesisState := state.MakeGenesisStateFromFile(db, config.GetString("erisdb.genesis_file"))
_, genesisState := state.MakeGenesisStateFromFile(db, this.genDocFile)
return genesisState.Hash(), nil
}
......
package pipe
import (
cfg "github.com/tendermint/go-config"
"github.com/tendermint/log15"
)
var log = log15.New("module", "eris/erisdb_pipe")
var config cfg.Config
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}
......@@ -83,6 +83,8 @@ type (
// Base struct for getting rpc proxy objects (node.Node has no interface).
type PipeImpl struct {
chainID string
genDocFile string
//tNode *node.Node
erisdbApp *tmsp.ErisDBApp
accounts Accounts
......@@ -108,21 +110,23 @@ type PipeImpl struct {
// net := newNetwork(tNode.Switch())
// txs := newTransactor(tNode.EventSwitch(), tNode.ConsensusState(), tNode.MempoolReactor(), events)
// =======
func NewPipe(erisdbApp *tmsp.ErisDBApp, eventSwitch *em.EventSwitch) Pipe {
func NewPipe(chainID, genDocFile string, erisdbApp *tmsp.ErisDBApp, eventSwitch *em.EventSwitch) Pipe {
events := newEvents(eventSwitch)
accounts := newAccounts(erisdbApp)
namereg := newNamereg(erisdbApp)
txs := newTransactor(eventSwitch, erisdbApp, events)
txs := newTransactor(chainID, eventSwitch, erisdbApp, events)
// TODO: make interface to tendermint core's rpc for these
// blockchain := newBlockchain(blockStore)
// blockchain := newBlockchain(chainID, genDocFile, blockStore)
// consensus := newConsensus(erisdbApp)
// net := newNetwork(erisdbApp)
return &PipeImpl{
erisdbApp: erisdbApp,
accounts: accounts,
chainID: chainID,
genDocFile: genDocFile,
erisdbApp: erisdbApp,
accounts: accounts,
// blockchain,
// consensus,
events: events,
......
......@@ -20,14 +20,16 @@ import (
)
type transactor struct {
chainID string
eventSwitch tEvents.Fireable
erisdbApp *tmsp.ErisDBApp
eventEmitter EventEmitter
txMtx *sync.Mutex
}
func newTransactor(eventSwitch tEvents.Fireable, erisdbApp *tmsp.ErisDBApp, eventEmitter EventEmitter) *transactor {
func newTransactor(chainID string, eventSwitch tEvents.Fireable, erisdbApp *tmsp.ErisDBApp, eventEmitter EventEmitter) *transactor {
txs := &transactor{
chainID,
eventSwitch,
erisdbApp,
eventEmitter,
......@@ -104,8 +106,7 @@ func (this *transactor) BroadcastTx(tx txs.Tx) (*Receipt, error) {
return nil, fmt.Errorf("Error broadcasting transaction: %v", err)
}
chainId := config.GetString("erisdb.chain_id")
txHash := txs.TxID(chainId, tx)
txHash := txs.TxID(this.chainID, tx)
var createsContract uint8
var contractAddr []byte
// check if creates new contract
......@@ -246,41 +247,40 @@ func (this *transactor) SignTx(tx txs.Tx, privAccounts []*account.PrivAccount) (
return nil, fmt.Errorf("Invalid (empty) privAccount @%v", i)
}
}
chainId := config.GetString("erisdb.chain_id")
switch tx.(type) {
case *txs.NameTx:
nameTx := tx.(*txs.NameTx)
nameTx.Input.PubKey = privAccounts[0].PubKey
nameTx.Input.Signature = privAccounts[0].Sign(config.GetString("erisdb.chain_id"), nameTx)
nameTx.Input.Signature = privAccounts[0].Sign(this.chainID, nameTx)
case *txs.SendTx:
sendTx := tx.(*txs.SendTx)
for i, input := range sendTx.Inputs {
input.PubKey = privAccounts[i].PubKey
input.Signature = privAccounts[i].Sign(chainId, sendTx)
input.Signature = privAccounts[i].Sign(this.chainID, sendTx)
}
break
case *txs.CallTx:
callTx := tx.(*txs.CallTx)
callTx.Input.PubKey = privAccounts[0].PubKey
callTx.Input.Signature = privAccounts[0].Sign(chainId, callTx)
callTx.Input.Signature = privAccounts[0].Sign(this.chainID, callTx)
break
case *txs.BondTx:
bondTx := tx.(*txs.BondTx)
// the first privaccount corresponds to the BondTx pub key.
// the rest to the inputs
bondTx.Signature = privAccounts[0].Sign(chainId, bondTx).(crypto.SignatureEd25519)
bondTx.Signature = privAccounts[0].Sign(this.chainID, bondTx).(crypto.SignatureEd25519)
for i, input := range bondTx.Inputs {
input.PubKey = privAccounts[i+1].PubKey
input.Signature = privAccounts[i+1].Sign(chainId, bondTx)
input.Signature = privAccounts[i+1].Sign(this.chainID, bondTx)
}
break
case *txs.UnbondTx:
unbondTx := tx.(*txs.UnbondTx)
unbondTx.Signature = privAccounts[0].Sign(chainId, unbondTx).(crypto.SignatureEd25519)
unbondTx.Signature = privAccounts[0].Sign(this.chainID, unbondTx).(crypto.SignatureEd25519)
break
case *txs.RebondTx:
rebondTx := tx.(*txs.RebondTx)
rebondTx.Signature = privAccounts[0].Sign(chainId, rebondTx).(crypto.SignatureEd25519)
rebondTx.Signature = privAccounts[0].Sign(this.chainID, rebondTx).(crypto.SignatureEd25519)
break
default:
return nil, fmt.Errorf("Object is not a proper transaction: %v\n", tx)
......
......@@ -67,7 +67,7 @@ func ServeErisDB(workDir string, inProc bool) (*server.ServeProcess, error) {
// Get an erisdb configuration
var edbConf *edbcfg.ErisDBConfig
edbConfPath := path.Join(workDir, "config.toml")
edbConfPath := path.Join(workDir, "server_config.toml")
if !FileExists(edbConfPath) {
log.Info("No server configuration, using default.")
log.Info("Writing to: " + edbConfPath)
......@@ -88,13 +88,12 @@ func ServeErisDB(workDir string, inProc bool) (*server.ServeProcess, error) {
tmConfig = tmcfg.GetConfig(workDir)
// tmConfig.Set("tm.version", TENDERMINT_VERSION) // ?
cfg.ApplyConfig(tmConfig) // Notify in proc tendermint of new config
// Load the application state
// The app state used to be managed by tendermint node,
// but is now managed by ErisDB.
// The tendermint core only stores the blockchain (history of txs)
stateDB := dbm.GetDB("app_state", edbConf.DB.Backend, workDir+"/data")
stateDB := dbm.NewDB("app_state", edbConf.DB.Backend, workDir+"/data")
state := sm.LoadState(stateDB)
var genDoc *stypes.GenesisDoc
if state == nil {
......@@ -115,7 +114,6 @@ func ServeErisDB(workDir string, inProc bool) (*server.ServeProcess, error) {
}
}
// add the chainid
config.Set("erisdb.chain_id", state.ChainID)
// *****************************
// erisdb-tmsp app
......@@ -133,7 +131,8 @@ func ServeErisDB(workDir string, inProc bool) (*server.ServeProcess, error) {
if inProc {
fmt.Println("Starting tm node in proc")
// will also start the go-rpc server (46657 api)
startTMNode(app, workDir)
startTMNode(tmConfig, app, workDir)
} else {
fmt.Println("Starting tmsp listener")
// Start the tmsp listener for state update commands
......@@ -150,8 +149,9 @@ func ServeErisDB(workDir string, inProc bool) (*server.ServeProcess, error) {
// *****************************
// Boot the erisdb restful API servers
genDocFile := tmConfig.GetString("genesis_file") // XXX
// Load supporting objects.
pipe := ep.NewPipe(app, evsw)
pipe := ep.NewPipe(state.ChainID, genDocFile, app, evsw)
codec := &TCodec{}
evtSubs := NewEventSubscriptions(pipe.Events())
// The services.
......@@ -168,9 +168,9 @@ func ServeErisDB(workDir string, inProc bool) (*server.ServeProcess, error) {
}
// start an inproc tendermint node
func startTMNode(app *edbapp.ErisDBApp, workDir string) {
func startTMNode(config cfg.Config, app *edbapp.ErisDBApp, workDir string) {
// get the genesis
genDocFile := config.GetString("tm.genesis_file")
genDocFile := config.GetString("genesis_file")
jsonBlob, err := ioutil.ReadFile(genDocFile)
if err != nil {
Exit(Fmt("Couldn't read GenesisDoc file: %v", err))
......@@ -179,18 +179,17 @@ func startTMNode(app *edbapp.ErisDBApp, workDir string) {
if genDoc.ChainID == "" {
PanicSanity(Fmt("Genesis doc %v must include non-empty chain_id", genDocFile))
}
config.Set("tm.chain_id", genDoc.ChainID)
config.Set("tm.genesis_doc", genDoc)
config.Set("chain_id", genDoc.ChainID)
// Get PrivValidator
privValidatorFile := config.GetString("tm.priv_validator_file")
privValidatorFile := config.GetString("priv_validator_file")
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
nd := node.NewNode(privValidator, func(addr string, hash []byte) proxy.AppConn {
nd := node.NewNode(config, privValidator, func(addr string, hash []byte) proxy.AppConn {
// TODO: Check the hash
return tmspcli.NewLocalClient(new(sync.Mutex), app)
})
l := p2p.NewDefaultListener("tcp", config.GetString("tm.node_laddr"), config.GetBool("tm.skip_upnp"))
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), config.GetBool("skip_upnp"))
nd.AddListener(l)
if err := nd.Start(); err != nil {
Exit(Fmt("Failed to start node: %v", err))
......@@ -199,21 +198,23 @@ func startTMNode(app *edbapp.ErisDBApp, workDir string) {
log.Notice("Started node", "nodeInfo", nd.NodeInfo())
// If seedNode is provided by config, dial out.
if config.GetString("tm.seeds") != "" {
seeds := strings.Split(config.GetString("tm.seeds"), ",")
if config.GetString("seeds") != "" {
seeds := strings.Split(config.GetString("seeds"), ",")
nd.DialSeeds(seeds)
}
// Run the RPC server.
if config.GetString("tm.rpc_laddr") != "" {
_, err := StartRPC(nd, app)
if config.GetString("rpc_laddr") != "" {
_, err := StartRPC(config, nd, app)
if err != nil {
PanicCrisis(err)
}
}
}
func StartRPC(n *node.Node, edbApp *edbapp.ErisDBApp) ([]net.Listener, error) {
func StartRPC(config cfg.Config, n *node.Node, edbApp *edbapp.ErisDBApp) ([]net.Listener, error) {
rpccore.SetConfig(config)
rpccore.SetErisDBApp(edbApp)
rpccore.SetBlockStore(n.BlockStore())
rpccore.SetConsensusState(n.ConsensusState())
......@@ -221,9 +222,9 @@ func StartRPC(n *node.Node, edbApp *edbapp.ErisDBApp) ([]net.Listener, error) {
rpccore.SetMempoolReactor(n.MempoolReactor())
rpccore.SetSwitch(n.Switch())
rpccore.SetPrivValidator(n.PrivValidator())
rpccore.SetGenDoc(LoadGenDoc())
rpccore.SetGenDoc(LoadGenDoc(config.GetString("genesis_file")))
listenAddrs := strings.Split(config.GetString("tm.rpc_laddr"), ",")
listenAddrs := strings.Split(config.GetString("rpc_laddr"), ",")
// we may expose the rpc over both a unix and tcp socket
listeners := make([]net.Listener, len(listenAddrs))
......@@ -241,8 +242,7 @@ func StartRPC(n *node.Node, edbApp *edbapp.ErisDBApp) ([]net.Listener, error) {
return listeners, nil
}
func LoadGenDoc() *stypes.GenesisDoc {
genDocFile := config.GetString("tm.genesis_file")
func LoadGenDoc(genDocFile string) *stypes.GenesisDoc {
jsonBlob, err := ioutil.ReadFile(genDocFile)
if err != nil {
Exit(Fmt("Couldn't read GenesisDoc file: %v", err))
......
hash: a6917bb6310c1da8c811026f209ba9d0d51783a8e8b83e3eb73df9fc4b14f46f
updated: 2016-05-10T15:55:18.049756292+01:00
hash: 3cbc670949fad7c035e6afc0f72060a29d3f82e0ed75e698f0bb50b3b47009b2
updated: 2016-05-17T10:49:40.457365687+01:00
imports:
- name: github.com/btcsuite/btcd
version: 2554caee5919958c0d4b41db8035f0e12ce6f624
version: f893558d782396f10c2fe49a8bc73deff4a36d14
subpackages:
- btcec
- name: github.com/btcsuite/fastsha256
......@@ -14,6 +14,8 @@ imports:
subpackages:
- binding
- render
- name: github.com/go-stack/stack
version: 100eb0c0a9c5b306ca2fb4f165df21d80ada4b82
- name: github.com/golang/protobuf
version: 2402d76f3d41f928c7902a765dfc872356dd3aad
subpackages:
......@@ -22,15 +24,10 @@ imports:
version: d7b1e156f50d3c4664f683603af70e3e47fa0aa2
- name: github.com/gorilla/websocket
version: 1f512fc3f05332ba7117626cdfb4e07474e58e60
- name: github.com/inconshreveable/log15
version: 57a084d014d4150152b19e4e531399a7145d1540
subpackages:
- stack
- term
- name: github.com/manucorporat/sse
version: ee05b128a739a0fb76c7ebd3ae4810c1de808d6d
- name: github.com/mattn/go-colorable
version: 45ce6a6f60010487dd0dbab368b5fbbed1c14ef0
version: e8a10ddc7d2a7fe255f6fd7f501070a4cb62c183
- name: github.com/mattn/go-isatty
version: 56b76bdf51f7708750eac80fa38b952bb9f32639
- name: github.com/naoina/go-stringutil
......@@ -68,11 +65,11 @@ imports:
- name: github.com/tendermint/go-common
version: dcfa46af1341d03b80d32e4901019d1668b978b9
- name: github.com/tendermint/go-config
version: 150209dfcfdc7042dd8efc120e97398ea936e53e
version: cfcef384d64b94e50909596e39b32ffb3cc20573
- name: github.com/tendermint/go-crypto
version: 41cfb7b677f4e16cdfd22b6ce0946c89919fbc7b
- name: github.com/tendermint/go-db
version: 16d1493718a519baff4f92dfec63a463525fb2fb
version: 31fdd21c7eaeed53e0ea7ca597fb1e960e2988a5
- name: github.com/tendermint/go-events
version: 7b75ca7bb55aa25e9ef765eb8c0b69486b227357
- name: github.com/tendermint/go-logger
......@@ -80,7 +77,7 @@ imports:
- name: github.com/tendermint/go-merkle
version: 05042c6ab9cad51d12e4cecf717ae68e3b1409a8
- name: github.com/tendermint/go-p2p
version: 78c9d526c31d5ae06d5793b865d25a9407b635dc
version: 5bd7692323ec60d6461678f09b5024a952164151
subpackages:
- upnp
- name: github.com/tendermint/go-rpc
......@@ -92,34 +89,36 @@ imports:
- name: github.com/tendermint/go-wire
version: 3b0adbc86ed8425eaed98516165b6788d9f4de7a
- name: github.com/tendermint/log15
version: 6e460758f10ef42a4724b8e4a82fee59aaa0e41d
version: a36450f4378275a02e1259eb5a868879019bcd41
subpackages:
- term
- name: github.com/tendermint/tendermint
version: a31b718cff5a3ae95377fa4488ac303f8ec2da2f
version: 55ef4b225fb0aa5637a96d36a8c0d030a59dc21d
subpackages:
- config/tendermint
- consensus
- node
- rpc/core/types
- types
- proxy
- types
- consensus
- blockchain
- mempool
- config/tendermint_test
- rpc/core/types
- rpc/core
- state
- version
- name: github.com/tendermint/tmsp
version: 7ffd2899092f47110a5ffebe20247a9b7f80f4ad
subpackages:
- client
- server
- types
- client
- example/dummy
- example/nil
- name: github.com/tommy351/gin-cors
version: dc91dec6313ae4db53481bf3b29cf6b94bf80357
- name: golang.org/x/crypto
version: 91ab96ae987aef3e74ab78b3aaf026109d206148
version: b6789ab629056511030d652d851e7dc10c9e9c9e
subpackages:
- ripemd160
- nacl/secretbox
......@@ -135,7 +134,7 @@ imports:
- context
- netutil
- name: golang.org/x/sys
version: b776ec39b3e54652e09028aaaaac9757f4f8211a
version: d4feaf1a7e61e1d9e79e6c4e76c6349e9cab0a03
subpackages:
- unix
- name: gopkg.in/fatih/set.v0
......
package: github.com/eris-ltd/eris-db
import:
- package: github.com/tendermint/tendermint
version: 55ef4b225fb0aa5637a96d36a8c0d030a59dc21d
- package: github.com/gin-gonic/gin
- package: github.com/gorilla/websocket
- package: github.com/naoina/toml
- package: github.com/tendermint/ed25519
- package: github.com/tendermint/go-common
- package: github.com/tendermint/go-config
version: 150209dfcfdc7042dd8efc120e97398ea936e53e
- package: github.com/tendermint/go-crypto
- package: github.com/tendermint/go-db
version: develop
- package: github.com/tendermint/go-events
- package: github.com/tendermint/go-logger
- package: github.com/tendermint/go-merkle
- package: github.com/tendermint/go-p2p
version: 78c9d526c31d5ae06d5793b865d25a9407b635dc
- package: github.com/stretchr/testify
- package: github.com/tendermint/go-rpc
- package: github.com/tendermint/go-wire
version: 3b0adbc86ed8425eaed98516165b6788d9f4de7a
- package: github.com/tendermint/log15
- package: github.com/tendermint/tendermint
version: a31b718cff5a3ae95377fa4488ac303f8ec2da2f
subpackages:
- config/tendermint
- consensus
- node
- rpc/core/types
- types
- package: github.com/tendermint/tmsp
subpackages:
- server
- types
- package: github.com/tommy351/gin-cors
- package: golang.org/x/crypto
subpackages:
......
package core
import (
cfg "github.com/tendermint/go-config"
)
var config cfg.Config = nil
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}
......@@ -9,6 +9,7 @@ import (
mempl "github.com/tendermint/tendermint/mempool"
tmtypes "github.com/tendermint/tendermint/types"
cfg "github.com/tendermint/go-config"
"github.com/tendermint/go-p2p"
)
......@@ -21,6 +22,12 @@ var privValidator *tmtypes.PrivValidator
var genDoc *stypes.GenesisDoc // cache the genesis structure
var erisdbApp *tmsp.ErisDBApp
var config cfg.Config = nil
func SetConfig(c cfg.Config) {
config = c
}
func SetErisDBApp(edbApp *tmsp.ErisDBApp) {
erisdbApp = edbApp
}
......
package rpctest
import (
cfg "github.com/tendermint/go-config"
)
var config cfg.Config = nil
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}
......@@ -15,6 +15,7 @@ import (
txs "github.com/eris-ltd/eris-db/txs"
. "github.com/tendermint/go-common"
cfg "github.com/tendermint/go-config"
"github.com/tendermint/go-crypto"
dbm "github.com/tendermint/go-db"
"github.com/tendermint/go-events"
......@@ -29,6 +30,7 @@ import (
// global variables for use across all tests
var (
config cfg.Config
node *nm.Node
mempoolCount = 0
chainID string
......@@ -44,7 +46,6 @@ var (
)
func init() {
tendermint_test.ResetConfig("rpc_test_client_test")
initGlobalVariables()
saveNewPriv()
......@@ -52,8 +53,9 @@ func init() {
// initialize config and create new node
func initGlobalVariables() {
chainID = config.GetString("tm.chain_id")
rpcAddr = config.GetString("tm.rpc_laddr")
config = tendermint_test.ResetConfig("rpc_test_client_test")
chainID = config.GetString("chain_id")
rpcAddr = config.GetString("rpc_laddr")
config.Set("erisdb.chain_id", chainID)
requestAddr = rpcAddr
websocketAddr = rpcAddr
......@@ -68,7 +70,7 @@ func initGlobalVariables() {
}
// write the genesis
MustWriteFile(config.GetString("tm.genesis_file"), []byte(defaultGenesis), 0600)
MustWriteFile(config.GetString("genesis_file"), []byte(defaultGenesis), 0600)
// TODO: change consensus/state.go timeouts to be shorter
......@@ -91,8 +93,8 @@ func makeUsers(n int) []*acm.PrivAccount {
// create a new node and sleep forever
func newNode(ready chan struct{}) {
stateDB := dbm.GetDB("app_state", "memdb", "")
genDoc, state := sm.MakeGenesisStateFromFile(stateDB, config.GetString("tm.genesis_file"))
stateDB := dbm.NewDB("app_state", "memdb", "")
genDoc, state := sm.MakeGenesisStateFromFile(stateDB, config.GetString("genesis_file"))
state.Save()
buf, n, err := new(bytes.Buffer), new(int), new(error)
wire.WriteJSON(genDoc, buf, n, err)
......@@ -106,15 +108,15 @@ func newNode(ready chan struct{}) {
app := edbapp.NewErisDBApp(state, evsw)
// Create & start node
privValidatorFile := config.GetString("tm.priv_validator_file")
privValidatorFile := config.GetString("priv_validator_file")
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
node = nm.NewNode(privValidator, nm.GetProxyApp)
l := p2p.NewDefaultListener("tcp", config.GetString("tm.node_laddr"), true)
node = nm.NewNode(config, privValidator, nm.GetProxyApp)
l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), true)
node.AddListener(l)
node.Start()
// Run the RPC server.
edb.StartRPC(node, app)
edb.StartRPC(config, node, app)
ready <- struct{}{}
// Sleep forever
......@@ -129,7 +131,7 @@ func saveNewPriv() {
PubKey: crypto.PubKeyEd25519(user[0].PubKey.(crypto.PubKeyEd25519)),
PrivKey: crypto.PrivKeyEd25519(user[0].PrivKey.(crypto.PrivKeyEd25519)),
}
priv.SetFile(config.GetString("tm.priv_validator_file"))
priv.SetFile(config.GetString("priv_validator_file"))
priv.Save()
}
......
package txs
import (
cfg "github.com/tendermint/go-config"
)
var config cfg.Config = nil
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment