aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/config.go
diff options
context:
space:
mode:
authorViktor TrĂ³n <viktor.tron@gmail.com>2016-11-28 20:29:33 +0800
committerFelix Lange <fjl@twurst.com>2016-11-28 20:29:33 +0800
commite949a2ed2f1c59ed5ff1f187ad987c882656e6ef (patch)
tree836c8b977ef61ddbc8163f70cbed118825822cbe /swarm/api/config.go
parent8d0108fc5df81c71010b9dfb11a5db5658fcb80a (diff)
downloaddexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.tar
dexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.tar.gz
dexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.tar.bz2
dexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.tar.lz
dexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.tar.xz
dexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.tar.zst
dexon-e949a2ed2f1c59ed5ff1f187ad987c882656e6ef.zip
cmd/bzzd: swarm daemon fixes (#3359)
* cmd/bzzd: add missing p2p/discovery flags * cmd/bzzd: fix two bugs crashing bzzd if bootnodes flag given * cmd/bzzd: make no swap default, renamed flag bzznoswap->bzzswap * internal/web3ext: correct methods for bzz IPC module * cmd/bzzd: ethapi param not mandatory. Warning if no blockchain * cmd/bzzd: correct default IPC modules in help string * cmd/utils: fix help description for networkId - add Ropsten * cmd/bzz, swarm/api, swarm/network: add swarm networkId flag * cmd/bzzd: change nosync flag to sync and BootTFlag
Diffstat (limited to 'swarm/api/config.go')
-rw-r--r--swarm/api/config.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/swarm/api/config.go b/swarm/api/config.go
index c04a015ef..f9d3575f7 100644
--- a/swarm/api/config.go
+++ b/swarm/api/config.go
@@ -54,11 +54,12 @@ type Config struct {
PublicKey string
BzzKey string
EnsRoot common.Address
+ NetworkId uint64
}
// config is agnostic to where private key is coming from
// so managing accounts is outside swarm and left to wrappers
-func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey) (self *Config, err error) {
+func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey, networkId uint64) (self *Config, err error) {
address := crypto.PubkeyToAddress(prvKey.PublicKey) // default beneficiary address
dirpath := filepath.Join(path, "bzz-"+common.Bytes2Hex(address.Bytes()))
err = os.MkdirAll(dirpath, os.ModePerm)
@@ -82,6 +83,7 @@ func NewConfig(path string, contract common.Address, prvKey *ecdsa.PrivateKey) (
PublicKey: pubkeyhex,
BzzKey: keyhex,
EnsRoot: toyNetEnsRoot,
+ NetworkId: networkId,
}
data, err = ioutil.ReadFile(confpath)
if err != nil {