Skip to content

This starter-kit will be provided to data providers. This will be one thing they run to set their own Iroh node, basic UI and basic APis for their customers.

Notifications You must be signed in to change notification settings

dhiway/starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Starter Kit: Decentralized, Persistent Key-Value Document Store

Starter Kit is a developer-friendly framework for building decentralized, persistent, and cryptographically secure key-value document stores. Powered by Iroh, it provides robust primitives for blobs (raw data), docs (replicated key-value stores), and authors (identity and permissions), all with a simple API and persistent storage.


✨ Features

  • Decentralized Storage: Peer-to-peer, content-addressed storage for documents and blobs.
  • Persistent Data: All data is stored on disk; restart your node anytime with your secret key and data path.
  • Cryptographic Security: Access and authorship are managed by keypairs; only you can start your node with your secret key.
  • Flexible Data Model: Store any data as blobs, organize it in documents, and manage permissions with authors.
  • Extensible API: JSON-over-HTTP API for easy integration with your apps.
  • Frontend Ready: Comes with a React frontend for quick experimentation.

🏁 Getting Started

Prerequisites


1. Clone and Build

git clone https://github.com/dhiway/starter-kit
cd starter-kit
cargo build --release

2. Bootstrap Your Node

Step 1: Generate a Secret Key

Run:

cargo run

You’ll see output like:

🔑 Generated new secret key: 9478a79a60ade2312eb50b0cc6f54444e8b81e9f06fa5df0b8d0b8ff5b1f60ab
👉 Please run again with:
   cargo run -- --path your-path-of-choice --secret-key 9478a79a60ade2312eb50b0cc6f54444e8b81e9f06fa5df0b8d0b8ff5b1f60ab
Error: "Rerun with --path and --secret-key"

Important:

  • Never use a secret key from an example or from someone else.
  • Keep your secret key private and secure.
  • Anyone with your secret key can control your node and access your data.

You can repeat this step until you get a secret key you like (not usually necessary).

Step 2: Start Your Persistent Node

Pick a directory for your data (e.g., iroh-data) and run:

cargo run -- --path iroh-data --secret-key <your-secret-key>
  • The BLAKE3 hash of your secret key is stored in a secret-key file inside your data directory.
  • Security Note: Only someone with your secret key can start your node and access your data.

3. Access the API and Frontend


🗃️ Storage Model

  • Persistent: All blobs and documents are stored on disk. Restart your node with the same --path and --secret-key to resume where you left off.
  • Blobs: Store raw bytes, files, or any binary data.
  • Docs: Key-value stores (replicas) with optional JSON schema enforcement.
  • Authors: Manage multiple identities and permissions for document entries.

🧩 API Overview

The API exposes endpoints for:

  • Blobs: Add, get, list, download, export, tag, and delete blobs.
  • Docs: Create, list, share, join, drop, and manage documents.
  • Entries: Add, get, query, and delete key-value entries (with or without schema).
  • Authors: Create, list, set default, and verify authors.
  • Policies: Set and get download policies for documents.

See the API Documentation for full details and examples.


🛠️ Development

  • Run backend only:
    cargo run -- --path iroh-data --secret-key <your-secret-key>
  • Run frontend only:
    cd frontend
    npm install
    npm start

🧪 Running Tests

You can run the test suite using the following commands:

  • Run all tests sequentially with logs (recommended for debugging):
    cargo test -- --test-threads=1 --nocapture
  • Run all tests sequentially (recommended for CI and most use cases):
    cargo test -- --test-threads=1
  • Run tests from a specific file/module with logs:
    cargo test <docs|blobs|authors> -- --test-threads=1 --nocapture
    Replace <docs|blobs|authors> with the name of the module or test function you want to run. Remove --nocapture to run without logs.

🧑‍💻 Contributing

Contributions are welcome! Fork the repo, create a branch, and submit a pull request.


🔒 Security Model

  • Your node is protected by your secret key. The hash of this key is stored in your data directory; without the key, the node cannot be started.
  • Each document and entry is cryptographically signed and content-addressed.
  • Authors and namespaces are managed by keypairs for fine-grained access control.

📚 Learn More


📄 License

TBD


Starter Kit — Build decentralized, persistent, and secure document stores with ease.

About

This starter-kit will be provided to data providers. This will be one thing they run to set their own Iroh node, basic UI and basic APis for their customers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages