Versions in this module Expand all Collapse all v0 v0.4.2 Jun 28, 2019 v0.4.1 Jun 13, 2019 Changes in this version + const DefaultNetworkID + var BzzSpec = &protocols.Spec + var DefaultTestNetworkID = rand.Uint64() + var DiscoverySpec = &protocols.Spec + var Pof = pot.DefaultPof(256) + var RequestTimeout = 10 * time.Second + func Label(e *entry) string + func LogAddrs(nns [][]byte) string + func NewEnode(params *EnodeParams) (*enode.Node, error) + func NewEnodeRecord(params *EnodeParams) (*enr.Record, error) + func NewPeerPotMap(neighbourhoodSize int, addrs [][]byte) map[string]*PeerPot + func NotifyDepth(depth uint8, kad *Kademlia) + func NotifyPeer(p *BzzAddr, k *Kademlia) + func PrivateKeyToBzzKey(prvKey *ecdsa.PrivateKey) []byte + type Bzz struct + LightNode bool + NetworkID uint64 + func NewBzz(config *BzzConfig, kad *Kademlia, store state.Store, ...) *Bzz + func (b *Bzz) APIs() []rpc.API + func (b *Bzz) GetOrCreateHandshake(peerID enode.ID) (*HandshakeMsg, bool) + func (b *Bzz) NodeInfo() interface{} + func (b *Bzz) Protocols() []p2p.Protocol + func (b *Bzz) RunProtocol(spec *protocols.Spec, run func(*BzzPeer) error) func(*p2p.Peer, p2p.MsgReadWriter) error + func (b *Bzz) UpdateLocalAddr(byteaddr []byte) *BzzAddr + type BzzAddr struct + OAddr []byte + UAddr []byte + func NewAddr(node *enode.Node) *BzzAddr + func RandomAddr() *BzzAddr + func (a *BzzAddr) Address() []byte + func (a *BzzAddr) ID() enode.ID + func (a *BzzAddr) Over() []byte + func (a *BzzAddr) String() string + func (a *BzzAddr) Under() []byte + func (a *BzzAddr) Update(na *BzzAddr) *BzzAddr + type BzzConfig struct + BootnodeMode bool + HiveParams *HiveParams + LightNode bool + NetworkID uint64 + OverlayAddr []byte + UnderlayAddr []byte + type BzzPeer struct + LightNode bool + func NewBzzPeer(p *protocols.Peer) *BzzPeer + func (p *BzzPeer) ID() enode.ID + type ENRAddrEntry struct + func NewENRAddrEntry(addr []byte) *ENRAddrEntry + func (b *ENRAddrEntry) DecodeRLP(s *rlp.Stream) error + func (b ENRAddrEntry) Address() []byte + func (b ENRAddrEntry) ENRKey() string + func (b ENRAddrEntry) EncodeRLP(w io.Writer) error + type ENRBootNodeEntry bool + func (b ENRBootNodeEntry) ENRKey() string + type ENRLightNodeEntry bool + func (b ENRLightNodeEntry) ENRKey() string + type EnodeParams struct + Bootnode bool + EnodeKey *ecdsa.PrivateKey + Lightnode bool + PrivateKey *ecdsa.PrivateKey + type Fetcher struct + func NewFetcher(ctx context.Context, addr storage.Address, rf RequestFunc, skipCheck bool) *Fetcher + func (f *Fetcher) Offer(source *enode.ID) + func (f *Fetcher) Request(hopCount uint8) + type FetcherFactory struct + func NewFetcherFactory(request RequestFunc, skipCheck bool) *FetcherFactory + func (f *FetcherFactory) New(ctx context.Context, source storage.Address, peers *sync.Map) storage.NetFetcher + type HandshakeMsg struct + Addr *BzzAddr + LightNode bool + NetworkID uint64 + Version uint64 + func (bh *HandshakeMsg) String() string + type Health struct + ConnectNN bool + CountConnectNN int + CountKnowNN int + Hive string + KnowNN bool + MissingConnectNN [][]byte + MissingKnowNN [][]byte + Saturated bool + func (h *Health) Healthy() bool + type Hive struct + Store state.Store + func NewHive(params *HiveParams, kad *Kademlia, store state.Store) *Hive + func (h *Hive) NodeInfo() interface{} + func (h *Hive) Peer(id enode.ID) *BzzPeer + func (h *Hive) PeerInfo(id enode.ID) interface{} + func (h *Hive) Run(p *BzzPeer) error + func (h *Hive) Start(server *p2p.Server) error + func (h *Hive) Stop() error + type HiveParams struct + Discovery bool + KeepAliveInterval time.Duration + MaxPeersPerRequest uint8 + PeersBroadcastSetSize uint8 + func NewHiveParams() *HiveParams + type KadParams struct + MaxBinSize int + MaxProxDisplay int + MaxRetries int + MinBinSize int + NeighbourhoodSize int + Reachable func(*BzzAddr) bool + RetryExponent int + RetryInterval int64 + func NewKadParams() *KadParams + type Kademlia struct + func NewKademlia(addr []byte, params *KadParams) *Kademlia + func (k *Kademlia) BaseAddr() []byte + func (k *Kademlia) EachAddr(base []byte, o int, f func(*BzzAddr, int) bool) + func (k *Kademlia) EachConn(base []byte, o int, f func(*Peer, int) bool) + func (k *Kademlia) GetHealthInfo(pp *PeerPot) *Health + func (k *Kademlia) ListKnown() []*BzzAddr + func (k *Kademlia) NeighbourhoodDepth() int + func (k *Kademlia) Off(p *Peer) + func (k *Kademlia) On(p *Peer) (uint8, bool) + func (k *Kademlia) Register(peers ...*BzzAddr) error + func (k *Kademlia) Saturation() int + func (k *Kademlia) String() string + func (k *Kademlia) SubscribeToNeighbourhoodDepthChange() (c <-chan struct{}, unsubscribe func()) + func (k *Kademlia) SuggestPeer() (suggestedPeer *BzzAddr, saturationDepth int, changed bool) + type Peer struct + func NewPeer(p *BzzPeer, kad *Kademlia) *Peer + func (d *Peer) HandleMsg(ctx context.Context, msg interface{}) error + func (d *Peer) NotifyDepth(po uint8) + func (d *Peer) NotifyPeer(a *BzzAddr, po uint8) + type PeerPot struct + NNSet [][]byte + PeersPerBin []int + type Request struct + Addr storage.Address + HopCount uint8 + SkipCheck bool + Source *enode.ID + func NewRequest(addr storage.Address, skipCheck bool, peersToSkip *sync.Map) *Request + func (r *Request) SkipPeer(nodeID string) bool + type RequestFunc func(context.Context, *Request) (*enode.ID, chan struct{}, error)