From 5698fe9859980fca200950f7dc6ba2e4a82ed129 Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Tue, 10 Feb 2015 11:32:35 +0100 Subject: [PATCH] Initial step of integration of bzz protocol into ethereum --- bzz/hive.go | 1 + eth/backend.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bzz/hive.go b/bzz/hive.go index 3b2f0e110d..79ba71dde5 100644 --- a/bzz/hive.go +++ b/bzz/hive.go @@ -18,6 +18,7 @@ func (self *hive) removePeer(p peer) { delete(self.pool, string(p.pubkey)) } +// Retrieve a list of live peers that are closer to target than us func (self *hive) getPeers(target Key) (peers []peer) { for _, value := range self.pool { peers = append(peers, value) diff --git a/eth/backend.go b/eth/backend.go index ad04863092..50c7f171ae 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -5,6 +5,7 @@ import ( "net" "sync" + "github.com/ethereum/go-ethereum/bzz" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" @@ -18,7 +19,7 @@ import ( ) const ( - seedNodeAddress = "poc-8.ethdev.com:30303" + seedNodeAddress = "10.0.1.41:30303" ) type Config struct { @@ -134,7 +135,11 @@ func New(config *Config) (*Ethereum, error) { eth.blockPool = NewBlockPool(hasBlock, insertChain, ezp.Verify) ethProto := EthProtocol(eth.txPool, eth.chainManager, eth.blockPool) - protocols := []p2p.Protocol{ethProto, eth.whisper.Protocol()} + protocols := []p2p.Protocol{ + ethProto, + eth.whisper.Protocol(), + bzz.BzzProtocol(nil, nil), + } nat, err := p2p.ParseNAT(config.NATType, config.PMPGateway) if err != nil {