Kagome
Polkadot Runtime Engine in C++17
kagome::offchain::OffchainPersistentStorage Class Reference

It is non-revertible and not fork-aware. It means that any value set by the offchain worker is persisted even if that block (at which the worker is called) is reverted as non-canonical (meaning that the block was surpassed by a longer chain). The value is available for the worker that is re-run at the new (different block with the same block number) and future blocks. This storage can be used by offchain workers to handle forks and coordinate offchain workers running on different forks. More...

#include <offchain_persistent_storage.hpp>

Inheritance diagram for kagome::offchain::OffchainPersistentStorage:
Collaboration diagram for kagome::offchain::OffchainPersistentStorage:

Additional Inherited Members

- Public Member Functions inherited from kagome::offchain::OffchainStorage
virtual ~OffchainStorage ()=default
 
virtual outcome::result< void > set (const common::BufferView &key, common::Buffer value)=0
 Sets a value in the storage. More...
 
virtual outcome::result< void > clear (const common::BufferView &key)=0
 Remove a value from the local storage. More...
 
virtual outcome::result< bool > compare_and_set (const common::BufferView &key, const std::optional< common::BufferView > &expected, common::Buffer value)=0
 Sets a new value in the local storage if the condition matches the current value. More...
 
virtual outcome::result< common::Bufferget (const common::BufferView &key)=0
 Gets a value from the local storage. More...
 

Detailed Description

It is non-revertible and not fork-aware. It means that any value set by the offchain worker is persisted even if that block (at which the worker is called) is reverted as non-canonical (meaning that the block was surpassed by a longer chain). The value is available for the worker that is re-run at the new (different block with the same block number) and future blocks. This storage can be used by offchain workers to handle forks and coordinate offchain workers running on different forks.

Persistent storage

Definition at line 23 of file offchain_persistent_storage.hpp.


The documentation for this class was generated from the following file: