Documentation ¶
Index ¶
- type Communicator
- func (c *Communicator) BeaconBlockCandidates() <-chan events.BeaconBlockCandidate
- func (c *Communicator) BitcoinBlockCandidates() <-chan events.BitcoinBlockCandidate
- func (c *Communicator) MinerResults() chan tasks.MinerResult
- func (c *Communicator) Run()
- func (c *Communicator) ShardsBlockCandidates() <-chan events.ShardBlockCandidate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Communicator ¶
type Communicator struct { utils.StoppableMixin // Channel for stratum server mining.update_block events StratumUpdateBlock chan events.StratumUpdateBlock // contains filtered or unexported fields }
Communicator implements main communication layer with jax.net nodes (beacon and all shards). It is responsible for collecting block candidates from shards and the beacon for further processing, as well as propagating back minded blocks to the related shards or beacon.
Internally implements RPC-polling for fetching block candidates, and another one RPC-based interface for pushing blocks back.
func New ¶
func New(ctx context.Context, conf *settings.Configuration) (communicator *Communicator)
func (*Communicator) BeaconBlockCandidates ¶
func (c *Communicator) BeaconBlockCandidates() <-chan events.BeaconBlockCandidate
BeaconBlockCandidates returns the channel that is populated every time new block candidate arrives from beacon chain.
func (*Communicator) BitcoinBlockCandidates ¶ added in v0.2.0
func (c *Communicator) BitcoinBlockCandidates() <-chan events.BitcoinBlockCandidate
BitcoinBlockCandidates returns the channel that is populated every time new block candidate arrives from bitcoin node.
func (*Communicator) MinerResults ¶ added in v0.2.0
func (c *Communicator) MinerResults() chan tasks.MinerResult
MinerResults returns channel to send miner result.
func (*Communicator) Run ¶ added in v0.2.0
func (c *Communicator) Run()
Run begins polling of blocks from the blockchain node and sending of the mined blocks back to the blockchain node.
WARN: Being called blocks the execution flow.
func (*Communicator) ShardsBlockCandidates ¶
func (c *Communicator) ShardsBlockCandidates() <-chan events.ShardBlockCandidate
ShardsBlockCandidates returns the channel that is populated every time new block candidate arrives from some of shard chain(s).