storage

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROLLBACK_MAX_BLOCKS = 2000
	RECORD_SIZE         = crypto.SignatureSize + 8
)

Variables

View Source
var Empty struct{}

Functions

This section is empty.

Types

type AccountsStorage

type AccountsStorage struct {
	// contains filtered or unexported fields
}

func NewAccountsStorage

func NewAccountsStorage(globalStor, addr2Index, asset2Index keyvalue.IterableKeyVal, blockIdsFile string) (*AccountsStorage, error)

func (*AccountsStorage) AccountBalance

func (s *AccountsStorage) AccountBalance(addr proto.Address, asset []byte) (uint64, error)

func (*AccountsStorage) RollbackBlock

func (s *AccountsStorage) RollbackBlock(blockID crypto.Signature) error

func (*AccountsStorage) SetAccountBalance

func (s *AccountsStorage) SetAccountBalance(addr proto.Address, asset []byte, balance uint64, blockID crypto.Signature) error

func (*AccountsStorage) WavesAddressesNumber

func (s *AccountsStorage) WavesAddressesNumber() (uint64, error)

type BlockReadWriter

type BlockReadWriter struct {
	// contains filtered or unexported fields
}

func NewBlockReadWriter

func NewBlockReadWriter(dir string, offsetLen, headerOffsetLen int, keyVal keyvalue.KeyValue) (*BlockReadWriter, error)

func (*BlockReadWriter) BlockIDByHeight

func (rw *BlockReadWriter) BlockIDByHeight(height uint64) (crypto.Signature, error)

func (*BlockReadWriter) BlockIdsFilePath

func (rw *BlockReadWriter) BlockIdsFilePath() (string, error)

func (*BlockReadWriter) Close

func (rw *BlockReadWriter) Close() error

func (*BlockReadWriter) CurrentHeight

func (rw *BlockReadWriter) CurrentHeight() uint64

func (*BlockReadWriter) FinishBlock

func (rw *BlockReadWriter) FinishBlock(blockID crypto.Signature) error

func (*BlockReadWriter) HeightByBlockID

func (rw *BlockReadWriter) HeightByBlockID(blockID crypto.Signature) (uint64, error)

func (*BlockReadWriter) ReadBlockHeader

func (rw *BlockReadWriter) ReadBlockHeader(blockID crypto.Signature) ([]byte, error)

func (*BlockReadWriter) ReadTransaction

func (rw *BlockReadWriter) ReadTransaction(txID []byte) ([]byte, error)

func (*BlockReadWriter) ReadTransactionsBlock

func (rw *BlockReadWriter) ReadTransactionsBlock(blockID crypto.Signature) ([]byte, error)

func (*BlockReadWriter) RemoveBlocks

func (rw *BlockReadWriter) RemoveBlocks(removalEdge crypto.Signature) error

func (*BlockReadWriter) StartBlock

func (rw *BlockReadWriter) StartBlock(blockID crypto.Signature) error

func (*BlockReadWriter) WriteBlockHeader

func (rw *BlockReadWriter) WriteBlockHeader(blockID crypto.Signature, header []byte) error

func (*BlockReadWriter) WriteTransaction

func (rw *BlockReadWriter) WriteTransaction(txID []byte, tx []byte) error

Jump to

Keyboard shortcuts

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