Documentation ¶
Index ¶
- Constants
- type ChanMsg
- type Client
- type ConfirmMap
- type Peer
- func (me *Peer) AddNeighbor(idForNetwork crypto.Hash, addr string)
- func (me *Peer) ConfirmSnapshotForPeer(idForNetwork, snap crypto.Hash, finalized byte)
- func (me *Peer) ListenNeighbors() error
- func (p *Peer) SendHigh(key crypto.Hash, data []byte) error
- func (p *Peer) SendNormal(key crypto.Hash, data []byte) error
- func (me *Peer) SendSnapshotConfirmMessage(idForNetwork crypto.Hash, snap crypto.Hash, finalized byte) error
- func (me *Peer) SendSnapshotMessage(idForNetwork crypto.Hash, s *common.Snapshot, finalized byte) error
- func (me *Peer) SendTransactionMessage(idForNetwork crypto.Hash, tx *common.SignedTransaction) error
- func (me *Peer) SendTransactionRequestMessage(idForNetwork crypto.Hash, tx crypto.Hash) error
- type PeerMessage
- type QuicClient
- type QuicTransport
- type SyncHandle
- type SyncPoint
- type TcpClient
- type TcpTransport
- type Transport
- type TransportMessage
- type UnixClient
- type UnixTransport
Constants ¶
View Source
const ( PeerMessageTypeSnapshot = 0 PeerMessageTypePing = 1 PeerMessageTypeAuthentication = 3 PeerMessageTypeGraph = 4 PeerMessageTypeSnapshotConfirm = 5 PeerMessageTypeTransactionRequest = 6 PeerMessageTypeTransaction = 7 )
View Source
const ( MaxIncomingStreams = 128 HandshakeTimeout = 10 * time.Second IdleTimeout = 60 * time.Second ReadDeadline = 10 * time.Second WriteDeadline = 10 * time.Second )
View Source
const ( TransportMessageVersion = 1 TransportMessageMaxSize = 32 * 1024 * 1024 TransportMessageHeaderSize = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfirmMap ¶ added in v0.1.0
type Peer ¶
type Peer struct { IdForNetwork crypto.Hash Address string // contains filtered or unexported fields }
func (*Peer) ConfirmSnapshotForPeer ¶
func (*Peer) ListenNeighbors ¶
func (*Peer) SendNormal ¶ added in v0.1.0
func (*Peer) SendSnapshotConfirmMessage ¶
func (*Peer) SendSnapshotMessage ¶ added in v0.1.0
func (*Peer) SendTransactionMessage ¶
type PeerMessage ¶
type QuicClient ¶
type QuicClient struct {
// contains filtered or unexported fields
}
func (*QuicClient) Close ¶
func (c *QuicClient) Close() error
func (*QuicClient) Receive ¶
func (c *QuicClient) Receive() ([]byte, error)
func (*QuicClient) Send ¶
func (c *QuicClient) Send(data []byte) error
type QuicTransport ¶
type QuicTransport struct {
// contains filtered or unexported fields
}
func NewQuicClient ¶
func NewQuicClient(addr string) (*QuicTransport, error)
func NewQuicServer ¶
func NewQuicServer(addr string) (*QuicTransport, error)
func (*QuicTransport) Accept ¶
func (t *QuicTransport) Accept() (Client, error)
func (*QuicTransport) Dial ¶
func (t *QuicTransport) Dial() (Client, error)
func (*QuicTransport) Listen ¶
func (t *QuicTransport) Listen() error
type SyncHandle ¶
type SyncHandle interface { BuildAuthenticationMessage() []byte Authenticate(msg []byte) (crypto.Hash, error) BuildGraph() []*SyncPoint QueueAppendSnapshot(peerId crypto.Hash, s *common.Snapshot) error SendTransactionToPeer(peerId, tx crypto.Hash) error CachePutTransaction(tx *common.SignedTransaction) error ReadSnapshotsSinceTopology(offset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error) ReadSnapshotsForNodeRound(nodeIdWithNetwork crypto.Hash, round uint64) ([]*common.SnapshotWithTopologicalOrder, error) UpdateSyncPoint(peerId crypto.Hash, points []*SyncPoint) }
type TcpClient ¶ added in v0.1.0
type TcpClient struct {
// contains filtered or unexported fields
}
type TcpTransport ¶ added in v0.1.0
type TcpTransport struct {
// contains filtered or unexported fields
}
func NewTcpClient ¶ added in v0.1.0
func NewTcpClient(addr string) (*TcpTransport, error)
func NewTcpServer ¶ added in v0.1.0
func NewTcpServer(addr string) (*TcpTransport, error)
func (*TcpTransport) Accept ¶ added in v0.1.0
func (t *TcpTransport) Accept() (Client, error)
func (*TcpTransport) Dial ¶ added in v0.1.0
func (t *TcpTransport) Dial() (Client, error)
func (*TcpTransport) Listen ¶ added in v0.1.0
func (t *TcpTransport) Listen() error
type TransportMessage ¶
type UnixClient ¶ added in v0.1.4
type UnixClient struct {
// contains filtered or unexported fields
}
func (*UnixClient) Close ¶ added in v0.1.4
func (c *UnixClient) Close() error
func (*UnixClient) Receive ¶ added in v0.1.4
func (c *UnixClient) Receive() ([]byte, error)
func (*UnixClient) Send ¶ added in v0.1.4
func (c *UnixClient) Send(data []byte) error
type UnixTransport ¶ added in v0.1.4
type UnixTransport struct {
// contains filtered or unexported fields
}
func NewUnixClient ¶ added in v0.1.4
func NewUnixClient(addr string) (*UnixTransport, error)
func NewUnixServer ¶ added in v0.1.4
func NewUnixServer(addr string) (*UnixTransport, error)
func (*UnixTransport) Accept ¶ added in v0.1.4
func (t *UnixTransport) Accept() (Client, error)
func (*UnixTransport) Dial ¶ added in v0.1.4
func (t *UnixTransport) Dial() (Client, error)
func (*UnixTransport) Listen ¶ added in v0.1.4
func (t *UnixTransport) Listen() error
Click to show internal directories.
Click to hide internal directories.