Questions tagged [offchain-storage]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
29 views

Fetching offchain storage value returns different value than the value fetched using localStorageGet function

I need to get the rpc_url value set initially from the explorer. The localStorageGet rpc function returns the correct value of the rpc_url. This returns https://eth-mainnet.g.alchemy.com/v2/MY_API_KEY ...
strider's user avatar
  • 11
2 votes
0 answers
15 views

Offchain Storage lock vs compare-set/mutate function

While using offchain workers when do we want to use a StorageLock and when would we want to use a mutate function on StorageValueRef since both of them are kind of lock on db.
Rusty Pythonic Script's user avatar
2 votes
1 answer
63 views

Is it possible to write-access Local Storage from the Node?

My use case is this: an Offchain Worker sends Http requests to certain endpoints. These endpoints are hardcoded on chain under current implementation. I would like to be able to configure those ...
Yury Yukhananov's user avatar
2 votes
0 answers
71 views

Offchain cache/view of on-chain storage data

I am implementing a pallet, that stores in on-chain storage (aka StorageNMap's) some user provided data. Pallet is performing offchain computations by iterating on-chain storage from offchain-worker ...
Klapeyron's user avatar
  • 101
3 votes
1 answer
45 views

How to store offchain mutable values

Are there offchain storage options in substrate? Like a regular mongodb- or mysql database, I don't want to use something else and just stick with something supported with substrate stack. The only ...
dadzerlaze's user avatar
  • 1,053
1 vote
1 answer
46 views

Configure OCW to run every x blocks or on demand

I understand that off-chain workers are spawned during block import, quote: Offchain workers are spawned during each block import. However, they aren't executed during initial blockchain ...
Ronin's user avatar
  • 155
0 votes
0 answers
65 views

offchain indexing for large files

I'm new to the project and currently working on a pallet, which is supposed to deal with large files offchain. Pallet, offchain indexing and the offchain worker are all working fine, still I get "...
langi667's user avatar
1 vote
2 answers
111 views

Native Substrate runtime support for storing data Offchain to IPFS

There appear to be 2 two substrate forks addressing offchain data storage with a IPFS backend: https://github.com/iridium-labs/substrate/tree/iris https://github.com/WunderbarNetwork/substrate/tree/...
Begley Brothers Inc's user avatar
0 votes
0 answers
29 views

Is there a way to create a peer to peer network on top of substrate?

Most of substrate tutorials are based on on-chain logic so there's not much information on this topic. Is there a way to use Substrate's in-built p2p network for other purposes such as constant ...
Kofi's user avatar
  • 141
1 vote
1 answer
80 views

Off-chain local storage map?

I have an off-chain worker that needs to write a HashMap<u64,Vec<u64>> to local storage. I can see how to write a single value using StorageValueRef and how I could possibly store a ...
Robert La Ferla's user avatar
0 votes
1 answer
35 views

Example for sp_runtime::offchain::storage::mutate()

I could not find any example code that shows how to call mutate() for offchain storage. Looking for an example. I could only find onchain examples. https://docs.rs/sp-runtime/latest/sp_runtime/...
Robert La Ferla's user avatar
3 votes
0 answers
46 views

What is transaction indexing in externalities useful for?

For example, there's a FRAME pallet called Remark which does one thing: it allows storing data in externalities that can access the node's storage via a runtime interface. If integrated into a runtime,...
Sacha Lansky's user avatar
  • 2,570
2 votes
1 answer
58 views

How can I access a backend instance from a host function?

As given in the title, I would like to get access to an instance of the backend from a host function. When I say 'backend instance' here, I'm referring to this. I hope to call its offchain_storage(), ...
Justin Frevert's user avatar
5 votes
0 answers
106 views

How to extend a `custom RPC` service to query the `off-chain` storage? [closed]

There are many docs/tutorials explaining how to extend the node's RPC service with a Custom RPC to query the Runtime storage. What I could not figure it out yet, is how to do the same but to query the ...
Pablo Buitrago's user avatar
9 votes
1 answer
53 views

Is there any way to get all the key/value pairs together from sc_client_db::offchain::LocalStorage?

I can see we have the option to get the values by using their keys one by one using get(), but is there any way to get all the pairs together wrapped in an iterator so that we don't need to hit the ...
Pawan Bisht's user avatar
6 votes
1 answer
131 views

How to extract data from Offchain storage in client-side?

I'm trying to access data that I'm storing through the RPC off-chain endpoint. Is there any way to get the instance of off-chain storage in service.rs through which we can extract that has been ...
Pawan Bisht's user avatar
2 votes
1 answer
57 views

How do you test offchain_index::set?

I have code that writes to offchain_index: offchain_index::set(&my_key, &my_data.encode()); However, my unit tests are unable to retrieve the data via: let my_offchain_data = StorageValueRef::...
Jeremy Frank's user avatar