Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TxTopicName is the topic name for transactions. TxTopicName = "coin.tx" // BlockTopicName is the topic name for blocks. BlockTopicName = "coin.block" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gossip ¶
type Gossip interface { // ListenTx passes incoming transactions to a callback. // Only valid transactions will be passed to the callback. ListenTx(ctx context.Context, processTx func(*pb.Transaction) error) error // ListenBlock passes incoming blocks to a callback. // Only valid blocks will be passed to the callback. // A synchronous callback is given to sync the local chain. ListenBlock(ctx context.Context, processBlock func(*pb.Block) error, sync func([]byte) error) error // PublishTx sends a new transaction to the gossip. PublishTx(tx *pb.Transaction) error // PublishBlock sends a new block to the gossip. PublishBlock(block *pb.Block) error // AddBlockListener returns a channel on which new valid // block headers received will be published. AddBlockListener() chan *pb.Header // Close closes the gossip layer. Close() error }
Gossip is an interface used to gossip transactions and blocks.
Directories ¶
Path | Synopsis |
---|---|
Package mockgossip is a generated GoMock package.
|
Package mockgossip is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.