Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InventoryProtocol ¶
type InventoryProtocol struct {
// contains filtered or unexported fields
}
func NewInvenotryProtocol ¶
func NewInvenotryProtocol(node *Node, done chan bool) *InventoryProtocol
func (*InventoryProtocol) SendBlock ¶
func (p *InventoryProtocol) SendBlock(hostId peer.ID, block *blockchain.Block) bool
func (*InventoryProtocol) SendTransaction ¶
func (p *InventoryProtocol) SendTransaction(hostId peer.ID, tx *blockchain.Transaction) bool
type Node ¶
type Node struct { host.Host *PingProtocol *InventoryProtocol *blockchain.BlockChain MineAddress string BlocksInTransit [][]byte TransactionsMemoryPool map[string]blockchain.Transaction }
func (*Node) AddTransaction ¶
func (n *Node) AddTransaction(tx *blockchain.Transaction)
add transaction to memory pool
func (*Node) NewMessageData ¶
func (n *Node) NewMessageData(messageId string, gossip bool) *pb.MessageData
helper method - generate message data shared between all node's pb protocols
type PingProtocol ¶
type PingProtocol struct {
// contains filtered or unexported fields
}
PingProtocol type
func NewPingProtocol ¶
func NewPingProtocol(node *Node, done chan bool) *PingProtocol
Click to show internal directories.
Click to hide internal directories.