Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeadBlock ¶
type HeadBlock struct {
// contains filtered or unexported fields
}
HeadBlock ...
func NewHeadBlock ¶
NewHeadBlock ...
type Interface ¶
type Interface interface {
NewMessageData(messageID string, gossip bool) *pb.MessageData
SendEcho(peerID peer.ID, resp chan interface{}) error
FetchHeadBlock(peerID peer.ID, resp chan interface{}) error
SendTransaction(peerID peer.ID, txBytes []byte, resp chan interface{}) error
}
Interface ...
type Node ¶
type Node struct {
host.Host // lib-p2p host
*Echo // echo protocol impl
*HeadBlock // headblock protocol impl
*ProcessTransaction // process transaction impl
}
Node type - a p2p host implementing one or more p2p protocols
func (*Node) NewMessageData ¶
func (n *Node) NewMessageData(messageID string, gossip bool) *pb.MessageData
NewMessageData is helper method to generate message data shared between all node's p2p protocols messageId: unique for requests, copied from request for responses
type ProcessTransaction ¶
type ProcessTransaction struct {
// contains filtered or unexported fields
}
ProcessTransaction ...
func NewProcessTransaction ¶
func NewProcessTransaction(node *Node, broadcastTransactionFN func(tx *statechain.Transaction) (*nodetypes.SendTxResponse, error), addPendingTxFN func(tx *statechain.Transaction) error) *ProcessTransaction
NewProcessTransaction ...
func (*ProcessTransaction) SendTransaction ¶
func (p *ProcessTransaction) SendTransaction(peerID peer.ID, txBytes []byte, resp chan interface{}) error
SendTransaction ...
type Props ¶
type Props struct {
Host host.Host
GetHeadBlockFN func() (mainchain.Block, error)
BroadcastTransactionFN func(tx *statechain.Transaction) (*nodetypes.SendTxResponse, error)
AddPendingTxFN func(tx *statechain.Transaction) error
}
Props ...
Click to show internal directories.
Click to hide internal directories.