Documentation ¶
Index ¶
- type Service
- func (s *Service) GetShardsBlockByHash(headerHash chainhash.Hash) *wire.MsgBlock
- func (s *Service) GetShardsBlockByHeight(shardIndex shard.Index, hgt wire.BlockHeight) *wire.MsgBlock
- func (s *Service) GetShardsHeaderByHash(headerHash chainhash.Hash) *wire.BlockHeader
- func (s *Service) GetShardsHeaderByHeight(shardIndex shard.Index, hgt wire.BlockHeight) *wire.BlockHeader
- func (s *Service) GetShardsHeaderHashes(shardIndex shard.Index, fromHgt wire.BlockHeight, toHgt wire.BlockHeight) []chainhash.Hash
- func (s *Service) GetShardsHeight(shardIndex shard.Index) wire.BlockHeight
- func (s *Service) GetSlimBlock(toshard shard.Index, shardIndex shard.Index, hgt wire.BlockHeight) *wire.SlimBlock
- func (s *Service) GetSmartContract(addr multivacaddress.Address) *wire.SmartContract
- func (s *Service) GetSmartContractCodeOut(contractAddr multivacaddress.Address, shardIdx shard.Index) *wire.OutState
- func (s *Service) GetSmartContractShardInitOut(contractAddr multivacaddress.Address, shardIdx shard.Index) *wire.OutState
- func (s *Service) ReceiveBlock(block *wire.MsgBlock) bool
- func (s *Service) ReceiveHeader(header *wire.BlockHeader) bool
- func (s *Service) ReceiveSlimBlock(msg *wire.SlimBlock) bool
- func (s *Service) ReceiveSmartContractShardInitOut(out *wire.OutState) error
- func (s *Service) SetSyncTrigger(shard shard.Index, trigger SyncTrigger)
- type SyncTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a struct which implements iblockchain.BlockChain interface.
func (*Service) GetShardsBlockByHash ¶
GetShardsBlockByHash sends the BlockByHash Event to the service's actor and wait until getting a MsgBlock.
func (*Service) GetShardsBlockByHeight ¶
func (s *Service) GetShardsBlockByHeight(shardIndex shard.Index, hgt wire.BlockHeight) *wire.MsgBlock
GetShardsBlockByHeight sends the BlockByShardAndHeight Event to the service's actor and wait until getting a MsgBlock.
func (*Service) GetShardsHeaderByHash ¶
func (s *Service) GetShardsHeaderByHash(headerHash chainhash.Hash) *wire.BlockHeader
GetShardsHeaderByHash sends the HeaderByHash Event to the service's actor and wait util getting a block header.
func (*Service) GetShardsHeaderByHeight ¶
func (s *Service) GetShardsHeaderByHeight(shardIndex shard.Index, hgt wire.BlockHeight) *wire.BlockHeader
GetShardsHeaderByHeight sends the HeaderByShardAndHeight Event to the service's actor and wait util getting a block header.
func (*Service) GetShardsHeaderHashes ¶
func (s *Service) GetShardsHeaderHashes( shardIndex shard.Index, fromHgt wire.BlockHeight, toHgt wire.BlockHeight) []chainhash.Hash
GetShardsHeaderHashes sends a ShardHeaderHashes Event to the service's actor and wait util getting headerHashes.
func (*Service) GetShardsHeight ¶
func (s *Service) GetShardsHeight(shardIndex shard.Index) wire.BlockHeight
GetShardsHeight sends the ShardHeight Event to the service's actor and wait until getting a BlockHeight.
func (*Service) GetSlimBlock ¶
func (s *Service) GetSlimBlock(toshard shard.Index, shardIndex shard.Index, hgt wire.BlockHeight) *wire.SlimBlock
GetSlimBlock sends a SlimBlockMsgByShardAndHeight Event to the service's actor and wait util getting a SlimBlock.
func (*Service) GetSmartContract ¶
func (s *Service) GetSmartContract(addr multivacaddress.Address) *wire.SmartContract
GetSmartContract sends a SmartContractByAddress Event to the service's actor and wait util getting a SmartContract.
func (*Service) GetSmartContractCodeOut ¶
func (s *Service) GetSmartContractCodeOut(contractAddr multivacaddress.Address, shardIdx shard.Index) *wire.OutState
GetSmartContractCodeOut sends a SmartContractCodeOut Event to the service's actor and wait util getting a OutState.
func (*Service) GetSmartContractShardInitOut ¶
func (s *Service) GetSmartContractShardInitOut(contractAddr multivacaddress.Address, shardIdx shard.Index) *wire.OutState
GetSmartContractShardInitOut sends a SmartContractShardInitOut Event to the service's actor and wait util getting a OutState.
func (*Service) ReceiveBlock ¶
ReceiveBlock sends the ReceiveBlock Event to the service's actor and wait until getting response.
func (*Service) ReceiveHeader ¶
func (s *Service) ReceiveHeader(header *wire.BlockHeader) bool
ReceiveHeader sends the ReceiveHeader Event to the service's actor and wait until getting response.
func (*Service) ReceiveSlimBlock ¶
ReceiveSlimBlock sends a ReceiveSlimBlock Event to the service's actor and wait util getting a response.
func (*Service) ReceiveSmartContractShardInitOut ¶
ReceiveSmartContractShardInitOut sends a ReceiveSmartContractShardInitOut Event to the service's actor and wait util getting a response.
func (*Service) SetSyncTrigger ¶
func (s *Service) SetSyncTrigger(shard shard.Index, trigger SyncTrigger)
SetSyncTrigger sends SetTrigger Event to the service's actor.
type SyncTrigger ¶
type SyncTrigger interface {
MaybeSync()
}
SyncTrigger is a interface that contains a method called MayBeSync which notifies SyncManager to request a sync, whether or not a sync will actually happen depending on internal logic.