Get started
Quickstart
Store and share your first file on Portaldot, from the Drive, the SDK or the terminal.
Before you start
- Install a Polkadot wallet extension: Talisman, SubWallet or polkadot{.js}.
- Create an account. Portaldot uses generic Substrate addresses (SS58 prefix 42), which start with a 5.
- 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
- Open Drive and connect your wallet.
- Drop a file, or choose Folder to upload a directory or a built website.
- Review the cost. Blocks Portaldot already holds are listed separately and not charged again.
- Approve one transaction. PotDrive stores every block, verifies the result from the chain, and returns unspent tPOT.
- 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 returnedUse 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