Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FastSum256 ¶
FastSum256 returns a hash sum of the input data using highwayhash. This method is not secure, but may be used as a quick identifier for objects where collisions are acceptable.
Types ¶
type Config ¶
type Config struct { NoDiscovery bool EnableUPnP bool StaticPeers []string BootstrapNodeAddr []string Discv5BootStrapAddr []string DataDir string MaxPeers uint MaxInbound int MetaDataDir string ReadWritePermissions os.FileMode AllowListCIDR string DenyListCIDR []string TCPPort uint UDPPort uint EnableNoise bool RelayNodeAddr string LocalIP string HostAddress string HostDNS string PrivateKey string Encoding string // ProtocolVersion specifies the maximum protocol version to use and // advertise. ProtocolVersion uint32 Services protocol.ServiceFlag UserAgent string // DisableRelayTx specifies if the remote peer should be informed to // not send inv messages for transactions. DisableRelayTx bool MaxOrphanTxs int Params *params.Params Banning bool // Open or not ban module DisableListen bool LANPeers []string IsCircuit bool }
Config for the p2p service. to initialize the p2p service.
type ErrorCode ¶
type ErrorCode int
ErrorCode identifies a kind of error.
const ( // There are no errors by default ErrNone ErrorCode = iota // p2p stream write error ErrStreamWrite // p2p stream read error ErrStreamRead // p2p stream base error ErrStreamBase // p2p peer unknown error ErrPeerUnknown // p2p peer bad error ErrBadPeer // p2p DAG consensus error ErrDAGConsensus // p2p message error ErrMessage )
type P2P ¶
type P2P interface { GetGenesisHash() *hash.Hash BlockChain() *blockchain.BlockChain Host() host.Host Disconnect(pid peer.ID) error Context() context.Context Encoding() encoder.NetworkEncoding Config() *Config TxMemPool() *mempool.TxPool Metadata() *pb.MetaData MetadataSeq() uint64 TimeSource() blockchain.MedianTimeSource Notify() notify.Notify ConnectTo(node *qnode.Node) Resolve(n *qnode.Node) *qnode.Node Node() *qnode.Node RelayNodeInfo() *peer.AddrInfo IncreaseBytesSent(pid peer.ID, size int) IncreaseBytesRecv(pid peer.ID, size int) }
type QMultiaddr ¶
func QMultiAddrFromString ¶
func QMultiAddrFromString(address string) (QMultiaddr, error)
Click to show internal directories.
Click to hide internal directories.