Thank you for your interest in contributing to WhisperNote! This document provides detailed instructions for setting up the development environment and understanding the system architecture.
- System Requirements
- Node Architecture
- Development Setup
- Node Configuration
- Local Development
- Testing
- Creating Pull Requests
- Node.js (v20+)
- Rust (1.75 or later)
- DFX (v0.15.0 or later)
- Calimero SDK (latest)
- IC Wasm Tools
- Candid Extractor
- pnpm (v8+)
- Flutter (3.19+ for mobile/desktop apps)
WhisperNote operates on a three-node architecture for enhanced security and reliability:
- Main storage node for encrypted notes
- Handles CRUD operations
- Manages version control
- Required configuration:
merod --node-name notes-primary init --server-port 2427 --swarm-port 2527- Manages real-time synchronization
- Handles conflict resolution
- Maintains backup states
- Required configuration:
merod --node-name sync-mediator init --server-port 2428 --swarm-port 2528- Manages note sharing operations
- Handles key distribution
- Controls access permissions
- Required configuration:
merod --node-name sharing-coordinator init --server-port 2429 --swarm-port 2529-
Clone the Repository:
git clone https://github.com/your-username/kylrixnote.git cd kylrixnote -
Install Required Tools:
# Install IC Wasm tools cargo install ic-wasm # Install Candid extractor cargo install candid-extractor # Install dependencies pnpm install
-
Build and Deploy:
# Build WASM modules ./predeploy.sh # Deploy to local network ./deploy.sh local
-
Initialize Context on Primary Node:
# Create application instance application install file ./logic/res/blockchain.wasm # Create ICP context context create <APPLICATION_ID> --protocol icp
-
Generate Node Identities:
# On Sync Node identity new # On Sharing Node identity new
-
Invite Nodes to Context:
# From Primary Node, invite Sync Node context invite <CONTEXT_ID> <CONTEXT_IDENTITY> <SYNC_NODE_PUBLIC_KEY> # From Primary Node, invite Sharing Node context invite <CONTEXT_ID> <CONTEXT_IDENTITY> <SHARING_NODE_PUBLIC_KEY>
-
Join Context from Other Nodes:
# On Sync Node context join <PRIVATE_KEY> <INVITATION_PAYLOAD> # On Sharing Node context join <PRIVATE_KEY> <INVITATION_PAYLOAD>
-
Start the Development Server:
pnpm dev
-
Build Contracts:
cd logic ./build.sh -
Deploy Contracts:
dfx deploy
-
Run Unit Tests:
pnpm test -
Run Integration Tests:
cd logic cargo test --package logic -- --nocapture
-
End-to-End Tests:
pnpm test:e2e
-
Create a Feature Branch:
git checkout -b feature/your-feature-name
-
Commit Your Changes:
- Follow conventional commits format
- Include tests for new features
- Update documentation as needed
-
Submit Pull Request:
- Provide clear description of changes
- Link related issues
- Ensure CI passes
- Request review from maintainers
-
Node Synchronization Issues:
- Verify network connectivity between nodes
- Check node logs for sync errors
- Ensure correct context configuration
-
Contract Deployment Issues:
- Verify DFX version compatibility
- Check canister cycles
- Validate contract initialization parameters
-
Key Management Issues:
- Verify key shares distribution
- Check encryption parameters
- Validate sharing node configuration
When contributing new features, follow these architectural principles:
-
Security First:
- All data must be encrypted before storage
- Use proper key management practices
- Implement secure sharing protocols
-
Data Flow:
Client -> Primary Node -> Sync Node -> Sharing Node -
State Management:
- Use atomic operations
- Implement proper error handling
- Maintain data consistency across nodes
-
Typescript:
- Use strict type checking
- Follow ESLint configuration
- Document complex functions
-
Rust:
- Follow Rust style guide
- Use proper error handling
- Document public APIs
-
Testing:
- Write unit tests for all features
- Include integration tests
- Document test scenarios
- Join our Discord
- Check our Documentation
- Visit our Application
- Create an issue on GitHub
Thank you for contributing to WhisperNote! 🚀