Prerequisites
Before you begin, make sure you have:
- Node.js v18 or higher
- Yarn package manager
- Git for cloning the repository
Quick Start
Clone the Repository
git clone https://github.com/Gutslabs/blockmsg.git
cd blockmsg
Set Environment Variables
cp packages/nextjs/.env.example packages/nextjs/.env.local
Edit .env.local with your configurationStart Development Server
App runs at http://localhost:3000
Project Structure
blockmsg/
├── packages/
│ ├── hardhat/ # Smart contracts
│ │ ├── contracts/ # Solidity contracts
│ │ ├── deploy/ # Deployment scripts
│ │ └── test/ # Contract tests
│ └── nextjs/ # Frontend application
│ ├── app/ # Next.js pages
│ ├── components/ # React components
│ └── hooks/ # Custom hooks
└── docs/ # This documentation
Smart Contracts
SecretCircles.sol
The main contract handling encrypted messaging:
// Key functions
function sendDM(
address _to,
externalEuint32[] calldata _encryptedContent,
bytes[] calldata _proofs,
uint256 _expiresInSeconds
) external;
function dmMessages(
address _user1,
address _user2,
uint256 _index
) external view returns (DirectMessage memory);
Deploying Contracts
# Deploy to Ethereum Sepolia testnet
cd packages/hardhat
yarn deploy --network sepolia
# Verify contract
yarn verify --network sepolia
Environment Variables
| Variable | Description |
|---|
NEXT_PUBLIC_CHAIN_ID | Target chain ID (Sepolia: 11155111) |
NEXT_PUBLIC_CONTRACT_ADDRESS | Deployed SecretCircles contract |
DEPLOYER_PRIVATE_KEY | Private key for contract deployment |
Testing
Contract Tests
cd packages/hardhat
yarn test
Frontend Development
cd packages/nextjs
yarn dev
Deployment
Frontend (Vercel)
- Push to GitHub
- Connect repo to Vercel
- Set environment variables
- Deploy
Contracts (Zama fhEVM)
yarn deploy --network zama
Contributing
Fork & Clone
Fork the repo, make changes, submit a PR
Issues
Report bugs or request features on GitHub
All contributions are welcome! Check the GitHub issues for good first issues.