Hello everyone,
I was wondering if it is possible to have the same node that was initialized for the first time. For example, IPFS daemon is always consistent with the same node. I want to have the same functionality using Helia.
Thanks in advance
Hello everyone,
I was wondering if it is possible to have the same node that was initialized for the first time. For example, IPFS daemon is always consistent with the same node. I want to have the same functionality using Helia.
Thanks in advance
By default, Helia is instantiated with a Memory Datastore (where the key pair and PeerID are stored) and Memory Blockstore (where blocks are stored):
The memory data store does not persist anything across reloads.
In the browser, you can do that by instantiating Helia with the IndexedDB-data/block store:
import { createHelia } from 'helia'
import { IDBDatastore } from 'datastore-idb'
const store = new IDBDatastore('helia-data')
const helia = await createHelia({ datastore: store })