chain

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 NewService

func NewService() *Service

NewService returns a new instance of Service.

func (*Service) GetShardsBlockByHash

func (s *Service) GetShardsBlockByHash(headerHash chainhash.Hash) *wire.MsgBlock

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

func (s *Service) ReceiveBlock(block *wire.MsgBlock) bool

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

func (s *Service) ReceiveSlimBlock(msg *wire.SlimBlock) bool

ReceiveSlimBlock sends a ReceiveSlimBlock Event to the service's actor and wait util getting a response.

func (*Service) ReceiveSmartContractShardInitOut

func (s *Service) ReceiveSmartContractShardInitOut(out *wire.OutState) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL