mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
Initial step of integration of bzz protocol into ethereum
This commit is contained in:
parent
2f0ff9a62f
commit
5698fe9859
2 changed files with 8 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ func (self *hive) removePeer(p peer) {
|
||||||
delete(self.pool, string(p.pubkey))
|
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) {
|
func (self *hive) getPeers(target Key) (peers []peer) {
|
||||||
for _, value := range self.pool {
|
for _, value := range self.pool {
|
||||||
peers = append(peers, value)
|
peers = append(peers, value)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/bzz"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/ethdb"
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
|
|
@ -18,7 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
seedNodeAddress = "poc-8.ethdev.com:30303"
|
seedNodeAddress = "10.0.1.41:30303"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|
@ -134,7 +135,11 @@ func New(config *Config) (*Ethereum, error) {
|
||||||
eth.blockPool = NewBlockPool(hasBlock, insertChain, ezp.Verify)
|
eth.blockPool = NewBlockPool(hasBlock, insertChain, ezp.Verify)
|
||||||
|
|
||||||
ethProto := EthProtocol(eth.txPool, eth.chainManager, eth.blockPool)
|
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)
|
nat, err := p2p.ParseNAT(config.NATType, config.PMPGateway)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue