Initial step of integration of bzz protocol into ethereum

This commit is contained in:
Daniel A. Nagy 2015-02-10 11:32:35 +01:00
parent 2f0ff9a62f
commit 5698fe9859
2 changed files with 8 additions and 2 deletions

View file

@ -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)

View file

@ -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 {