Ensure you have the following installed on your system before proceeding:
- Node.js (v16 or later)
- npm
- Go (v1.19 or later)
- Foundry (for smart contract development)
- Anvil (local Ethereum node)
# Database Configuration
DB_URL="<your-database-connection-string>"
# Server Configuration
SERVER_PORT=<port-number>
# Chain Configuration
CHAIN_RPC="<your-rpc-url>"
ENTRYPOINT_ADDRESS="<your-entrypoint-contract-address>"
BUNDLER_PRIVATE_KEY="<your-bundler-private-key>"
PAYMASTER_ADDRESS="<your-paymaster-contract-address>"
CHAIN_ID=<your-chain-id>
NEXT_PUBLIC_BACKEND_URL="<your-backend-url>"
NEXT_PUBLIC_ENTRYPOINT_ADDRESS="<your-entrypoint-contract-address>"
NEXT_PUBLIC_CHAIN_ID=<your-chain-id>
NEXT_PUBLIC_FACTORY_ADDRESS="<your-factory-contract-address>"
NEXT_PUBLIC_PAYMASTER_ADDRESS="<your-paymaster-contract-address>"
PRIVATE_KEY="<your-private-key>"
The frontend is written in Next.js. To set it up:
-
Navigate to the
frontend
directory:cd frontend
-
Install dependencies:
npm install
-
Create a
.env
file in the frontend directory and add the environment variables listed above. -
Run the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
.
To deploy and interact with the smart contracts:
-
Create a
.env
file in the root directory and add the environment variables listed above. -
Start a local Anvil instance:
anvil
-
Deploy the contracts using the provided script:
./deploy.sh
Alternatively, you can deploy manually using the following commands:
source .env
forge script script/SmartAccountFactory.s.sol:DeploySmartAccount --rpc-url http://localhost:8545 --broadcast
The backend is written in Go. Follow these steps to set it up:
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
go mod tidy
-
Create a
.env
file in the backend directory and add the environment variables listed above. -
Run the backend server:
go run cmd/main.go