Documentation
¶
Index ¶
- type ConfigReader
- type Node
- func (n *Node) ConnectedPeers() []peer.ID
- func (n *Node) Host() host.Host
- func (n *Node) Multiaddrs() []ma.Multiaddr
- func (n *Node) PeerID() peer.ID
- func (n *Node) PubSub() (*pubsub.PubSub, error)
- func (n *Node) SetStreamHandler(protocolID string, handler network.StreamHandler)
- func (n *Node) Start(wg *sync.WaitGroup) error
- func (n *Node) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigReader ¶ added in v0.7.0
type ConfigReader interface {
// GetKeyDir returns the legacy directory for persisting node keys.
GetKeyDir() string
// GetMaxPeers returns the maximum number of connected peers.
GetMaxPeers() int
// GetListenAddrs returns the multiaddrs to listen on.
GetListenAddrs() []string
// GetEnableRelay reports whether this node acts as a relay for NAT traversal.
GetEnableRelay() bool
// GetBootstrapPeers returns the initial peers for DHT bootstrapping.
GetBootstrapPeers() []string
// GetEnableMDNS reports whether multicast DNS discovery is enabled.
GetEnableMDNS() bool
}
ConfigReader is a narrow interface for the configuration fields that Node needs. Consumers define the interface (Go convention) so the p2p package does not depend on the config package.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node wraps a libp2p host with DHT-based peer discovery.
func NewNode ¶
func NewNode(cfg ConfigReader, logger *zap.SugaredLogger, secrets *security.SecretsStore) (*Node, error)
NewNode creates a libp2p node with Noise encryption and TCP/QUIC transports. The node key is persisted in SecretsStore (encrypted) when available, falling back to cfg.KeyDir for backward compatibility.
func (*Node) ConnectedPeers ¶
ConnectedPeers returns the peer IDs of all currently connected peers.
func (*Node) Multiaddrs ¶
Multiaddrs returns the listen addresses of the underlying host.
func (*Node) PubSub ¶ added in v0.6.0
PubSub returns the shared GossipSub instance, creating it on first access.
func (*Node) SetStreamHandler ¶
func (n *Node) SetStreamHandler(protocolID string, handler network.StreamHandler)
SetStreamHandler registers a protocol stream handler on the host.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agentpool manages a pool of discovered P2P agents with health checking, weighted selection, and capability-based filtering.
|
Package agentpool manages a pool of discovered P2P agents with health checking, weighted selection, and capability-based filtering. |
|
Package discovery implements gossip-based agent card propagation and peer discovery.
|
Package discovery implements gossip-based agent card propagation and peer discovery. |
|
Package firewall implements the Knowledge Firewall for P2P queries.
|
Package firewall implements the Knowledge Firewall for P2P queries. |
|
Package handshake implements ZK-enhanced peer authentication and session management.
|
Package handshake implements ZK-enhanced peer authentication and session management. |
|
Package identity provides decentralized identity (DID) derivation from wallet public keys.
|
Package identity provides decentralized identity (DID) derivation from wallet public keys. |
|
Package ontologybridge connects the P2P protocol handler to the ontology service.
|
Package ontologybridge connects the P2P protocol handler to the ontology service. |
|
Package paygate implements a payment gate that checks tool pricing and verifies EIP-3009 payment authorizations between the firewall and tool executor in the P2P protocol.
|
Package paygate implements a payment gate that checks tool pricing and verifies EIP-3009 payment authorizations between the firewall and tool executor in the P2P protocol. |
|
Package protocol implements the A2A-over-P2P message exchange protocol.
|
Package protocol implements the A2A-over-P2P message exchange protocol. |
|
Package reputation tracks peer trust scores based on exchange outcomes.
|
Package reputation tracks peer trust scores based on exchange outcomes. |
|
Package settlement handles asynchronous on-chain settlement of P2P tool invocation payments.
|
Package settlement handles asynchronous on-chain settlement of P2P tool invocation payments. |
|
Package team defines the types and coordination primitives for P2P agent teams.
|
Package team defines the types and coordination primitives for P2P agent teams. |
|
Package zkp provides zero-knowledge proof generation and verification using the gnark library with support for PlonK and Groth16 proving schemes.
|
Package zkp provides zero-knowledge proof generation and verification using the gnark library with support for PlonK and Groth16 proving schemes. |
|
circuits
Package circuits provides gnark circuit definitions for zero-knowledge proofs used in agent identity, attestation, and capability verification.
|
Package circuits provides gnark circuit definitions for zero-knowledge proofs used in agent identity, attestation, and capability verification. |