Versions in this module Expand all Collapse all v1 v1.4.0 Oct 1, 2021 Changes in this version + const LengthHeader + const MaxPayload + const TimeoutConnecting + const TimeoutReadPayload + const TimeoutWritePayload + var ApplyDeadline = true + var ErrJoinPartyTimeout = errors.New("fail to join party, timeout") + var ErrLeaderNotReady = errors.New("leader not reachable") + var ErrNotActiveSigner = errors.New("not active signer") + var ErrSigGenerated = errors.New("signature generated") + var ErrSignReceived = errors.New("signature received") + var TSSProtocolID protocol.ID = "/p2p/tss" + func LeaderNode(msgID string, blockHeight int64, pIDs []string) (string, error) + func ReadStreamWithBuffer(stream network.Stream) ([]byte, error) + func WriteStreamWithBuffer(msg []byte, stream network.Stream) error + type Communication struct + BroadcastMsgChan chan *messages.BroadcastMsgChan + func NewCommunication(rendezvous string, bootstrapPeers []maddr.Multiaddr, port int, ...) (*Communication, error) + func (c *Communication) Broadcast(peers []peer.ID, msg []byte, msgID string) + func (c *Communication) CancelSubscribe(topic messages.THORChainTSSMessageType, msgID string) + func (c *Communication) ExportPeerAddress() map[peer.ID]addr.AddrList + func (c *Communication) GetHost() host.Host + func (c *Communication) GetLocalPeerID() string + func (c *Communication) ProcessBroadcast() + func (c *Communication) ReleaseStream(msgID string) + func (c *Communication) SetSubscribe(topic messages.THORChainTSSMessageType, msgID string, channel chan *Message) + func (c *Communication) Start(priKeyBytes []byte) error + func (c *Communication) Stop() error + type Config struct + BootstrapPeers addrList + ExternalIP string + Port int + RendezvousString string + type Message struct + Payload []byte + PeerID peer.ID + type MessageIDSubscriber struct + func NewMessageIDSubscriber() *MessageIDSubscriber + func (ms *MessageIDSubscriber) GetSubscriber(msgID string) chan *Message + func (ms *MessageIDSubscriber) IsEmpty() bool + func (ms *MessageIDSubscriber) Subscribe(msgID string, channel chan *Message) + func (ms *MessageIDSubscriber) UnSubscribe(msgID string) + type PartyCoordinator struct + func NewPartyCoordinator(host host.Host, timeout time.Duration) *PartyCoordinator + func (pc *PartyCoordinator) HandleStream(stream network.Stream) + func (pc *PartyCoordinator) HandleStreamWithLeader(stream network.Stream) + func (pc *PartyCoordinator) JoinPartyWithLeader(msgID string, blockHeight int64, peers []string, threshold int, ...) ([]peer.ID, string, error) + func (pc *PartyCoordinator) JoinPartyWithRetry(msgID string, peers []string) ([]peer.ID, error) + func (pc *PartyCoordinator) ReleaseStream(msgID string) + func (pc *PartyCoordinator) Stop() + type PeerStatus struct + func NewPeerStatus(peerNodes []peer.ID, myPeerID peer.ID, leader string, threshold int) *PeerStatus + type StreamMgr struct + func NewStreamMgr() *StreamMgr + func (sm *StreamMgr) AddStream(msgID string, stream network.Stream) + func (sm *StreamMgr) ReleaseStream(msgID string)