Documentation ¶
Index ¶
- Constants
- func GetHeaderByHash(native *native.NativeService, chainID uint64, hash common.Uint256) (*ccom.Header, error)
- func GetHeaderByHeight(native *native.NativeService, chainID uint64, height uint32) (*ccom.Header, error)
- func InitHeaderSync()
- func ProcessHeader(native *native.NativeService, header *ccom.Header, h []byte) error
- func PutBlockHeader(native *native.NativeService, blockHeader *ccom.Header, header []byte) error
- func RegisterHeaderSyncContract(native *native.NativeService)
- func SyncBlockHeader(native *native.NativeService) ([]byte, error)
- func SyncGenesisHeader(native *native.NativeService) ([]byte, error)
- func UpdateConsensusPeer(native *native.NativeService, header *ccom.Header) error
- func VerifyHeader(native *native.NativeService, header *ccom.Header) error
- type ConsensusPeers
- type KeyHeights
- type Peer
- type SyncBlockHeaderParam
- type SyncGenesisHeaderParam
Constants ¶
View Source
const ( //function name SYNC_GENESIS_HEADER = "syncGenesisHeader" SYNC_BLOCK_HEADER = "syncBlockHeader" //key prefix BLOCK_HEADER = "blockHeader" CURRENT_HEIGHT = "currentHeight" HEADER_INDEX = "headerIndex" CONSENSUS_PEER = "consensusPeer" KEY_HEIGHTS = "keyHeights" )
Variables ¶
This section is empty.
Functions ¶
func GetHeaderByHash ¶
func GetHeaderByHeight ¶
func ProcessHeader ¶
func PutBlockHeader ¶
func RegisterHeaderSyncContract ¶
func RegisterHeaderSyncContract(native *native.NativeService)
Register methods of governance contract
func SyncBlockHeader ¶
func SyncBlockHeader(native *native.NativeService) ([]byte, error)
func SyncGenesisHeader ¶
func SyncGenesisHeader(native *native.NativeService) ([]byte, error)
func UpdateConsensusPeer ¶
func UpdateConsensusPeer(native *native.NativeService, header *ccom.Header) error
func VerifyHeader ¶
func VerifyHeader(native *native.NativeService, header *ccom.Header) error
verify header of any height find key height and get consensus peer first, then check the sign
Types ¶
type ConsensusPeers ¶
func (*ConsensusPeers) Deserialization ¶
func (this *ConsensusPeers) Deserialization(source *common.ZeroCopySource) error
func (*ConsensusPeers) Serialization ¶
func (this *ConsensusPeers) Serialization(sink *common.ZeroCopySink)
type KeyHeights ¶
type KeyHeights struct {
HeightList []uint32
}
func GetKeyHeights ¶
func GetKeyHeights(native *native.NativeService, chainID uint64) (*KeyHeights, error)
func (*KeyHeights) Deserialization ¶
func (this *KeyHeights) Deserialization(source *common.ZeroCopySource) error
func (*KeyHeights) Serialization ¶
func (this *KeyHeights) Serialization(sink *common.ZeroCopySink)
type Peer ¶
func (*Peer) Deserialization ¶
func (this *Peer) Deserialization(source *common.ZeroCopySource) error
func (*Peer) Serialization ¶
func (this *Peer) Serialization(sink *common.ZeroCopySink)
type SyncBlockHeaderParam ¶
func (*SyncBlockHeaderParam) Deserialization ¶
func (this *SyncBlockHeaderParam) Deserialization(source *common.ZeroCopySource) error
func (*SyncBlockHeaderParam) Serialization ¶
func (this *SyncBlockHeaderParam) Serialization(sink *common.ZeroCopySink)
type SyncGenesisHeaderParam ¶
type SyncGenesisHeaderParam struct {
GenesisHeader []byte
}
func (*SyncGenesisHeaderParam) Deserialization ¶
func (this *SyncGenesisHeaderParam) Deserialization(source *common.ZeroCopySource) error
func (*SyncGenesisHeaderParam) Serialization ¶
func (this *SyncGenesisHeaderParam) Serialization(sink *common.ZeroCopySink)
Click to show internal directories.
Click to hide internal directories.