PotDrive
Open Drive

Get started

Quickstart

Store and share your first file on Portaldot, from the Drive, the SDK or the terminal.

Before you start

  1. Install a Polkadot wallet extension: Talisman, SubWallet or polkadot{.js}.
  2. Create an account. Portaldot uses generic Substrate addresses (SS58 prefix 42), which start with a 5.
  3. Get test POT. During the Hacker House, the Portaldot team sends tPOT to the native address you register on DoraHacks; otherwise open a ticket in the Portaldot Discord.

Use the Drive

  1. Open Drive and connect your wallet.
  2. Drop a file, or choose Folder to upload a directory or a built website.
  3. Review the cost. Blocks Portaldot already holds are listed separately and not charged again.
  4. Approve one transaction. PotDrive stores every block, verifies the result from the chain, and returns unspent tPOT.
  5. Share the link. Readers verify every block in their own browser.

Use the SDK

The SDK lives in sdk/src of the repository and runs in browsers, Bun, Node and serverless functions.

store.ts
import { connect, prepareFile, uploadFile, shareUrl } from "@potdrive/sdk";

const api = await connect();                         // wss://test-node-v3.portaldot.dev
const file = await prepareFile(bytes, { name: "deck.pdf", mime: "application/pdf" });

const result = await uploadFile({
  api,
  file,
  owner: { address, signer },                        // injected signer or a KeyringPair
  onEvent: (e) => console.log(e.type),
});

console.log(shareUrl("https://potdrive.anshverma.tech", result));

Read it back

read.ts
import { getFile } from "@potdrive/sdk";

const bytes = await getFile("bafykbzace…");          // every block re-hashed before it is returned

Use the CLI

Terminal
git clone https://github.com/Anshv784/potdrive && cd potdrive && bun install
export POTDRIVE_SEED="your twelve words …"

bun cli/potdrive.ts put ./deck.pdf          # store a file, print its link
bun cli/potdrive.ts deploy ./dist           # store a whole site, print its URL
bun cli/potdrive.ts get <cid> -o deck.pdf   # fetch and verify

Edit this page on GitHub