aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api
diff options
context:
space:
mode:
authorlash <nolash@users.noreply.github.com>2019-03-15 18:27:17 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2019-03-15 18:27:17 +0800
commit4b4f03ca3788e16bc40737376f593623ac3f2cd8 (patch)
tree32876a858821d03529d2375b4184be1e07e03455 /swarm/api
parentdf488975bd4bc514a01a3157d52dafd0118a4a05 (diff)
downloadgo-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.tar
go-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.tar.gz
go-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.tar.bz2
go-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.tar.lz
go-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.tar.xz
go-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.tar.zst
go-tangerine-4b4f03ca3788e16bc40737376f593623ac3f2cd8.zip
swarm, p2p: Prerequities for ENR replacing handshake (#19275)
* swarm/api, swarm/network, p2p/simulations: Prerequisites for handshake remove * swarm, p2p: Add full sim node configs for protocoltester * swarm/network: Make stream package pass tests * swarm/network: Extract peer and addr types out of protocol file * p2p, swarm: Make p2p/protocols tests pass + rename types.go * swarm/network: Deactivate ExecAdapter test until binary ENR prep * swarm/api: Remove comments * swarm/network: Uncomment bootnode record load
Diffstat (limited to 'swarm/api')
-rw-r--r--swarm/api/config.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/swarm/api/config.go b/swarm/api/config.go
index b8de16f5f..1fa6c4fdf 100644
--- a/swarm/api/config.go
+++ b/swarm/api/config.go
@@ -24,6 +24,7 @@ import (
"time"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/contracts/ens"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/node"
@@ -47,9 +48,8 @@ type Config struct {
*storage.FileStoreParams
*storage.LocalStoreParams
*network.HiveParams
- Swap *swap.LocalProfile
- Pss *pss.PssParams
- //*network.SyncParams
+ Swap *swap.LocalProfile
+ Pss *pss.PssParams
Contract common.Address
EnsRoot common.Address
EnsAPIs []string
@@ -79,10 +79,9 @@ type Config struct {
func NewConfig() (c *Config) {
c = &Config{
- LocalStoreParams: storage.NewDefaultLocalStoreParams(),
- FileStoreParams: storage.NewFileStoreParams(),
- HiveParams: network.NewHiveParams(),
- //SyncParams: network.NewDefaultSyncParams(),
+ LocalStoreParams: storage.NewDefaultLocalStoreParams(),
+ FileStoreParams: storage.NewFileStoreParams(),
+ HiveParams: network.NewHiveParams(),
Swap: swap.NewDefaultSwapParams(),
Pss: pss.NewPssParams(),
ListenAddr: DefaultHTTPListenAddr,
@@ -117,7 +116,7 @@ func (c *Config) Init(prvKey *ecdsa.PrivateKey) {
pubkey := crypto.FromECDSAPub(&prvKey.PublicKey)
pubkeyhex := common.ToHex(pubkey)
- keyhex := crypto.Keccak256Hash(pubkey).Hex()
+ keyhex := hexutil.Encode(network.PrivateKeyToBzzKey(prvKey))
c.PublicKey = pubkeyhex
c.BzzKey = keyhex