diff --git a/erisdb/config.go b/erisdb/config.go deleted file mode 100644 index 7873d89da89fe28d0afd84d6eba94da75591bcde..0000000000000000000000000000000000000000 --- a/erisdb/config.go +++ /dev/null @@ -1,13 +0,0 @@ -package erisdb - -import ( - cfg "github.com/tendermint/go-config" -) - -var config cfg.Config - -func init() { - cfg.OnConfig(func(newConfig cfg.Config) { - config = newConfig - }) -} diff --git a/erisdb/pipe/blockchain.go b/erisdb/pipe/blockchain.go index 4787cbb7f50d9a2d9ca158dd3f166a1b3a3f9d4a..9a4d05a52409413982dcc392b778bb4fb4dffa07 100644 --- a/erisdb/pipe/blockchain.go +++ b/erisdb/pipe/blockchain.go @@ -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 } diff --git a/erisdb/pipe/config.go b/erisdb/pipe/config.go index 43f8f6041f95d5c09d4773f029c1a5e529a5bff8..7522d32f912a2bde32c0eb640426788d1fefa43d 100644 --- a/erisdb/pipe/config.go +++ b/erisdb/pipe/config.go @@ -1,15 +1,7 @@ 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 - }) -} diff --git a/erisdb/pipe/pipe.go b/erisdb/pipe/pipe.go index 3088b34daf3c9fb3de8bd1d331670ea736aefd51..b13380e6b2e63396620a19c77376ab46d3f1ef88 100644 --- a/erisdb/pipe/pipe.go +++ b/erisdb/pipe/pipe.go @@ -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, diff --git a/erisdb/pipe/transactor.go b/erisdb/pipe/transactor.go index 6f9bc29fe825c0b336d0f308f5ab0ae95183eb16..8ae73ef429881383fa530f33e9a4bd09e390e565 100644 --- a/erisdb/pipe/transactor.go +++ b/erisdb/pipe/transactor.go @@ -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) diff --git a/erisdb/serve.go b/erisdb/serve.go index 254f2515e0a157c86425ddd646e2298dc0467f42..2ba2581308ec522f07703c80a10f3338f72f1210 100644 --- a/erisdb/serve.go +++ b/erisdb/serve.go @@ -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)) diff --git a/glide.lock b/glide.lock index 6de9d77ab28dff2373e4bbb9b9f3f2fe672c2dc0..3e77b1bbc54585337fa5afd20b5cbb836ba9523b 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: a6917bb6310c1da8c811026f209ba9d0d51783a8e8b83e3eb73df9fc4b14f46f -updated: 2016-05-10T15:55:18.049756292+01:00 +hash: 9cba3c71b5ea9762cc27faa683ad5611c47de7761f5633131b92cde7961eb227 +updated: 2016-05-11T16:58:37.071884134-04:00 imports: - name: github.com/btcsuite/btcd version: 2554caee5919958c0d4b41db8035f0e12ce6f624 @@ -68,11 +68,11 @@ imports: - name: github.com/tendermint/go-common version: dcfa46af1341d03b80d32e4901019d1668b978b9 - name: github.com/tendermint/go-config - version: 150209dfcfdc7042dd8efc120e97398ea936e53e + version: 2d53a767e86786e610f90171e455c98a9927ad60 - 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 +80,7 @@ imports: - name: github.com/tendermint/go-merkle version: 05042c6ab9cad51d12e4cecf717ae68e3b1409a8 - name: github.com/tendermint/go-p2p - version: 78c9d526c31d5ae06d5793b865d25a9407b635dc + version: 7d997ca8e658731a22de53f11efaedee0c764b8d subpackages: - upnp - name: github.com/tendermint/go-rpc @@ -94,7 +94,7 @@ imports: - name: github.com/tendermint/log15 version: 6e460758f10ef42a4724b8e4a82fee59aaa0e41d - name: github.com/tendermint/tendermint - version: a31b718cff5a3ae95377fa4488ac303f8ec2da2f + version: b2e612fb79f204a5c8ebf63d9824b6119c42b84c subpackages: - config/tendermint - consensus @@ -119,7 +119,7 @@ imports: - name: github.com/tommy351/gin-cors version: dc91dec6313ae4db53481bf3b29cf6b94bf80357 - name: golang.org/x/crypto - version: 91ab96ae987aef3e74ab78b3aaf026109d206148 + version: b76c864ef1dca1d8f271f917c290cddcce3d9e0d subpackages: - ripemd160 - nacl/secretbox @@ -135,7 +135,7 @@ imports: - context - netutil - name: golang.org/x/sys - version: b776ec39b3e54652e09028aaaaac9757f4f8211a + version: 806cb00533e5af545ce95e84b349404f8e5ff7a8 subpackages: - unix - name: gopkg.in/fatih/set.v0 diff --git a/glide.yaml b/glide.yaml index afa08d6be776cca59bbce66c17f9883ad0445bf0..644e4c539c84a020de970cccc74f59b8f1a9654a 100644 --- a/glide.yaml +++ b/glide.yaml @@ -6,22 +6,17 @@ import: - 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 diff --git a/rpc/core/config.go b/rpc/core/config.go deleted file mode 100644 index 7f51b66625ecc9483046f5edcaad851edf89f86b..0000000000000000000000000000000000000000 --- a/rpc/core/config.go +++ /dev/null @@ -1,13 +0,0 @@ -package core - -import ( - cfg "github.com/tendermint/go-config" -) - -var config cfg.Config = nil - -func init() { - cfg.OnConfig(func(newConfig cfg.Config) { - config = newConfig - }) -} diff --git a/rpc/core/pipe.go b/rpc/core/pipe.go index c7f3fa4abf6d590e6186b029a267b520f456a6e1..23860a03e25ed0a87c9e35e8660f84091b50abba 100644 --- a/rpc/core/pipe.go +++ b/rpc/core/pipe.go @@ -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 } diff --git a/rpc/test/config.go b/rpc/test/config.go deleted file mode 100644 index 2fe20981cf37ff8b421dcdb804febb0a11a3a702..0000000000000000000000000000000000000000 --- a/rpc/test/config.go +++ /dev/null @@ -1,13 +0,0 @@ -package rpctest - -import ( - cfg "github.com/tendermint/go-config" -) - -var config cfg.Config = nil - -func init() { - cfg.OnConfig(func(newConfig cfg.Config) { - config = newConfig - }) -} diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index 91b9154d8e7dacefc33271acaf7aa42d1b226211..98affbdaf4d2fedd85d37ee0636653d918c37f28 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -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() } diff --git a/txs/config.go b/txs/config.go deleted file mode 100644 index aa5348960e43ae13ec57b31fd94f14939df67d00..0000000000000000000000000000000000000000 --- a/txs/config.go +++ /dev/null @@ -1,13 +0,0 @@ -package txs - -import ( - cfg "github.com/tendermint/go-config" -) - -var config cfg.Config = nil - -func init() { - cfg.OnConfig(func(newConfig cfg.Config) { - config = newConfig - }) -}