Versions in this module Expand all Collapse all v0 v0.3.0 Nov 7, 2017 Changes in this version + const BYE + const ClientVersion + const DefaultBucketsize + const DefaultChainID + const DefaultIP + const DefaultLatency + const DefaultMaxSyncNodes + const DefaultPort + const DefaultRandseed + const DefaultRelayCacheSize + const DefaultStreamStoreExtendSize + const DefaultStreamStoreSize + const DefaultVersion + const HELLO + const LimitToSync + const NewHashMsg + const OK + const ProtocolID + const SHandshaking + const SNC + const SOK + const SyncRoute + const SyncRouteReply + var ErrNodeNotEnough = errors.New("node is not enough") + var MagicNumber = []byte + func GenerateKey(addrs ma.Multiaddr, pid peer.ID) (string, error) + func ReadBytes(reader io.Reader, n uint32) ([]byte, error) + func Write(writer io.Writer, data []byte) error + type Config struct + BootNodes []multiaddr.Multiaddr + ChainID uint32 + IP string + Port uint + Randseed int64 + RelayCacheSize int + StreamStoreExtendSize int + StreamStoreSize int + Version uint8 + func DefautConfig() *Config + func NewP2PConfig(n Neblet) *Config + type Neblet interface + Config func() nebletpb.Config + type NetService struct + func NewNetService(n Neblet) (*NetService, error) + func (netService *NetService) SayHello(bootNode multiaddr.Multiaddr) error + func (ns *NetService) Addrs() ma.Multiaddr + func (ns *NetService) Broadcast(name string, msg net.Serializable) + func (ns *NetService) Bye(pid peer.ID, addrs []ma.Multiaddr, s libnet.Stream, key string) + func (ns *NetService) Deregister(subscribers ...*net.Subscriber) + func (ns *NetService) Hello(pid peer.ID) error + func (ns *NetService) Node() *Node + func (ns *NetService) PutMessage(msg net.Message) + func (ns *NetService) Register(subscribers ...*net.Subscriber) + func (ns *NetService) Relay(name string, msg net.Serializable) + func (ns *NetService) SendMsg(msgName string, msg []byte, key string) + func (ns *NetService) SendSyncReply(key string, blocks net.Serializable) + func (ns *NetService) Start() error + func (ns *NetService) Stop() + func (ns *NetService) Sync(tail net.Serializable) error + func (ns *NetService) SyncRoutes(pid peer.ID) + type Node struct + func NewNode(config *Config) (*Node, error) + func (node *Node) Config() *Config + func (node *Node) GetSynchronized() bool + func (node *Node) ID() peer.ID + func (node *Node) SetSynchronized(synchronized bool) + type Protocol struct + type StreamStore struct + func NewStreamStore(key string, conn int, stream libnet.Stream) *StreamStore