Skip to content

Shivam-1M/midnight-dev

Repository files navigation

Midnight Development Workspace

This repository contains a collection of projects and tutorials for developing on the Midnight Network. It serves as a learning workspace for building privacy-preserving decentralized applications (dApps) using Compact contracts and TypeScript.

Projects

1. my-app (Hello World)

A simple introductory project demonstrating the basics of Midnight development.

  • Contract: hello-world.compact
  • Features:
    • Stateless message storage.
    • Basic public ledger interaction.
    • "Hello World" of Midnight.

2. bulletin-board

A more advanced dApp implementing a community bulletin board with state management and access control.

  • Contract: bulletin-board.compact
  • Features:
    • State Machine: Tracks board state (Vacant/Occupied).
    • Access Control: Only the poster can take down their message.
    • Witnesses: Uses local_secret_key for private authentication.
    • Interactive CLI: Post, Read, and Take Down messages.

Prerequisites

  • Node.js: v18+
  • Midnight Compact Compiler: Installed via @midnight-ntwrk/compactc (or system wide).
  • Midnight Lace Wallet: For Testnet interaction.
  • Docker: (Optional) For running local proof servers or nodes.

Getting Started

  1. Clone the repository:

    git clone https://github.com/your-username/midnight-dev.git
    cd midnight-dev
  2. Setup Environment: Each project requires a .env file with your wallet seed.

    cp my-app/.env.example my-app/.env
    # Edit .env and add your WALLET_SEED
  3. Run a Project: Navigate to the project directory (e.g., bulletin-board) and run:

    npm install
    npm run build
    npm run deploy
    npm run start

Documentation

License

MIT

About

Midnight Network development workspace and tutorials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published