3

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 thing that I found is LocalStorage but it requires a Database and the only thing that implements that trait is in-memory database which means its not persistent storage

1 Answer 1

1

You can use use sp_io::offchain_index; it is a persistent storage.

Check the example here:

https://github.com/paritytech/substrate/blob/22cca143a2c8e4a03ae770d71e94329eb518cca8/frame/merkle-mountain-range/src/mmr/storage.rs#L180-L197

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.