Before setting up InvoiceX, ensure you have the following installed:
-
Node.js (v18.0.0 or higher)
# Check version node --version # Install via nvm (recommended) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash nvm install 18 nvm use 18
-
npm or yarn
# npm comes with Node.js npm --version # Or install yarn npm install -g yarn
-
Git
# Check version git --version -
MetaMask or Web3 Wallet
- Install from metamask.io
- Create a development wallet
- NEVER use your main wallet for development
git clone https://github.com/invoicex/invoicex.git
cd invoicex# Using npm
npm install
# Or using yarn
yarn install# Copy environment template
cp .env.example .env
# Edit .env with your configuration
# IMPORTANT: Never commit your .env file!# Network Configuration
MANTLE_RPC_URL=https://rpc.testnet.mantle.xyz
PRIVATE_KEY=your_wallet_private_key_here
# Optional: API Keys for enhanced features
ETHERSCAN_API_KEY=your_etherscan_api_key
COINMARKETCAP_API_KEY=your_cmc_api_keynpm run compilenpm test-
Add Mantle Testnet to MetaMask
- Network Name:
Mantle Testnet - RPC URL:
https://rpc.testnet.mantle.xyz - Chain ID:
5001 - Currency Symbol:
MNT - Block Explorer:
https://explorer.testnet.mantle.xyz
- Network Name:
-
Get Testnet MNT
- Visit Mantle Faucet
- Enter your wallet address
- Receive test MNT tokens
-
Verify Connection
npx hardhat console --network mantleTestnet > const balance = await ethers.provider.getBalance("YOUR_ADDRESS") > console.log(ethers.formatEther(balance))
-
Start Local Hardhat Node
npm run node
-
Deploy Contracts Locally
# In a new terminal npm run deploy:localhost -
Run Frontend (if applicable)
cd frontend npm install npm run dev
Solution:
# macOS
xcode-select --install
# Ubuntu/Debian
sudo apt-get install build-essential
# Windows
npm install --global windows-build-toolsSolution:
# Clear npm cache
npm cache clean --force
# Or use a different directory
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATHSolution:
# Clear artifacts and cache
npm run clean
npm run compile# Run all tests
npm test
# Run specific test file
npm test test/InvoiceToken.test.ts
# Run tests with coverage
npm run test:coverage
# Run tests with gas reporting
REPORT_GAS=true npm testFor integration testing with Mantle mainnet state:
# Update .env
FORK_ENABLED=true
FORK_BLOCK_NUMBER=latest
# Run forked tests
npm run test:fork-
Ensure you have testnet MNT
npx hardhat balance --account YOUR_ADDRESS --network mantleTestnet
-
Deploy contracts
npm run deploy:testnet
-
Verify contracts
npm run verify -- --network mantleTestnet CONTRACT_ADDRESS
- Double-check configuration
- Audit contracts
- Test thoroughly on testnet
- Deploy
npm run deploy:mainnet
# Dockerfile is provided
docker build -t invoicex .
docker run -p 8545:8545 invoicexdocker-compose upEnable debug output:
DEBUG=* npm testnpx hardhat clean
rm -rf cache artifacts
npm run compilenpx hardhat size-contractsIf you encounter issues:
- Check GitHub Issues
- Join our Discord
- Read the FAQ
- Contact: support@invoicex.finance
- Node.js v18+ installed
- Git configured
- Repository cloned
- Dependencies installed
- Environment variables configured
- Contracts compiled successfully
- Tests passing
- MetaMask configured with Mantle Testnet
- Testnet MNT received
- Local deployment successful
Once setup is complete:
- Read CONTRIBUTING.md for development guidelines
- Explore the contract architecture in
/contracts - Review test examples in
/test - Start building your feature!
Happy Building! 🚀