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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user