ICBucket
ICBucketv1.0
Overview
  • Introduction
  • Quick Start
  • Installation
Guides
  • Configuration
  • Authentication
  • Basic Usage
  • Best Practices
API Reference
  • API Overview
  • API Endpoints
  • API Requests
  • API Responses
Errors
  • Error Codes
  • Error Handling
  • Troubleshooting
Deployment
  • Local Development
  • Production Deployment
Reference
  • Configuration Reference
  • Types Reference
  • Changelog
FAQ
  • Frequently Asked Questions
PricingGitLabNew bucket
  1. ICBucket
  2. Deployment
  3. Local Development

Local Development

Run and test ICBucket integrations locally using dfx replica simulation and mock storage actors.

Local Development

Test your ICBucket storage integrations in local development environments without spending real ICP or burning mainnet cycles.

Prerequisites#

  • DFINITY SDK (dfx) installed on macOS / Linux / WSL.
  • Local replica running via dfx start --background.

Steps#

1. Point the SDK to Local Replica#

Set the environment variables to point to your local replica:

NEXT_PUBLIC_IC_HOST=http://127.0.0.1:4943
ICBUCKET_CANISTER_ID=bkyz2-fmaaa-aaaaa-qaaaq-cai
ICBUCKET_CDN_BASE=http://localhost:3000

2. Fetch Root Key in Development#

When communicating with local replicas, instruct @dfinity/agent to fetch the root key:

import { HttpAgent } from "@dfinity/agent"

const agent = new HttpAgent({ host: "http://127.0.0.1:4943" })
if (process.env.NODE_ENV !== "production") {
  await agent.fetchRootKey()
}

Verification#

Upload a test text file and inspect local canister state:

dfx canister call icbucket listFiles '(record { page = 1; pageSize = 10 })'

Related Pages#

  • Production Deployment
  • Configuration Reference
  • Troubleshooting
PreviousTroubleshootingNextProduction Deployment
Edit this page on GitLabUpdated recently

On this page

PrerequisitesSteps1. Point the SDK to Local Replica2. Fetch Root Key in DevelopmentVerificationRelated Pages

Search documentation

Quickly find guides, APIs, and reference docs