Documentation ¶
Index ¶
Constants ¶
const AlgorandWsProtocol = "/algorand-ws/1.0.0"
AlgorandWsProtocol defines a libp2p protocol name for algorand's websockets messages
const DefaultPrivKeyPath = "peerIDPrivKey.pem"
DefaultPrivKeyPath is the default path inside the node's root directory at which the private key for p2p identity is found and persisted to when a new one is generated.
const TXTopicName = "/algo/tx/0.1.0"
TXTopicName defines a pubsub topic for TX messages
Variables ¶
This section is empty.
Functions ¶
func GetPrivKey ¶
GetPrivKey manages loading and creation of private keys for network PeerIDs It prioritizes, in this order:
- user supplied path to privKey
- default path to privKey,
- generating a new privKey.
If a new privKey is generated it will be saved to default path if cfg.P2PPersistPeerID.
Types ¶
type PeerID ¶
type PeerID string
PeerID is a string representation of a peer's public key, primarily used to avoid importing libp2p into packages that shouldn't need it
type Service ¶
type Service interface { Close() error ID() peer.ID // return peer.ID for self AddrInfo() peer.AddrInfo // return addrInfo for self DialNode(context.Context, *peer.AddrInfo) error DialPeersUntilTargetCount(targetConnCount int) ClosePeer(peer.ID) error Conns() []network.Conn ListPeersForTopic(topic string) []peer.ID Subscribe(topic string, val pubsub.ValidatorEx) (*pubsub.Subscription, error) Publish(ctx context.Context, topic string, data []byte) error }
Service defines the interface used by the network integrating with underlying p2p implementation