Versions in this module Expand all Collapse all v0 v0.4.0 Oct 11, 2018 Changes in this version + const DefaultNetworkID + const ProtocolMaxMsgSize + var BzzSpec = &protocols.Spec + var DiscoverySpec = &protocols.Spec + var RequestTimeout = 10 * time.Second + func Label(e *entry) string + func LogAddrs(nns [][]byte) string + func NewNodeIDFromAddr(addr *BzzAddr) discover.NodeID + func NewPeerPotMap(kadMinProxSize int, addrs [][]byte) map[string]*PeerPot + func NotifyDepth(depth uint8, kad *Kademlia) + func NotifyPeer(p *BzzAddr, k *Kademlia) + func ToOverlayAddr(id []byte) []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) GetHandshake(peerID discover.NodeID) (*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 NewAddrFromNodeID(id discover.NodeID) *BzzAddr + func NewAddrFromNodeIDAndPort(id discover.NodeID, host net.IP, port uint16) *BzzAddr + func RandomAddr() *BzzAddr + func (a *BzzAddr) Address() []byte + func (a *BzzAddr) ID() discover.NodeID + 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 + HiveParams *HiveParams + LightNode bool + NetworkID uint64 + OverlayAddr []byte + UnderlayAddr []byte + type BzzPeer struct + LightNode bool + func NewBzzPeer(p *protocols.Peer, addr *BzzAddr) *BzzPeer + func (p *BzzPeer) LastActive() time.Time + type Fetcher struct + func NewFetcher(addr storage.Address, rf RequestFunc, skipCheck bool) *Fetcher + func (f *Fetcher) Offer(ctx context.Context, source *discover.NodeID) + func (f *Fetcher) Request(ctx context.Context) + type FetcherFactory struct + func NewFetcherFactory(request RequestFunc, skipCheck bool) *FetcherFactory + func (f *FetcherFactory) New(ctx context.Context, source storage.Address, peersToSkip *sync.Map) storage.NetFetcher + type HandshakeMsg struct + Addr *BzzAddr + LightNode bool + NetworkID uint64 + Version uint64 + func (bh *HandshakeMsg) String() string + type Health struct + CountNN int + CulpritsNN [][]byte + Full bool + GotNN bool + Hive string + KnowNN 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) PeerInfo(id discover.NodeID) 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 + MinProxBinSize 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) AddrCountC() <-chan int + func (k *Kademlia) BaseAddr() []byte + func (k *Kademlia) EachAddr(base []byte, o int, f func(*BzzAddr, int, bool) bool) + func (k *Kademlia) EachBin(base []byte, pof pot.Pof, o int, eachBinFunc func(conn *Peer, po int) bool) + func (k *Kademlia) EachConn(base []byte, o int, f func(*Peer, int, bool) bool) + func (k *Kademlia) Healthy(pp *PeerPot) *Health + func (k *Kademlia) NeighbourhoodDepthC() <-chan 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) String() string + func (k *Kademlia) SuggestPeer() (a *BzzAddr, o int, want 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 + EmptyBins []int + NNSet [][]byte + type Request struct + Addr storage.Address + SkipCheck bool + Source *discover.NodeID + func NewRequest(addr storage.Address, skipCheck bool, peersToSkip *sync.Map) *Request + func (r *Request) SkipPeer(nodeID string) bool + type RequestFunc func(context.Context, *Request) (*discover.NodeID, chan struct{}, error)