Documentation
¶
Index ¶
- type P2PNode
- func (n *P2PNode) AnnounceWallet(address string) error
- func (n *P2PNode) BroadcastBlock(block core.Block) error
- func (n *P2PNode) BroadcastTransaction(tx core.Transaction) error
- func (n *P2PNode) ConnectToPeer(peerAddr string) error
- func (n *P2PNode) FindWalletPeer(address string) (string, bool)
- func (n *P2PNode) GetAddress() string
- func (n *P2PNode) GetPeerCount() int
- func (n *P2PNode) GetPeers() []string
- func (n *P2PNode) GetWalletCount() int
- func (n *P2PNode) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type P2PNode ¶
type P2PNode struct {
// contains filtered or unexported fields
}
P2PNode represents a P2P node in the Binomena network
func NewP2PNode ¶
func NewP2PNode(blockchain *core.Blockchain, listenAddr string) (*P2PNode, error)
NewP2PNode creates a new P2P node
func (*P2PNode) AnnounceWallet ¶
AnnounceWallet announces a wallet address to the network
func (*P2PNode) BroadcastBlock ¶
BroadcastBlock broadcasts a block to all known peers
func (*P2PNode) BroadcastTransaction ¶
func (n *P2PNode) BroadcastTransaction(tx core.Transaction) error
BroadcastTransaction broadcasts a transaction to all known peers
func (*P2PNode) ConnectToPeer ¶
ConnectToPeer connects to a peer using its multiaddress
func (*P2PNode) FindWalletPeer ¶
FindWalletPeer finds the peer ID for a wallet address
func (*P2PNode) GetAddress ¶
GetAddress returns the node's address
func (*P2PNode) GetPeerCount ¶
GetPeerCount returns the number of known peers
func (*P2PNode) GetWalletCount ¶
GetWalletCount returns the number of known wallets
Click to show internal directories.
Click to hide internal directories.