This guide provides detailed instructions for setting up CertaBlock on your local machine.
Before you begin, ensure you have the following installed:
| Software | Version | Installation Link |
|---|---|---|
| Rust | 1.70+ | rustup.rs |
| Node.js | 18+ | nodejs.org |
| Git | Latest | git-scm.com |
- MetaMask: Install from metamask.io
# Check Rust version
rustc --version
cargo --version
# Check Node.js version
node --version
npm --version
# Check Git version
git --versiongit clone https://github.com/hasancoded/CertaBlock.git
cd CertaBlock# Development build
cargo build
# Production build (optimized)
cargo build --releaseExpected Output:
Compiling certablock v0.1.0
Finished release [optimized] target(s) in X.XXs
# Development mode
cargo run
# Production mode
cargo run --releaseExpected Output:
CertaBlock REST API running on http://127.0.0.1:3000
CORS enabled for React app on http://localhost:5173
Available endpoints:
AUTHENTICATION:
POST /auth/nonce
POST /auth/verify
...
The backend will be available at http://127.0.0.1:3000
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapturecd dashboardnpm installExpected Output:
added XXX packages in XXs
npm run devExpected Output:
VITE v5.x.x ready in XXX ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
The dashboard will be available at http://localhost:5173
npm run buildExpected Output:
vite v5.x.x building for production...
✓ XXX modules transformed.
dist/index.html X.XX kB
dist/assets/index-XXXXX.js XXX.XX kB
✓ built in X.XXs
curl http://127.0.0.1:3000/statsExpected Response:
{
"total_blocks": 1,
"pending_transactions": 0,
"mining_difficulty": 4,
"is_mining": false
}- Open browser to
http://localhost:5173 - You should see the CertaBlock dashboard
- Click "Connect Wallet" to connect MetaMask
- Open MetaMask
- Connect to localhost network (if needed)
- Approve the connection request from CertaBlock
Error:
Error: Address already in use (os error 48)
Solution:
# Find process using port 3000
lsof -i :3000 # macOS/Linux
netstat -ano | findstr :3000 # Windows
# Kill the process or change the port in src/main.rsError:
error: no default toolchain configured
Solution:
rustup default stableSolution:
# Clean build artifacts
cargo clean
# Update dependencies
cargo update
# Rebuild
cargo buildSolution:
# Remove node_modules and package-lock.json
rm -rf node_modules package-lock.json
# Reinstall
npm installSolution:
# Kill the process or change port in vite.config.js
# Or use a different port
npm run dev -- --port 5174Ensure:
- Backend is running on
http://127.0.0.1:3000 - Frontend is running on
http://localhost:5173 - CORS is properly configured in backend
Solution:
- Open MetaMask
- Go to Settings → Connected Sites
- Remove CertaBlock if listed
- Refresh the page and reconnect
Solution:
- Switch to Ethereum Mainnet or your preferred network
- Refresh the page
After successful setup:
- Explore the Dashboard: Navigate through different sections
- Mine a Block: Try the mining functionality with different difficulty levels
- Issue a Certificate: Test the certificate management system
- Transfer Tokens: Experiment with the token system
- Read the Documentation: Check out API.md and WHITEPAPER.md
- API Documentation: docs/API.md
- Technical Whitepaper: docs/WHITEPAPER.md
- Contributing Guide: CONTRIBUTING.md
- GitHub Repository: github.com/hasancoded/CertaBlock
For additional help, please open an issue on GitHub.