Documentation ¶
Index ¶
- Constants
- Variables
- func IsSamePubKey(p1, p2 PublicKey) bool
- func MarshalBinary(v interface{}) ([]byte, error)
- type AccountName
- type ActMsgHandler
- type Action
- type ActionMsg
- type ActionName
- type BlkMsgHandler
- type BlockHeader
- type BlockMsg
- type BlockState
- type Chain
- type Checksum256
- type EOSNameOrUint32
- type Genesis
- type GoAwayMessage
- type IncrementalMerkle
- type MerkleRoot
- type Packet
- type PendingSchedule
- type PermissionName
- type PrivateKey
- type ProducerKey
- type ProducerSchedule
- type PublicKey
- type SHA256Bytes
- type ScheduleProducersDatas
- func (s *ScheduleProducersDatas) GetScheduleProducer(version uint32, name AccountName) (ProducerKey, error)
- func (s *ScheduleProducersDatas) GetScheduleProducersHash() Checksum256
- func (s *ScheduleProducersDatas) Init(genesis *Genesis)
- func (s *ScheduleProducersDatas) OnBlock(msg *SignedBlock) error
- type ScopeName
- type SignedBlock
- type TableName
- type Transaction
- type TransactionMsg
- type TrxMsgHandler
Constants ¶
const ( // SignedBlockType eos.SignedBlockType SignedBlockType = eos.SignedBlockType // GoAwayMessageType eos.GoAwayMessageType GoAwayMessageType = eos.GoAwayMessageType )
Variables ¶
var ( // ErrChainFork error by block fork in chain ErrChainFork = errors.New("errorChainFork") )
var TypeSize = eos.TypeSize
TypeSize size for eos types
Functions ¶
func MarshalBinary ¶
MarshalBinary call eos MarshalBinary
Types ¶
type ActMsgHandler ¶
type ActMsgHandler func(act *ActionMsg)
ActMsgHandler act msg handler func type
type ActionMsg ¶
type ActionMsg struct { BlockNum uint32 BlockID Checksum256 TransactionID Checksum256 Timestamp time.Time Act Action }
ActionMsg msg when a action is committed to the chain
type BlockMsg ¶
type BlockMsg struct {
Block SignedBlock
}
BlockMsg msg when a block is committed to the chain
type BlockState ¶
type BlockState struct { BlockID string `json:"id"` BlockNum uint32 `json:"block_num"` DPoSProposedIrreversibleBlockNum uint32 `json:"dpos_proposed_irreversible_blocknum"` DPoSIrreversibleBlockNum uint32 `json:"dpos_irreversible_blocknum"` ActiveSchedule *eos.ProducerSchedule `json:"active_schedule"` BlockrootMerkle *MerkleRoot `json:"blockroot_merkle"` ProducerToLastProduced [][2]EOSNameOrUint32 `json:"producer_to_last_produced"` ProducerToLastImpliedIRB [][2]EOSNameOrUint32 `json:"producer_to_last_implied_irb"` BlockSigningKey ecc.PublicKey `json:"block_signing_key"` ConfirmCount []uint32 `json:"confirm_count"` PendingSchedule *PendingSchedule `json:"pending_schedule"` ActivatedProtocolFeatures map[string][]eos.HexBytes `json:"activated_protocol_features"` SignedBlock *eos.SignedBlock `json:"block"` Validated bool `json:"validated"` }
BlockState block detail state from a signed block data and the chain state
func NewBlockStateByBlock ¶
func NewBlockStateByBlock(sb *SignedBlock) *BlockState
NewBlockStateByBlock just tmp imp
type Chain ¶
type Chain struct { PendingState pendingState `json:"pending"` ScheduleProducers ScheduleProducersDatas `json:"scheduleProducers"` // contains filtered or unexported fields }
Chain eosc chain
func (*Chain) PushBlock ¶
func (c *Chain) PushBlock(b *BlockState) error
PushBlock try to append a block from net to chain, in eosio a block produced by self also need push block, but for a light node, cannot be producer
type Checksum256 ¶
type Checksum256 = eos.Checksum256
Checksum256 id
func GetBlockHeaderHash ¶
func GetBlockHeaderHash(block *BlockHeader) Checksum256
GetBlockHeaderHash get block header for verify
func HashCheckSumPair ¶
func HashCheckSumPair(c1, c2 Checksum256) Checksum256
HashCheckSumPair get sha256 hash from c1+c2
type EOSNameOrUint32 ¶
type EOSNameOrUint32 interface{}
type IncrementalMerkle ¶
type IncrementalMerkle struct { NodeCount uint64 `json:"node_count"` ActiveNodes []Checksum256 `json:"active_nodes"` }
IncrementalMerkle incremental tree From github.com/eosspark/eos-go, change checksum type to Checksum256
func (*IncrementalMerkle) Append ¶
func (m *IncrementalMerkle) Append(digest Checksum256) Checksum256
Append Add a node to the incremental tree and recalculate the _active_nodes so they are prepared for the next append.
func (IncrementalMerkle) GetRoot ¶
func (m IncrementalMerkle) GetRoot() Checksum256
GetRoot return the current root of the incremental merkle
type MerkleRoot ¶
type PendingSchedule ¶
type PendingSchedule struct { ScheduleLIBNum uint32 `json:"schedule_lib_num"` ScheduleHash eos.HexBytes `json:"schedule_hash"` Schedule *ProducerSchedule `json:"schedule"` }
type ProducerSchedule ¶
type ProducerSchedule = eos.ProducerSchedule
ProducerSchedule eos ProducerSchedule type
type PublicKey ¶
PublicKey ecc.PublicKey
func MustNewPublicKey ¶
MustNewPublicKey call ecc MustNewPublicKey
type ScheduleProducersDatas ¶
type ScheduleProducersDatas struct {
// contains filtered or unexported fields
}
ScheduleProducersDatas all schedule producers datas by version
func (*ScheduleProducersDatas) GetScheduleProducer ¶
func (s *ScheduleProducersDatas) GetScheduleProducer(version uint32, name AccountName) (ProducerKey, error)
GetScheduleProducer get producer by version and account name
func (*ScheduleProducersDatas) GetScheduleProducersHash ¶
func (s *ScheduleProducersDatas) GetScheduleProducersHash() Checksum256
GetScheduleProducersHash get schedule producers hash for check
func (*ScheduleProducersDatas) Init ¶
func (s *ScheduleProducersDatas) Init(genesis *Genesis)
Init init producers in chain boot
func (*ScheduleProducersDatas) OnBlock ¶
func (s *ScheduleProducersDatas) OnBlock(msg *SignedBlock) error
OnBlock on block to update datas
type SignedBlock ¶
type SignedBlock = eos.SignedBlock
SignedBlock Signed block in chain, for a light node, all block will be signed from others
type TransactionMsg ¶
type TransactionMsg struct { BlockNum uint32 BlockID Checksum256 Timestamp time.Time Trx Transaction }
TransactionMsg msg when a transaction is committed to the chain
type TrxMsgHandler ¶
type TrxMsgHandler func(act *TransactionMsg)
TrxMsgHandler trx msg handler func type