Show / Hide Table of Contents

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:
  • memory://?secure=true (trie keys are hashed)
Inheritance
Object
MemoryStore
Implements
IStore
IDisposable
Namespace: Libplanet.Store
Assembly: Libplanet.dll
Syntax
public sealed class MemoryStore : object, IStore, IDisposable

Methods

| Improve this Doc View Source

ForkBlockIndexes(Guid, Guid, BlockHash)

Declaration
public void ForkBlockIndexes(Guid sourceChainId, Guid destinationChainId, BlockHash branchpoint)
Parameters
Type Name Description
Guid sourceChainId
Guid destinationChainId
BlockHash branchpoint

Explicit Interface Implementations

| Improve this Doc View Source

IStore.AppendIndex(Guid, BlockHash)

Declaration
long IStore.AppendIndex(Guid chainId, BlockHash hash)
Parameters
Type Name Description
Guid chainId
BlockHash hash
Returns
Type Description
Int64
| Improve this Doc View Source

IStore.ContainsBlock(BlockHash)

Declaration
bool IStore.ContainsBlock(BlockHash blockHash)
Parameters
Type Name Description
BlockHash blockHash
Returns
Type Description
Boolean
| Improve this Doc View Source

IStore.ContainsTransaction(TxId)

Declaration
bool IStore.ContainsTransaction(TxId txId)
Parameters
Type Name Description
TxId txId
Returns
Type Description
Boolean
| Improve this Doc View Source

IStore.CountBlocks()

Declaration
long IStore.CountBlocks()
Returns
Type Description
Int64
| Improve this Doc View Source

IStore.CountIndex(Guid)

Declaration
long IStore.CountIndex(Guid chainId)
Parameters
Type Name Description
Guid chainId
Returns
Type Description
Int64
| Improve this Doc View Source

IStore.CountTransactions()

Declaration
long IStore.CountTransactions()
Returns
Type Description
Int64
| Improve this Doc View Source

IStore.DeleteBlock(BlockHash)

Declaration
bool IStore.DeleteBlock(BlockHash blockHash)
Parameters
Type Name Description
BlockHash blockHash
Returns
Type Description
Boolean
| Improve this Doc View Source

IStore.DeleteChainId(Guid)

Declaration
void IStore.DeleteChainId(Guid chainId)
Parameters
Type Name Description
Guid chainId
| Improve this Doc View Source

IStore.DeleteTransaction(TxId)

Declaration
bool IStore.DeleteTransaction(TxId txid)
Parameters
Type Name Description
TxId txid
Returns
Type Description
Boolean
| Improve this Doc View Source

IStore.DeleteTxIdBlockHashIndex(TxId, BlockHash)

Declaration
void IStore.DeleteTxIdBlockHashIndex(TxId txId, BlockHash blockHash)
Parameters
Type Name Description
TxId txId
BlockHash blockHash
| Improve this Doc View Source

IStore.ForkTxNonces(Guid, Guid)

Declaration
void IStore.ForkTxNonces(Guid sourceChainId, Guid destinationChainId)
Parameters
Type Name Description
Guid sourceChainId
Guid destinationChainId
| Improve this Doc View Source

IStore.GetBlock<T>(HashAlgorithmGetter, BlockHash)

Declaration
Block<T> IStore.GetBlock<T>(HashAlgorithmGetter hashAlgorithmGetter, BlockHash blockHash)
    where T : IAction, new()
Parameters
Type Name Description
HashAlgorithmGetter hashAlgorithmGetter
BlockHash blockHash
Returns
Type Description
Block<T>
Type Parameters
Name Description
T
| Improve this Doc View Source

IStore.GetBlockDigest(BlockHash)

Declaration
BlockDigest? IStore.GetBlockDigest(BlockHash blockHash)
Parameters
Type Name Description
BlockHash blockHash
Returns
Type Description
Nullable<BlockDigest>
| Improve this Doc View Source

IStore.GetBlockIndex(BlockHash)

Declaration
long? IStore.GetBlockIndex(BlockHash blockHash)
Parameters
Type Name Description
BlockHash blockHash
Returns
Type Description
Nullable<Int64>
| Improve this Doc View Source

IStore.GetBlockPerceivedTime(BlockHash)

Declaration
DateTimeOffset? IStore.GetBlockPerceivedTime(BlockHash blockHash)
Parameters
Type Name Description
BlockHash blockHash
Returns
Type Description
Nullable<DateTimeOffset>
| Improve this Doc View Source

IStore.GetCanonicalChainId()

Declaration
Guid? IStore.GetCanonicalChainId()
Returns
Type Description
Nullable<Guid>
| Improve this Doc View Source

IStore.GetFirstTxIdBlockHashIndex(TxId)

Declaration
BlockHash? IStore.GetFirstTxIdBlockHashIndex(TxId txId)
Parameters
Type Name Description
TxId txId
Returns
Type Description
Nullable<BlockHash>
| Improve this Doc View Source

IStore.GetTransaction<T>(TxId)

Declaration
Transaction<T> IStore.GetTransaction<T>(TxId txid)
    where T : IAction, new()
Parameters
Type Name Description
TxId txid
Returns
Type Description
Transaction<T>
Type Parameters
Name Description
T
| Improve this Doc View Source

IStore.GetTxExecution(BlockHash, TxId)

Declaration
TxExecution IStore.GetTxExecution(BlockHash blockHash, TxId txid)
Parameters
Type Name Description
BlockHash blockHash
TxId txid
Returns
Type Description
TxExecution
| Improve this Doc View Source

IStore.GetTxNonce(Guid, Address)

Declaration
long IStore.GetTxNonce(Guid chainId, Address address)
Parameters
Type Name Description
Guid chainId
Address address
Returns
Type Description
Int64
| Improve this Doc View Source

IStore.IncreaseTxNonce(Guid, Address, Int64)

Declaration
void IStore.IncreaseTxNonce(Guid chainId, Address signer, long delta)
Parameters
Type Name Description
Guid chainId
Address signer
Int64 delta
| Improve this Doc View Source

IStore.IndexBlockHash(Guid, Int64)

Declaration
BlockHash? IStore.IndexBlockHash(Guid chainId, long index)
Parameters
Type Name Description
Guid chainId
Int64 index
Returns
Type Description
Nullable<BlockHash>
| Improve this Doc View Source

IStore.IterateBlockHashes()

Declaration
IEnumerable<BlockHash> IStore.IterateBlockHashes()
Returns
Type Description
IEnumerable<BlockHash>
| Improve this Doc View Source

IStore.IterateIndexes(Guid, Int32, Nullable<Int32>)

Declaration
IEnumerable<BlockHash> IStore.IterateIndexes(Guid chainId, int offset, int? limit)
Parameters
Type Name Description
Guid chainId
Int32 offset
Nullable<Int32> limit
Returns
Type Description
IEnumerable<BlockHash>
| Improve this Doc View Source

IStore.IterateTransactionIds()

Declaration
IEnumerable<TxId> IStore.IterateTransactionIds()
Returns
Type Description
IEnumerable<TxId>
| Improve this Doc View Source

IStore.IterateTxIdBlockHashIndex(TxId)

Declaration
IEnumerable<BlockHash> IStore.IterateTxIdBlockHashIndex(TxId txId)
Parameters
Type Name Description
TxId txId
Returns
Type Description
IEnumerable<BlockHash>
| Improve this Doc View Source

IStore.ListChainIds()

Declaration
IEnumerable<Guid> IStore.ListChainIds()
Returns
Type Description
IEnumerable<Guid>
| Improve this Doc View Source

IStore.ListTxNonces(Guid)

Declaration
IEnumerable<KeyValuePair<Address, long>> IStore.ListTxNonces(Guid chainId)
Parameters
Type Name Description
Guid chainId
Returns
Type Description
IEnumerable<KeyValuePair<Address, Int64>>
| Improve this Doc View Source

IStore.PruneOutdatedChains(Boolean)

Declaration
void IStore.PruneOutdatedChains(bool noopWithoutCanon)
Parameters
Type Name Description
Boolean noopWithoutCanon
| Improve this Doc View Source

IStore.PutBlock<T>(Block<T>)

Declaration
void IStore.PutBlock<T>(Block<T> block)
    where T : IAction, new()
Parameters
Type Name Description
Block<T> block
Type Parameters
Name Description
T
| Improve this Doc View Source

IStore.PutTransaction<T>(Transaction<T>)

Declaration
void IStore.PutTransaction<T>(Transaction<T> tx)
    where T : IAction, new()
Parameters
Type Name Description
Transaction<T> tx
Type Parameters
Name Description
T
| Improve this Doc View Source

IStore.PutTxExecution(TxFailure)

Declaration
void IStore.PutTxExecution(TxFailure txFailure)
Parameters
Type Name Description
TxFailure txFailure
| Improve this Doc View Source

IStore.PutTxExecution(TxSuccess)

Declaration
void IStore.PutTxExecution(TxSuccess txSuccess)
Parameters
Type Name Description
TxSuccess txSuccess
| Improve this Doc View Source

IStore.PutTxIdBlockHashIndex(TxId, BlockHash)

Declaration
void IStore.PutTxIdBlockHashIndex(TxId txId, BlockHash blockHash)
Parameters
Type Name Description
TxId txId
BlockHash blockHash
| Improve this Doc View Source

IStore.SetBlockPerceivedTime(BlockHash, DateTimeOffset)

Declaration
void IStore.SetBlockPerceivedTime(BlockHash blockHash, DateTimeOffset perceivedTime)
Parameters
Type Name Description
BlockHash blockHash
DateTimeOffset perceivedTime
| Improve this Doc View Source

IStore.SetCanonicalChainId(Guid)

Declaration
void IStore.SetCanonicalChainId(Guid chainId)
Parameters
Type Name Description
Guid chainId

Implements

IStore
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2022 Planetarium