Documentation ¶
Index ¶
- Variables
- type Blockchain
- func (b *Blockchain) AccountOperationsForEach(number uint32, offset uint32, limit uint32, ...) error
- func (this *Blockchain) AddAlternateChain(blocks []safebox.SerializedBlock) error
- func (this *Blockchain) BlockOperationsForEach(index uint32, fn func(meta *tx.TxMetadata, tx tx.CommonOperation) bool) error
- func (this *Blockchain) ExportSafebox() []byte
- func (this *Blockchain) GetAccount(number uint32) *accounter.Account
- func (b *Blockchain) GetAccountsByPublicKey(public *crypto.Public) []uint32
- func (this *Blockchain) GetBlock(index uint32) (safebox.BlockBase, error)
- func (this *Blockchain) GetBlockPow(block safebox.BlockBase) []byte
- func (b *Blockchain) GetBlockTemplate(miner *crypto.Public, payload []byte, time *uint32, nonce uint32) (block safebox.BlockBase, template []byte, reservedOffset int, err error)
- func (this *Blockchain) GetHashrate(blockIndex, blocksCount uint32) uint64
- func (this *Blockchain) GetHeight() uint32
- func (this *Blockchain) GetOperation(txRipemd160Hash [20]byte) (*tx.TxMetadata, tx.CommonOperation, error)
- func (this *Blockchain) GetState() (height uint32, safeboxHash []byte, cumulativeDifficulty *big.Int)
- func (b *Blockchain) GetTopBlock() (safebox.BlockBase, error)
- func (b *Blockchain) GetTxPool() map[tx.CommonOperation]tx.TxMetadata
- func (this *Blockchain) LoadNearestSnapshot(targetHeight uint32) (*accounter.Accounter, error)
- func (this *Blockchain) LoadSnapshot(height uint32) (*accounter.Accounter, error)
- func (b *Blockchain) ProcessNewBlock(block safebox.SerializedBlock, broadcast bool) error
- func (b *Blockchain) ProcessNewBlocks(blocks []safebox.SerializedBlock, preSave *func(safebox.SafeboxBase) error) error
- func (this *Blockchain) SerializeBlock(block safebox.BlockBase) safebox.SerializedBlock
- func (this *Blockchain) SerializeBlockHeader(block safebox.BlockBase, willAppendOperations bool, nullPow bool) safebox.SerializedBlockHeader
- func (b *Blockchain) TxPoolAddOperation(transaction tx.CommonOperation, broadcast bool) (new bool, err error)
- func (b *Blockchain) UnmarshalHashingBlob(blob []byte) (miner *crypto.Public, nonce uint32, timestamp uint32, payload []byte, ...)
- type NewSafeboxCallback
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain struct { BlocksUpdates chan safebox.SerializedBlock TxPoolUpdates chan tx.CommonOperation // contains filtered or unexported fields }
func NewBlockchain ¶
func NewBlockchain(fn NewSafeboxCallback, s storage.Storage, height *uint32) (*Blockchain, error)
func (*Blockchain) AccountOperationsForEach ¶
func (b *Blockchain) AccountOperationsForEach(number uint32, offset uint32, limit uint32, fn func(operationId uint32, meta *tx.TxMetadata, tx tx.CommonOperation) bool) error
func (*Blockchain) AddAlternateChain ¶
func (this *Blockchain) AddAlternateChain(blocks []safebox.SerializedBlock) error
func (*Blockchain) BlockOperationsForEach ¶
func (this *Blockchain) BlockOperationsForEach(index uint32, fn func(meta *tx.TxMetadata, tx tx.CommonOperation) bool) error
func (*Blockchain) ExportSafebox ¶
func (this *Blockchain) ExportSafebox() []byte
func (*Blockchain) GetAccount ¶
func (this *Blockchain) GetAccount(number uint32) *accounter.Account
func (*Blockchain) GetAccountsByPublicKey ¶
func (b *Blockchain) GetAccountsByPublicKey(public *crypto.Public) []uint32
func (*Blockchain) GetBlock ¶
func (this *Blockchain) GetBlock(index uint32) (safebox.BlockBase, error)
func (*Blockchain) GetBlockPow ¶
func (this *Blockchain) GetBlockPow(block safebox.BlockBase) []byte
func (*Blockchain) GetBlockTemplate ¶
func (*Blockchain) GetHashrate ¶
func (this *Blockchain) GetHashrate(blockIndex, blocksCount uint32) uint64
func (*Blockchain) GetHeight ¶
func (this *Blockchain) GetHeight() uint32
func (*Blockchain) GetOperation ¶
func (this *Blockchain) GetOperation(txRipemd160Hash [20]byte) (*tx.TxMetadata, tx.CommonOperation, error)
func (*Blockchain) GetState ¶
func (this *Blockchain) GetState() (height uint32, safeboxHash []byte, cumulativeDifficulty *big.Int)
func (*Blockchain) GetTopBlock ¶
func (b *Blockchain) GetTopBlock() (safebox.BlockBase, error)
func (*Blockchain) GetTxPool ¶
func (b *Blockchain) GetTxPool() map[tx.CommonOperation]tx.TxMetadata
func (*Blockchain) LoadNearestSnapshot ¶
func (this *Blockchain) LoadNearestSnapshot(targetHeight uint32) (*accounter.Accounter, error)
func (*Blockchain) LoadSnapshot ¶
func (this *Blockchain) LoadSnapshot(height uint32) (*accounter.Accounter, error)
func (*Blockchain) ProcessNewBlock ¶
func (b *Blockchain) ProcessNewBlock(block safebox.SerializedBlock, broadcast bool) error
func (*Blockchain) ProcessNewBlocks ¶
func (b *Blockchain) ProcessNewBlocks(blocks []safebox.SerializedBlock, preSave *func(safebox.SafeboxBase) error) error
func (*Blockchain) SerializeBlock ¶
func (this *Blockchain) SerializeBlock(block safebox.BlockBase) safebox.SerializedBlock
func (*Blockchain) SerializeBlockHeader ¶
func (this *Blockchain) SerializeBlockHeader(block safebox.BlockBase, willAppendOperations bool, nullPow bool) safebox.SerializedBlockHeader
func (*Blockchain) TxPoolAddOperation ¶
func (b *Blockchain) TxPoolAddOperation(transaction tx.CommonOperation, broadcast bool) (new bool, err error)
func (*Blockchain) UnmarshalHashingBlob ¶
type NewSafeboxCallback ¶
type NewSafeboxCallback func(accounter *accounter.Accounter) safebox.SafeboxBase
Click to show internal directories.
Click to hide internal directories.