openRemoteDrive
@totemsdk/pear / openRemoteDrive
Function: openRemoteDrive()
openRemoteDrive(
pearTopicKey,options?):Promise<BareHyperdriveAdapter&object>
Open a remote Hyperdrive identified by its 64-hex pearTopicKey.
Steps:
- Creates a Corestore for local block caching.
- Creates a Hyperswarm and joins the topic derived from
pearTopicKey. - Plumbs each swarm connection into Corestore's replication stream.
- Opens a Hyperdrive seeded with the public key derived from
pearTopicKey. - Waits for the drive to become
ready(blocks are fetched from peers).
Parameters
pearTopicKey
string
— 64-hex public key of the Hyperdrive's root Hypercore
options?
RemoteDriveOptions = {}
— optional storage path + connect timeout overrides
Returns
Promise<BareHyperdriveAdapter & object>