Documentation ¶
Index ¶
- Constants
- Variables
- func FormatFromBlock(blk module.Block) (*V2HeaderFormat, *V2BodyFormat, error)
- func GetBTPDigestFromResult(dbase db.Database, c codec.Codec, result []byte) (module.BTPDigest, error)
- func GetBlockHeaderHashByHeight(dbase db.Database, c codec.Codec, height int64) ([]byte, error)
- func GetBlockResultByHeight(dbase db.Database, c codec.Codec, height int64) ([]byte, error)
- func GetBlockVersion(dbase db.Database, c codec.Codec, height int64) (int, error)
- func GetCommitVoteListBytesForHeight(dbase db.Database, c codec.Codec, height int64) ([]byte, error)
- func GetLastHeight(dbase db.Database) (int64, error)
- func GetLastHeightOf(dbase db.Database) int64
- func GetLastHeightWithCodec(dbase db.Database, c codec.Codec) (int64, error)
- func GetNextValidatorsByHeight(dbase db.Database, c codec.Codec, height int64) (module.ValidatorList, error)
- func NewBTPBlockHeader(height int64, round int32, nts module.NetworkTypeSection, nid int64, flag uint) (module.BTPBlockHeader, error)
- func NewBlockDataFactory(c module.Chain, handlers []base.BlockHandler) (module.BlockDataFactory, error)
- func NewBlockReaderFromFormat(hf *V2HeaderFormat, bf *V2BodyFormat) io.Reader
- func NewBlockV2Handler(chain base.Chain) base.BlockHandler
- func NewManager(chain module.Chain, timestamper module.Timestamper, ...) (module.BlockManager, error)
- func PeekVersion(r io.Reader) (int, io.Reader, error)
- func ReadVersion(r io.Reader) (int, error)
- func ResetDB(d db.Database, c codec.Codec, height int64) error
- func SetLastHeight(dbase db.Database, c codec.Codec, height int64) error
- func UnsafeFinalize(sm ServiceManager, c module.Chain, blk module.BlockData, ...) error
- func WriteTransactionLocators(dbase db.Database, height int64, ptl module.TransactionList, ...) error
- type Chain
- type RefCounter
- type RefTracer
- type ServiceManager
- type V2BodyFormat
- type V2HeaderFormat
Constants ¶
View Source
const (
ConfigCacheCap = 10
)
View Source
const (
ResultNotFinalizedError = errors.CodeBlock + iota
)
View Source
const V2String = "2.0"
Variables ¶
View Source
var (
ErrResultNotFinalized = errors.NewBase(ResultNotFinalizedError, "ResultNotFinalized")
)
Functions ¶
func FormatFromBlock ¶ added in v1.3.0
func FormatFromBlock(blk module.Block) (*V2HeaderFormat, *V2BodyFormat, error)
func GetBTPDigestFromResult ¶ added in v1.3.0
func GetBlockHeaderHashByHeight ¶ added in v1.1.1
func GetBlockResultByHeight ¶ added in v1.3.0
func GetBlockVersion ¶ added in v1.1.1
func GetCommitVoteListBytesForHeight ¶ added in v1.3.0
func GetLastHeightOf ¶
func GetLastHeightWithCodec ¶ added in v1.1.1
func GetNextValidatorsByHeight ¶ added in v1.3.0
func NewBTPBlockHeader ¶ added in v1.3.0
func NewBTPBlockHeader( height int64, round int32, nts module.NetworkTypeSection, nid int64, flag uint, ) (module.BTPBlockHeader, error)
NewBTPBlockHeader returns a new BTPBlockHeader for the height and nid. If flag's IncludeNextProofContext bit is on, the header includes NextProofContext.
func NewBlockDataFactory ¶ added in v1.2.11
func NewBlockDataFactory( c module.Chain, handlers []base.BlockHandler, ) (module.BlockDataFactory, error)
func NewBlockReaderFromFormat ¶ added in v1.3.0
func NewBlockReaderFromFormat(hf *V2HeaderFormat, bf *V2BodyFormat) io.Reader
func NewBlockV2Handler ¶ added in v0.9.6
func NewBlockV2Handler(chain base.Chain) base.BlockHandler
func NewManager ¶
func NewManager( chain module.Chain, timestamper module.Timestamper, handlers []base.BlockHandler, ) (module.BlockManager, error)
NewManager creates BlockManager.
func SetLastHeight ¶ added in v1.2.11
func UnsafeFinalize ¶ added in v1.2.11
func WriteTransactionLocators ¶ added in v0.9.7
func WriteTransactionLocators( dbase db.Database, height int64, ptl module.TransactionList, ntl module.TransactionList, ) error
Types ¶
type Chain ¶ added in v0.9.10
type Chain interface { Database() db.Database Wallet() module.Wallet ServiceManager() module.ServiceManager NID() int CID() int GenesisStorage() module.GenesisStorage CommitVoteSetDecoder() module.CommitVoteSetDecoder Genesis() []byte }
type RefCounter ¶
type RefCounter interface {
RefCount() int
}
type RefTracer ¶
func (*RefTracer) TraceDispose ¶
func (rt *RefTracer) TraceDispose(rc RefCounter)
func (*RefTracer) TraceNew ¶
func (rt *RefTracer) TraceNew(rc RefCounter)
func (*RefTracer) TraceRef ¶
func (rt *RefTracer) TraceRef(rc RefCounter)
func (*RefTracer) TraceUnref ¶
func (rt *RefTracer) TraceUnref(rc RefCounter)
type ServiceManager ¶ added in v0.9.10
type ServiceManager interface { module.TransitionManager TransactionFromBytes(b []byte, blockVersion int) (module.Transaction, error) GetChainID(result []byte) (int64, error) GetNetworkID(result []byte) (int64, error) GetNextBlockVersion(result []byte) int ImportResult(result []byte, vh []byte, src db.Database) error GenesisTransactionFromBytes(b []byte, blockVersion int) (module.Transaction, error) TransactionListFromHash(hash []byte) module.TransactionList ReceiptListFromResult(result []byte, g module.TransactionGroup) (module.ReceiptList, error) SendTransaction(result []byte, height int64, tx interface{}) ([]byte, error) ValidatorListFromHash(hash []byte) module.ValidatorList TransactionListFromSlice(txs []module.Transaction, version int) module.TransactionList SendTransactionAndWait(result []byte, height int64, tx interface{}) ([]byte, <-chan interface{}, error) WaitTransactionResult(id []byte) (<-chan interface{}, error) ExportResult(result []byte, vh []byte, dst db.Database) error BTPSectionFromResult(result []byte) (module.BTPSection, error) NextProofContextMapFromResult(result []byte) (module.BTPProofContextMap, error) }
type V2BodyFormat ¶ added in v1.3.0
type V2BodyFormat struct { PatchTransactions [][]byte NormalTransactions [][]byte Votes []byte BTPDigest []byte }
func (*V2BodyFormat) RLPDecodeSelf ¶ added in v1.3.0
func (bb *V2BodyFormat) RLPDecodeSelf(d codec.Decoder) error
func (*V2BodyFormat) RLPEncodeSelf ¶ added in v1.3.0
func (bb *V2BodyFormat) RLPEncodeSelf(e codec.Encoder) error
type V2HeaderFormat ¶ added in v1.3.0
type V2HeaderFormat struct { Version int Height int64 Timestamp int64 Proposer []byte PrevID []byte VotesHash []byte NextValidatorsHash []byte PatchTransactionsHash []byte NormalTransactionsHash []byte LogsBloom []byte Result []byte NSFilter []byte }
func (*V2HeaderFormat) RLPDecodeSelf ¶ added in v1.3.0
func (bh *V2HeaderFormat) RLPDecodeSelf(d codec.Decoder) error
func (*V2HeaderFormat) RLPEncodeSelf ¶ added in v1.3.0
func (bh *V2HeaderFormat) RLPEncodeSelf(e codec.Encoder) error
Click to show internal directories.
Click to hide internal directories.