Browse by type
An end-to-end TypeScript script that walks through the full DataHaven storage workflow against a running network and MSP backend.
This repo is designed to be used alongside the tutorial video and as a clean reference implementation for validating your setup when working with buckets, files, MSPs, and on-chain confirmations.
The script (src/index.ts) executes the full storage lifecycle:
This covers both sides of the system: - On-chain coordination (bucket creation, confirmations) - Off-chain data transfer (upload/download via MSP backend)
└── datahaven-project/
├── README.md
├── package.json
├── pnpm-workspace.yaml
├── tsconfig.json
├── .env.example
└── src/
├── index.ts
├── config/
│ └── networks.ts
├── operations/
│ ├── bucketOperations.ts
│ └── fileOperations.ts
└── services/
├── clientService.ts
└── mspService.ts
pnpm install
pnpm tsx src/index.ts
!!! note Bucket names must be unique. If you run the script multiple times against the same network and MSP, bucket creation will fail because bucket names must be unique.
The script is intentionally split into small, focused modules:
src/services/clientService.ts - Creates and manages wallet client, public client, StorageHub client, Polkadot API client.src/services/mspService.ts - Fetches MSP backend information and methods.src/operations/bucketOperations.ts - Handles bucket creation, on-chain verification, and backend readiness checks.src/operations/fileOperations.ts - Handles file upload, download, confirmation waits, and integrity verification.$ claude mcp add datahaven-end-to-end-storage-workflow \
-- python -m otcore.mcp_server <graph>