Documentation ¶
Index ¶
- Constants
- func CalculateScore(baseTarget uint64) (*big.Int, error)
- func IsNotFound(err error) bool
- func IsTxCommitmentError(err error) bool
- func ReadMainnetBlocksToHeight(height proto.Height) ([]*proto.Block, error)
- type ErrorType
- type NonThreadSafeState
- type State
- type StateError
- type StateInfo
- type StateModifier
- type StateParams
- type StorageParams
- type ThreadSafeReadWrapper
- func (a *ThreadSafeReadWrapper) AccountBalance(account proto.Recipient, asset []byte) (uint64, error)
- func (a *ThreadSafeReadWrapper) ActivationHeight(featureID int16) (proto.Height, error)
- func (a *ThreadSafeReadWrapper) AddrByAlias(alias proto.Alias) (proto.Address, error)
- func (a *ThreadSafeReadWrapper) AllFeatures() ([]int16, error)
- func (a *ThreadSafeReadWrapper) ApprovalHeight(featureID int16) (proto.Height, error)
- func (a *ThreadSafeReadWrapper) AssetInfo(assetID crypto.Digest) (*proto.AssetInfo, error)
- func (a *ThreadSafeReadWrapper) AssetIsSponsored(assetID crypto.Digest) (bool, error)
- func (a *ThreadSafeReadWrapper) Block(blockID proto.BlockID) (*proto.Block, error)
- func (a *ThreadSafeReadWrapper) BlockByHeight(height proto.Height) (*proto.Block, error)
- func (a *ThreadSafeReadWrapper) BlockIDToHeight(blockID proto.BlockID) (proto.Height, error)
- func (a *ThreadSafeReadWrapper) BlockchainSettings() (*settings.BlockchainSettings, error)
- func (a *ThreadSafeReadWrapper) CurrentScore() (*big.Int, error)
- func (a *ThreadSafeReadWrapper) EffectiveBalance(account proto.Recipient, startHeight, endHeight proto.Height) (uint64, error)
- func (a *ThreadSafeReadWrapper) EstimatorVersion() (int, error)
- func (a *ThreadSafeReadWrapper) FullAssetInfo(assetID crypto.Digest) (*proto.FullAssetInfo, error)
- func (a *ThreadSafeReadWrapper) FullWavesBalance(account proto.Recipient) (*proto.FullWavesBalance, error)
- func (a *ThreadSafeReadWrapper) Header(blockID proto.BlockID) (*proto.BlockHeader, error)
- func (a *ThreadSafeReadWrapper) HeaderByHeight(height proto.Height) (*proto.BlockHeader, error)
- func (a *ThreadSafeReadWrapper) Height() (proto.Height, error)
- func (a *ThreadSafeReadWrapper) HeightToBlockID(height proto.Height) (proto.BlockID, error)
- func (a *ThreadSafeReadWrapper) HitSourceAtHeight(height proto.Height) ([]byte, error)
- func (a *ThreadSafeReadWrapper) InvokeResultByID(invokeID crypto.Digest) (*proto.ScriptResult, error)
- func (a *ThreadSafeReadWrapper) IsActivated(featureID int16) (bool, error)
- func (a *ThreadSafeReadWrapper) IsActiveAtHeight(featureID int16, height proto.Height) (bool, error)
- func (a *ThreadSafeReadWrapper) IsActiveLeasing(leaseID crypto.Digest) (bool, error)
- func (a *ThreadSafeReadWrapper) IsApproved(featureID int16) (bool, error)
- func (a *ThreadSafeReadWrapper) IsApprovedAtHeight(featureID int16, height proto.Height) (bool, error)
- func (a *ThreadSafeReadWrapper) MapR(f func(StateInfo) (interface{}, error)) (interface{}, error)
- func (a *ThreadSafeReadWrapper) NFTList(account proto.Recipient, limit uint64, afterAssetID []byte) ([]*proto.FullAssetInfo, error)
- func (a *ThreadSafeReadWrapper) NewAddrTransactionsIterator(addr proto.Address) (TransactionIterator, error)
- func (a *ThreadSafeReadWrapper) Peers() ([]proto.TCPAddr, error)
- func (a *ThreadSafeReadWrapper) ProvidesExtendedApi() (bool, error)
- func (a *ThreadSafeReadWrapper) ProvidesStateHashes() (bool, error)
- func (a *ThreadSafeReadWrapper) RetrieveBinaryEntry(account proto.Recipient, key string) (*proto.BinaryDataEntry, error)
- func (a *ThreadSafeReadWrapper) RetrieveBooleanEntry(account proto.Recipient, key string) (*proto.BooleanDataEntry, error)
- func (a *ThreadSafeReadWrapper) RetrieveEntries(account proto.Recipient) ([]proto.DataEntry, error)
- func (a *ThreadSafeReadWrapper) RetrieveEntry(account proto.Recipient, key string) (proto.DataEntry, error)
- func (a *ThreadSafeReadWrapper) RetrieveIntegerEntry(account proto.Recipient, key string) (*proto.IntegerDataEntry, error)
- func (a *ThreadSafeReadWrapper) RetrieveStringEntry(account proto.Recipient, key string) (*proto.StringDataEntry, error)
- func (a *ThreadSafeReadWrapper) ScoreAtHeight(height proto.Height) (*big.Int, error)
- func (a *ThreadSafeReadWrapper) ScriptInfoByAccount(account proto.Recipient) (*proto.ScriptInfo, error)
- func (a *ThreadSafeReadWrapper) ScriptInfoByAsset(assetID crypto.Digest) (*proto.ScriptInfo, error)
- func (a *ThreadSafeReadWrapper) ShouldPersistAddressTransactions() (bool, error)
- func (a *ThreadSafeReadWrapper) StateHashAtHeight(height uint64) (*proto.StateHash, error)
- func (a *ThreadSafeReadWrapper) TopBlock() *proto.Block
- func (a *ThreadSafeReadWrapper) TransactionByID(id []byte) (proto.Transaction, error)
- func (a *ThreadSafeReadWrapper) TransactionByIDWithStatus(id []byte) (proto.Transaction, bool, error)
- func (a *ThreadSafeReadWrapper) TransactionHeightByID(id []byte) (uint64, error)
- func (a *ThreadSafeReadWrapper) VotesNum(featureID int16) (uint64, error)
- func (a *ThreadSafeReadWrapper) VotesNumAtHeight(featureID int16, height proto.Height) (uint64, error)
- func (a *ThreadSafeReadWrapper) WavesAddressesNumber() (uint64, error)
- type ThreadSafeState
- type ThreadSafeWriteWrapper
- func (a *ThreadSafeWriteWrapper) AddBlock(block []byte) (*proto.Block, error)
- func (a *ThreadSafeWriteWrapper) AddDeserializedBlock(block *proto.Block) (*proto.Block, error)
- func (a *ThreadSafeWriteWrapper) AddNewBlocks(blocks [][]byte) error
- func (a *ThreadSafeWriteWrapper) AddNewDeserializedBlocks(blocks []*proto.Block) (*proto.Block, error)
- func (a *ThreadSafeWriteWrapper) AddOldBlocks(blocks [][]byte) error
- func (a *ThreadSafeWriteWrapper) AddOldDeserializedBlocks(blocks []*proto.Block) error
- func (a *ThreadSafeWriteWrapper) Close() error
- func (a *ThreadSafeWriteWrapper) Map(f func(state NonThreadSafeState) error) error
- func (a *ThreadSafeWriteWrapper) PersistAddressTransactions() error
- func (a *ThreadSafeWriteWrapper) ResetValidationList()
- func (a *ThreadSafeWriteWrapper) RollbackTo(removalEdge proto.BlockID) error
- func (a *ThreadSafeWriteWrapper) RollbackToHeight(height proto.Height) error
- func (a *ThreadSafeWriteWrapper) SavePeers(peers []proto.TCPAddr) error
- func (a *ThreadSafeWriteWrapper) StartProvidingExtendedApi() error
- func (a *ThreadSafeWriteWrapper) TxValidation(f func(validation TxValidation) error) error
- func (a *ThreadSafeWriteWrapper) ValidateNextTx(tx proto.Transaction, currentTimestamp uint64, parentTimestamp uint64, ...) error
- type TransactionIterator
- type TxValidation
- type ValidationParams
Constants ¶
const ( // Default values. // Cache parameters. // 500 MiB. DefaultCacheSize = 500 * 1024 * 1024 // Bloom filter parameters. // Number of elements in Bloom Filter. DefaultBloomFilterSize = 2e8 // Acceptable false positive for Bloom Filter (0.01%). DefaultBloomFilterFalsePositiveProbability = 0.0001 // Db parameters. DefaultWriteBuffer = 32 * 1024 * 1024 DefaultCompactionTableSize = 8 * 1024 * 1024 DefaultCompactionTotalSize = 10 * 1024 * 1024 // Block storage parameters. // DefaultOffsetLen is the amount of bytes needed to store offset of transactions in blockchain file. DefaultOffsetLen = 8 // DefaultHeaderOffsetLen is the amount of bytes needed to store offset of headers in headers file. DefaultHeaderOffsetLen = 8 // StateVersion is current version of state internal storage formats. // It increases when backward compatibility with previous storage version is lost. StateVersion = 7 // Memory limit for address transactions. flush() is called when this // limit is exceeded. AddressTransactionsMemLimit = 50 * 1024 * 1024 // Number of keys per flush() call. AddressTransactionsMaxKeys = 4000 // Maximum size of transactions by addresses file. // Then it is sorted and saved to DB. MaxAddressTransactionsFileSize = 2 * 1024 * 1024 * 1024 // 2 GiB. )
const ( KiB = 1024 MiB = 1024 * KiB )
const (
FeeUnit = 100000
)
const KnownPeerKeyLength = proto.IpPortLength + 1
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶ added in v0.3.0
func IsTxCommitmentError ¶ added in v0.8.0
Types ¶
type ErrorType ¶ added in v0.3.0
type ErrorType byte
const ( // Unmarshal error (for example, of block or transaction). DeserializationError ErrorType = iota + 1 NotFoundError SerializationError TxValidationError TxCommitmentError ValidationError RollbackError // Errors occurring while getting data from database. RetrievalError // Errors occurring while updating/modifying state data. ModificationError InvalidInputError IncompatibilityError // DB or block storage Close() error. ClosureError // Minor technical errors which shouldn't ever happen. Other )
type NonThreadSafeState ¶ added in v0.6.0
type NonThreadSafeState = State
type State ¶
type State interface { StateInfo StateModifier }
func NewState ¶ added in v0.3.0
func NewState(dataDir string, params StateParams, settings *settings.BlockchainSettings) (State, error)
NewState() creates State. dataDir is path to directory to store all data, it's also possible to provide folder with existing data, and state will try to sync and use it in this case. params are state parameters (see below). settings are blockchain settings (settings.MainNetSettings, settings.TestNetSettings or custom settings).
type StateError ¶ added in v0.3.0
type StateError struct {
// contains filtered or unexported fields
}
func NewStateError ¶ added in v0.3.0
func NewStateError(errorType ErrorType, originalError error) StateError
func (StateError) Error ¶ added in v0.3.0
func (err StateError) Error() string
func (StateError) Type ¶ added in v0.8.0
func (err StateError) Type() ErrorType
type StateInfo ¶ added in v0.5.0
type StateInfo interface { // Block getters. TopBlock() *proto.Block Block(blockID proto.BlockID) (*proto.Block, error) BlockByHeight(height proto.Height) (*proto.Block, error) // Header getters. Header(blockID proto.BlockID) (*proto.BlockHeader, error) HeaderByHeight(height proto.Height) (*proto.BlockHeader, error) // Height returns current blockchain height. Height() (proto.Height, error) // Height <---> blockID converters. BlockIDToHeight(blockID proto.BlockID) (proto.Height, error) HeightToBlockID(height proto.Height) (proto.BlockID, error) // FullWavesBalance returns complete Waves balance record. FullWavesBalance(account proto.Recipient) (*proto.FullWavesBalance, error) EffectiveBalance(account proto.Recipient, startHeight, endHeight proto.Height) (uint64, error) // AccountBalance retrieves balance of account in specific currency, asset is asset's ID. // nil asset = Waves. AccountBalance(account proto.Recipient, asset []byte) (uint64, error) // WavesAddressesNumber returns total number of Waves addresses in state. // It is extremely slow, so it is recommended to only use for testing purposes. WavesAddressesNumber() (uint64, error) // Get cumulative blocks score at given height. ScoreAtHeight(height proto.Height) (*big.Int, error) // Get current blockchain score (at top height). CurrentScore() (*big.Int, error) // Retrieve current blockchain settings. BlockchainSettings() (*settings.BlockchainSettings, error) Peers() ([]proto.TCPAddr, error) // Features. VotesNum(featureID int16) (uint64, error) VotesNumAtHeight(featureID int16, height proto.Height) (uint64, error) IsActivated(featureID int16) (bool, error) IsActiveAtHeight(featureID int16, height proto.Height) (bool, error) ActivationHeight(featureID int16) (proto.Height, error) IsApproved(featureID int16) (bool, error) IsApprovedAtHeight(featureID int16, height proto.Height) (bool, error) ApprovalHeight(featureID int16) (proto.Height, error) AllFeatures() ([]int16, error) EstimatorVersion() (int, error) // Aliases. AddrByAlias(alias proto.Alias) (proto.Address, error) // Accounts data storage. RetrieveEntries(account proto.Recipient) ([]proto.DataEntry, error) RetrieveEntry(account proto.Recipient, key string) (proto.DataEntry, error) RetrieveIntegerEntry(account proto.Recipient, key string) (*proto.IntegerDataEntry, error) RetrieveBooleanEntry(account proto.Recipient, key string) (*proto.BooleanDataEntry, error) RetrieveStringEntry(account proto.Recipient, key string) (*proto.StringDataEntry, error) RetrieveBinaryEntry(account proto.Recipient, key string) (*proto.BinaryDataEntry, error) // Transactions. TransactionByID(id []byte) (proto.Transaction, error) TransactionByIDWithStatus(id []byte) (proto.Transaction, bool, error) TransactionHeightByID(id []byte) (uint64, error) // NewAddrTransactionsIterator() returns iterator to iterate all transactions that affected // given address. // Iterator will move in range from most recent to oldest transactions. NewAddrTransactionsIterator(addr proto.Address) (TransactionIterator, error) // Asset fee sponsorship. AssetIsSponsored(assetID crypto.Digest) (bool, error) AssetInfo(assetID crypto.Digest) (*proto.AssetInfo, error) FullAssetInfo(assetID crypto.Digest) (*proto.FullAssetInfo, error) NFTList(account proto.Recipient, limit uint64, afterAssetID []byte) ([]*proto.FullAssetInfo, error) // Script information. ScriptInfoByAccount(account proto.Recipient) (*proto.ScriptInfo, error) ScriptInfoByAsset(assetID crypto.Digest) (*proto.ScriptInfo, error) // Leases. IsActiveLeasing(leaseID crypto.Digest) (bool, error) // Invoke results. InvokeResultByID(invokeID crypto.Digest) (*proto.ScriptResult, error) // True if state stores additional information in order to provide extended API. ProvidesExtendedApi() (bool, error) // True if state stores and calculates state hashes for each block height. ProvidesStateHashes() (bool, error) // State hashes. StateHashAtHeight(height uint64) (*proto.StateHash, error) // Map on readable state. Way to apply multiple operations under same lock. MapR(func(StateInfo) (interface{}, error)) (interface{}, error) // HitSourceAtHeight reads hit source stored in state. HitSourceAtHeight(height proto.Height) ([]byte, error) // ShouldPersisAddressTransactions checks if PersisAddressTransactions // should be called. ShouldPersistAddressTransactions() (bool, error) }
StateInfo returns information that corresponds to latest fully applied block. This should be used for APIs and other modules where stable, fully verified state is needed. Methods of this interface are thread-safe.
type StateModifier ¶ added in v0.3.0
type StateModifier interface { // AddBlock adds single block to state. // It's not recommended to use this function when you are able to accumulate big blocks batch, // since it's much more efficient to add many blocks at once. AddBlock(block []byte) (*proto.Block, error) AddDeserializedBlock(block *proto.Block) (*proto.Block, error) // AddNewBlocks adds batch of new blocks to state. // Use it when blocks are logically new. AddNewBlocks(blocks [][]byte) error // AddNewDeserializedBlocks marshals blocks to binary and calls AddNewBlocks(). AddNewDeserializedBlocks(blocks []*proto.Block) (*proto.Block, error) // AddOldBlocks adds batch of old blocks to state. // Use it when importing historical blockchain. // It is faster than AddNewBlocks but it is only safe when importing from scratch when no rollbacks are possible at all. AddOldBlocks(blocks [][]byte) error // AddOldDeserializedBlocks marshals blocks to binary and calls AddOldBlocks(). AddOldDeserializedBlocks(blocks []*proto.Block) error // Rollback functionality. RollbackToHeight(height proto.Height) error RollbackTo(removalEdge proto.BlockID) error // ------------------------- // Validation functionality (for UTX). // ------------------------- // ValidateNextTx() validates transaction against state, taking into account all the previous changes from transactions // that were added using ValidateNextTx() until you call ResetValidationList(). // Returns TxCommitmentError or other state error or nil. // When TxCommitmentError is returned, state MUST BE cleared using ResetValidationList(). ValidateNextTx(tx proto.Transaction, currentTimestamp, parentTimestamp uint64, blockVersion proto.BlockVersion, acceptFailed bool) error // ResetValidationList() resets the validation list, so you can ValidateNextTx() from scratch after calling it. ResetValidationList() // Func internally calls ResetValidationList. TxValidation(func(validation TxValidation) error) error // Way to call multiple operations under same lock. Map(func(state NonThreadSafeState) error) error // Create or replace Peers. SavePeers([]proto.TCPAddr) error // State will provide extended API data after returning. StartProvidingExtendedApi() error // PersisAddressTransactions sorts and saves transactions to storage. PersistAddressTransactions() error Close() error }
StateModifier contains all the methods needed to modify node's state. Methods of this interface are not thread-safe.
func NewThreadSafeWriteWrapper ¶ added in v0.6.0
func NewThreadSafeWriteWrapper(i *int32, mu *sync.RWMutex, s State) StateModifier
type StateParams ¶ added in v0.3.0
type StateParams struct { StorageParams ValidationParams // When StoreExtendedApiData is true, state builds additional data required for API. StoreExtendedApiData bool // ProvideExtendedApi specifies whether state must provide data for extended API. ProvideExtendedApi bool // BuildStateHashes enables building and storing state hashes by height. BuildStateHashes bool }
func DefaultStateParams ¶ added in v0.3.0
func DefaultStateParams() StateParams
func DefaultTestingStateParams ¶ added in v0.3.0
func DefaultTestingStateParams() StateParams
type StorageParams ¶ added in v0.3.0
type StorageParams struct { OffsetLen int HeaderOffsetLen int DbParams keyvalue.KeyValParams }
func DefaultStorageParams ¶ added in v0.3.0
func DefaultStorageParams() StorageParams
func DefaultTestingStorageParams ¶ added in v0.3.0
func DefaultTestingStorageParams() StorageParams
type ThreadSafeReadWrapper ¶ added in v0.6.0
type ThreadSafeReadWrapper struct {
// contains filtered or unexported fields
}
func (*ThreadSafeReadWrapper) AccountBalance ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) ActivationHeight ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) ActivationHeight(featureID int16) (proto.Height, error)
func (*ThreadSafeReadWrapper) AddrByAlias ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) AllFeatures ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) AllFeatures() ([]int16, error)
func (*ThreadSafeReadWrapper) ApprovalHeight ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) ApprovalHeight(featureID int16) (proto.Height, error)
func (*ThreadSafeReadWrapper) AssetIsSponsored ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) AssetIsSponsored(assetID crypto.Digest) (bool, error)
func (*ThreadSafeReadWrapper) BlockByHeight ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) BlockIDToHeight ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) BlockchainSettings ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) BlockchainSettings() (*settings.BlockchainSettings, error)
func (*ThreadSafeReadWrapper) CurrentScore ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) CurrentScore() (*big.Int, error)
func (*ThreadSafeReadWrapper) EffectiveBalance ¶ added in v0.8.0
func (*ThreadSafeReadWrapper) EstimatorVersion ¶ added in v0.8.0
func (a *ThreadSafeReadWrapper) EstimatorVersion() (int, error)
func (*ThreadSafeReadWrapper) FullAssetInfo ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) FullAssetInfo(assetID crypto.Digest) (*proto.FullAssetInfo, error)
func (*ThreadSafeReadWrapper) FullWavesBalance ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) FullWavesBalance(account proto.Recipient) (*proto.FullWavesBalance, error)
func (*ThreadSafeReadWrapper) Header ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) Header(blockID proto.BlockID) (*proto.BlockHeader, error)
func (*ThreadSafeReadWrapper) HeaderByHeight ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) HeaderByHeight(height proto.Height) (*proto.BlockHeader, error)
func (*ThreadSafeReadWrapper) Height ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) Height() (proto.Height, error)
func (*ThreadSafeReadWrapper) HeightToBlockID ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) HitSourceAtHeight ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) HitSourceAtHeight(height proto.Height) ([]byte, error)
func (*ThreadSafeReadWrapper) InvokeResultByID ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) InvokeResultByID(invokeID crypto.Digest) (*proto.ScriptResult, error)
func (*ThreadSafeReadWrapper) IsActivated ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) IsActivated(featureID int16) (bool, error)
func (*ThreadSafeReadWrapper) IsActiveAtHeight ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) IsActiveLeasing ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) IsActiveLeasing(leaseID crypto.Digest) (bool, error)
func (*ThreadSafeReadWrapper) IsApproved ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) IsApproved(featureID int16) (bool, error)
func (*ThreadSafeReadWrapper) IsApprovedAtHeight ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) MapR ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) MapR(f func(StateInfo) (interface{}, error)) (interface{}, error)
func (*ThreadSafeReadWrapper) NFTList ¶ added in v0.8.0
func (a *ThreadSafeReadWrapper) NFTList(account proto.Recipient, limit uint64, afterAssetID []byte) ([]*proto.FullAssetInfo, error)
func (*ThreadSafeReadWrapper) NewAddrTransactionsIterator ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) NewAddrTransactionsIterator(addr proto.Address) (TransactionIterator, error)
func (*ThreadSafeReadWrapper) Peers ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) Peers() ([]proto.TCPAddr, error)
func (*ThreadSafeReadWrapper) ProvidesExtendedApi ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) ProvidesExtendedApi() (bool, error)
func (*ThreadSafeReadWrapper) ProvidesStateHashes ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) ProvidesStateHashes() (bool, error)
func (*ThreadSafeReadWrapper) RetrieveBinaryEntry ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) RetrieveBinaryEntry(account proto.Recipient, key string) (*proto.BinaryDataEntry, error)
func (*ThreadSafeReadWrapper) RetrieveBooleanEntry ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) RetrieveBooleanEntry(account proto.Recipient, key string) (*proto.BooleanDataEntry, error)
func (*ThreadSafeReadWrapper) RetrieveEntries ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) RetrieveEntry ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) RetrieveIntegerEntry ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) RetrieveIntegerEntry(account proto.Recipient, key string) (*proto.IntegerDataEntry, error)
func (*ThreadSafeReadWrapper) RetrieveStringEntry ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) RetrieveStringEntry(account proto.Recipient, key string) (*proto.StringDataEntry, error)
func (*ThreadSafeReadWrapper) ScoreAtHeight ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) ScriptInfoByAccount ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) ScriptInfoByAccount(account proto.Recipient) (*proto.ScriptInfo, error)
func (*ThreadSafeReadWrapper) ScriptInfoByAsset ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) ScriptInfoByAsset(assetID crypto.Digest) (*proto.ScriptInfo, error)
func (*ThreadSafeReadWrapper) ShouldPersistAddressTransactions ¶ added in v0.7.0
func (a *ThreadSafeReadWrapper) ShouldPersistAddressTransactions() (bool, error)
func (*ThreadSafeReadWrapper) StateHashAtHeight ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) StateHashAtHeight(height uint64) (*proto.StateHash, error)
func (*ThreadSafeReadWrapper) TopBlock ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) TopBlock() *proto.Block
func (*ThreadSafeReadWrapper) TransactionByID ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) TransactionByID(id []byte) (proto.Transaction, error)
func (*ThreadSafeReadWrapper) TransactionByIDWithStatus ¶ added in v0.7.0
func (a *ThreadSafeReadWrapper) TransactionByIDWithStatus(id []byte) (proto.Transaction, bool, error)
func (*ThreadSafeReadWrapper) TransactionHeightByID ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) TransactionHeightByID(id []byte) (uint64, error)
func (*ThreadSafeReadWrapper) VotesNum ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) VotesNum(featureID int16) (uint64, error)
func (*ThreadSafeReadWrapper) VotesNumAtHeight ¶ added in v0.6.0
func (*ThreadSafeReadWrapper) WavesAddressesNumber ¶ added in v0.6.0
func (a *ThreadSafeReadWrapper) WavesAddressesNumber() (uint64, error)
type ThreadSafeState ¶ added in v0.6.0
type ThreadSafeState struct { StateInfo StateModifier }
func NewThreadSafeState ¶ added in v0.6.0
func NewThreadSafeState(s State) *ThreadSafeState
type ThreadSafeWriteWrapper ¶ added in v0.6.0
type ThreadSafeWriteWrapper struct {
// contains filtered or unexported fields
}
func (*ThreadSafeWriteWrapper) AddBlock ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) AddBlock(block []byte) (*proto.Block, error)
func (*ThreadSafeWriteWrapper) AddDeserializedBlock ¶ added in v0.6.0
func (*ThreadSafeWriteWrapper) AddNewBlocks ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) AddNewBlocks(blocks [][]byte) error
func (*ThreadSafeWriteWrapper) AddNewDeserializedBlocks ¶ added in v0.6.0
func (*ThreadSafeWriteWrapper) AddOldBlocks ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) AddOldBlocks(blocks [][]byte) error
func (*ThreadSafeWriteWrapper) AddOldDeserializedBlocks ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) AddOldDeserializedBlocks(blocks []*proto.Block) error
func (*ThreadSafeWriteWrapper) Close ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) Close() error
func (*ThreadSafeWriteWrapper) Map ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) Map(f func(state NonThreadSafeState) error) error
func (*ThreadSafeWriteWrapper) PersistAddressTransactions ¶ added in v0.7.0
func (a *ThreadSafeWriteWrapper) PersistAddressTransactions() error
func (*ThreadSafeWriteWrapper) ResetValidationList ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) ResetValidationList()
func (*ThreadSafeWriteWrapper) RollbackTo ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) RollbackTo(removalEdge proto.BlockID) error
func (*ThreadSafeWriteWrapper) RollbackToHeight ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) RollbackToHeight(height proto.Height) error
func (*ThreadSafeWriteWrapper) SavePeers ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) SavePeers(peers []proto.TCPAddr) error
func (*ThreadSafeWriteWrapper) StartProvidingExtendedApi ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) StartProvidingExtendedApi() error
func (*ThreadSafeWriteWrapper) TxValidation ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) TxValidation(f func(validation TxValidation) error) error
func (*ThreadSafeWriteWrapper) ValidateNextTx ¶ added in v0.6.0
func (a *ThreadSafeWriteWrapper) ValidateNextTx( tx proto.Transaction, currentTimestamp uint64, parentTimestamp uint64, blockVersion proto.BlockVersion, checkScripts bool, ) error
type TransactionIterator ¶ added in v0.5.0
type TransactionIterator interface { Transaction() (proto.Transaction, bool, error) Next() bool Release() Error() error }
TransactionIterator can be used to iterate through transactions of given address. One instance is only valid for iterating once. Transaction() returns current transaction. Next() moves iterator to next position, it must be called first time at the beginning. Release() must be called after using iterator. Error() should return nil if iterating was successful.
type TxValidation ¶ added in v0.6.0
type TxValidation interface {
ValidateNextTx(tx proto.Transaction, currentTimestamp, parentTimestamp uint64, blockVersion proto.BlockVersion, acceptFailed bool) error
}
type ValidationParams ¶ added in v0.3.0
ValidationParams are validation parameters. VerificationGoroutinesNum specifies how many goroutines will be run for verification of transactions and blocks signatures.
Source Files ¶
- accounts_data_storage.go
- address_transactions.go
- aliases.go
- api.go
- appender.go
- assets.go
- balances.go
- batched_storage.go
- block_differ.go
- blockreadwriter.go
- blocksinfo.go
- constants.go
- database.go
- diff_applier.go
- diff_storage.go
- errors.go
- features.go
- fee_validation.go
- history_formatter.go
- history_storage.go
- hit_sources.go
- internal_constants.go
- invoke_applier.go
- invoke_results.go
- keys.go
- known_peer.go
- leases.go
- local_history_storage.go
- monetary_policy.go
- orders_volume.go
- peer_storage.go
- score.go
- script_caller.go
- scripts_cache.go
- scripts_complexity.go
- scripts_storage.go
- settings_validator.go
- sponsored_assets.go
- state.go
- state_hasher.go
- state_hashes.go
- test_util.go
- threadsafe_wrapper.go
- transaction_checker.go
- transaction_differ.go
- transaction_fee_counter.go
- transaction_handler.go
- transaction_performer.go
- verifier.go