Class MemoryStore
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Inheritance
Namespace: Libplanet.Store
Assembly: Libplanet.Store.dll
Syntax
public sealed class MemoryStore : object, IStore
Methods
| Improve this Doc View SourceContainsCommittedEvidence(EvidenceId)
Determines whether the IStore contains EvidenceBase
the specified evidenceId
as committed.
Declaration
public bool ContainsCommittedEvidence(EvidenceId evidenceId)
Parameters
Type | Name | Description |
---|---|---|
EvidenceId | evidenceId | The EvidenceId of the EvidenceBase to check if it is in the IStore and committed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the IStore contains EvidenceBase
with the specified |
ContainsPendingEvidence(EvidenceId)
Determines whether the IStore contains EvidenceBase
the specified evidenceId
as pending.
Declaration
public bool ContainsPendingEvidence(EvidenceId evidenceId)
Parameters
Type | Name | Description |
---|---|---|
EvidenceId | evidenceId | The EvidenceId of the EvidenceBase to check if it is in the IStore and pending. |
Returns
Type | Description |
---|---|
System.Boolean | true if the IStore contains EvidenceBase
with the specified |
DeleteBlockCommit(BlockHash)
Deletes a BlockCommit of given height from store.
Declaration
public void DeleteBlockCommit(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash | The BlockHash of a BlockCommit to delete. |
DeleteCommittedEvidence(EvidenceId)
Deletes a committed EvidenceBase of given evidenceId
from the store.
Declaration
public void DeleteCommittedEvidence(EvidenceId evidenceId)
Parameters
Type | Name | Description |
---|---|---|
EvidenceId | evidenceId | The EvidenceId of a committed EvidenceBase to delete. |
DeletePendingEvidence(EvidenceId)
Deletes a pending EvidenceBase of given evidenceId
from the store.
Declaration
public void DeletePendingEvidence(EvidenceId evidenceId)
Parameters
Type | Name | Description |
---|---|---|
EvidenceId | evidenceId | The EvidenceId of a pending EvidenceBase to delete. |
ForkBlockIndexes(Guid, Guid, BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
public void ForkBlockIndexes(Guid sourceChainId, Guid destinationChainId, BlockHash branchpoint)
Parameters
Type | Name | Description |
---|---|---|
Guid | sourceChainId | |
Guid | destinationChainId | |
BlockHash | branchpoint |
GetBlockCommit(BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
public BlockCommit GetBlockCommit(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash |
Returns
Type | Description |
---|---|
BlockCommit |
GetBlockCommitHashes()
Gets every BlockHashes of BlockCommits from store.
Declaration
public IEnumerable<BlockHash> GetBlockCommitHashes()
Returns
Type | Description |
---|---|
IEnumerable<BlockHash> | Returns an |
GetChainBlockCommit(Guid)
Gets a BlockCommit associated with a chainId
as its
Declaration
public BlockCommit GetChainBlockCommit(Guid chainId)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | The |
Returns
Type | Description |
---|---|
BlockCommit | Returns BlockCommit if given |
GetCommittedEvidence(EvidenceId)
Gets every committed EvidenceBase of given evidenceId
from the store.
Declaration
public EvidenceBase GetCommittedEvidence(EvidenceId evidenceId)
Parameters
Type | Name | Description |
---|---|---|
EvidenceId | evidenceId | The EvidenceId of a committed EvidenceBase to retrieve. |
Returns
Type | Description |
---|---|
EvidenceBase | Returns EvidenceBase if given |
GetPendingEvidence(EvidenceId)
Gets every pending EvidenceBase of given evidenceId
from the store.
Declaration
public EvidenceBase GetPendingEvidence(EvidenceId evidenceId)
Parameters
Type | Name | Description |
---|---|---|
EvidenceId | evidenceId | The EvidenceId of a pending EvidenceBase to retrieve. |
Returns
Type | Description |
---|---|
EvidenceBase | Returns EvidenceBase if given |
IteratePendingEvidenceIds()
Gets every EvidenceIds of pending EvidenceBases from the store.
Declaration
public IEnumerable<EvidenceId> IteratePendingEvidenceIds()
Returns
Type | Description |
---|---|
IEnumerable<EvidenceId> | Returns an |
PutBlockCommit(BlockCommit)
Puts a BlockCommit to the store.
Declaration
public void PutBlockCommit(BlockCommit blockCommit)
Parameters
Type | Name | Description |
---|---|---|
BlockCommit | blockCommit | A BlockCommit to store. |
PutChainBlockCommit(Guid, BlockCommit)
Puts a BlockCommit associated with a chainId
as its
Declaration
public void PutChainBlockCommit(Guid chainId, BlockCommit blockCommit)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | The |
BlockCommit | blockCommit | The BlockCommit to store. |
PutCommittedEvidence(EvidenceBase)
Puts a EvidenceBase to the store as committed evidence.
Declaration
public void PutCommittedEvidence(EvidenceBase evidence)
Parameters
Type | Name | Description |
---|---|---|
EvidenceBase | evidence | A committed EvidenceBase to store. |
PutPendingEvidence(EvidenceBase)
Puts a EvidenceBase to the store as pending evidence.
Declaration
public void PutPendingEvidence(EvidenceBase evidence)
Parameters
Type | Name | Description |
---|---|---|
EvidenceBase | evidence | A pending EvidenceBase to store. |
Explicit Interface Implementations
| Improve this Doc View SourceIStore.AppendIndex(Guid, BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
long IStore.AppendIndex(Guid chainId, BlockHash hash)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | |
BlockHash | hash |
Returns
Type | Description |
---|---|
System.Int64 |
IStore.ContainsBlock(BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
bool IStore.ContainsBlock(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash |
Returns
Type | Description |
---|---|
System.Boolean |
IStore.ContainsTransaction(TxId)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
bool IStore.ContainsTransaction(TxId txId)
Parameters
Type | Name | Description |
---|---|---|
TxId | txId |
Returns
Type | Description |
---|---|
System.Boolean |
IStore.CountBlocks()
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
long IStore.CountBlocks()
Returns
Type | Description |
---|---|
System.Int64 |
IStore.CountIndex(Guid)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
long IStore.CountIndex(Guid chainId)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId |
Returns
Type | Description |
---|---|
System.Int64 |
IStore.DeleteBlock(BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
bool IStore.DeleteBlock(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash |
Returns
Type | Description |
---|---|
System.Boolean |
IStore.DeleteChainId(Guid)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.DeleteChainId(Guid chainId)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId |
IStore.DeleteTxIdBlockHashIndex(TxId, BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.DeleteTxIdBlockHashIndex(TxId txId, BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
TxId | txId | |
BlockHash | blockHash |
IStore.ForkTxNonces(Guid, Guid)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.ForkTxNonces(Guid sourceChainId, Guid destinationChainId)
Parameters
Type | Name | Description |
---|---|---|
Guid | sourceChainId | |
Guid | destinationChainId |
IStore.GetBlock(BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
Block IStore.GetBlock(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash |
Returns
Type | Description |
---|---|
Block |
IStore.GetBlockDigest(BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
BlockDigest? IStore.GetBlockDigest(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash |
Returns
Type | Description |
---|---|
System.Nullable<BlockDigest> |
IStore.GetBlockIndex(BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
long? IStore.GetBlockIndex(BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash |
Returns
Type | Description |
---|---|
System.Nullable<System.Int64> |
IStore.GetCanonicalChainId()
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
Guid? IStore.GetCanonicalChainId()
Returns
Type | Description |
---|---|
System.Nullable<Guid> |
IStore.GetFirstTxIdBlockHashIndex(TxId)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
BlockHash? IStore.GetFirstTxIdBlockHashIndex(TxId txId)
Parameters
Type | Name | Description |
---|---|---|
TxId | txId |
Returns
Type | Description |
---|---|
System.Nullable<BlockHash> |
IStore.GetTransaction(TxId)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
Transaction IStore.GetTransaction(TxId txid)
Parameters
Type | Name | Description |
---|---|---|
TxId | txid |
Returns
Type | Description |
---|---|
Transaction |
IStore.GetTxExecution(BlockHash, TxId)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
TxExecution IStore.GetTxExecution(BlockHash blockHash, TxId txid)
Parameters
Type | Name | Description |
---|---|---|
BlockHash | blockHash | |
TxId | txid |
Returns
Type | Description |
---|---|
TxExecution |
IStore.GetTxNonce(Guid, Address)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
long IStore.GetTxNonce(Guid chainId, Address address)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | |
Address | address |
Returns
Type | Description |
---|---|
System.Int64 |
IStore.IncreaseTxNonce(Guid, Address, Int64)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.IncreaseTxNonce(Guid chainId, Address signer, long delta)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | |
Address | signer | |
System.Int64 | delta |
IStore.IndexBlockHash(Guid, Int64)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
BlockHash? IStore.IndexBlockHash(Guid chainId, long index)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | |
System.Int64 | index |
Returns
Type | Description |
---|---|
System.Nullable<BlockHash> |
IStore.IterateBlockHashes()
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
IEnumerable<BlockHash> IStore.IterateBlockHashes()
Returns
Type | Description |
---|---|
IEnumerable<BlockHash> |
IStore.IterateIndexes(Guid, Int32, Nullable<Int32>)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
IEnumerable<BlockHash> IStore.IterateIndexes(Guid chainId, int offset, int? limit)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId | |
System.Int32 | offset | |
System.Nullable<System.Int32> | limit |
Returns
Type | Description |
---|---|
IEnumerable<BlockHash> |
IStore.IterateTxIdBlockHashIndex(TxId)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
IEnumerable<BlockHash> IStore.IterateTxIdBlockHashIndex(TxId txId)
Parameters
Type | Name | Description |
---|---|---|
TxId | txId |
Returns
Type | Description |
---|---|
IEnumerable<BlockHash> |
IStore.ListChainIds()
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
IEnumerable<Guid> IStore.ListChainIds()
Returns
Type | Description |
---|---|
IEnumerable<Guid> |
IStore.ListTxNonces(Guid)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
IEnumerable<KeyValuePair<Address, long>> IStore.ListTxNonces(Guid chainId)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId |
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<Address, System.Int64>> |
IStore.PruneOutdatedChains(Boolean)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.PruneOutdatedChains(bool noopWithoutCanon)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | noopWithoutCanon |
IStore.PutBlock(Block)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.PutBlock(Block block)
Parameters
Type | Name | Description |
---|---|---|
Block | block |
IStore.PutTransaction(Transaction)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.PutTransaction(Transaction tx)
Parameters
Type | Name | Description |
---|---|---|
Transaction | tx |
IStore.PutTxExecution(TxExecution)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.PutTxExecution(TxExecution txExecution)
Parameters
Type | Name | Description |
---|---|---|
TxExecution | txExecution |
IStore.PutTxIdBlockHashIndex(TxId, BlockHash)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.PutTxIdBlockHashIndex(TxId txId, BlockHash blockHash)
Parameters
Type | Name | Description |
---|---|---|
TxId | txId | |
BlockHash | blockHash |
IStore.SetCanonicalChainId(Guid)
Volatile in-memory store.
It is useful for storing temporal small chains, e.g., fixtures for unit tests of game logic.
MemoryStore and MemoryKeyValueStore-backed
TrieStateStore can be instantiated from a URI with memory:
scheme
using LoadStore(Uri), e.g.:
memory:
Declaration
void IStore.SetCanonicalChainId(Guid chainId)
Parameters
Type | Name | Description |
---|---|---|
Guid | chainId |