All-in-one off-chain services for AA on DERA chain, included but not limited to Bundler, Paymaster service that comply with EIP-4337. This repository is based on Biconomy open-source bundler service that extends other modules such as Paymaster.
- NodeJS v20 LTS.
- Docker v27 with docker-compose plugins installed.
- Install
yarn
andts-node
$ npm install -g yarn
$ npm install -g ts-node
- Install dependencies
$ yarn
- Create
.env
file from template and populate necessary secrets and credentials
$ cp .env-example .env
- Create
./src/config/config.json
from./src/config/config.template.json
and populate necessary secrets and credentials
$ cp ./src/config/config.template.json ./src/config/config.json
- Compile
config.json
after exporting theBUNDLER_CONFIG_PASSPHRASE
environment variable with the same value that is predefined in the.env
file from the previous step
$ export BUNDLER_CONFIG_PASSPHRASE="<same-value-within-dotenv-file>"
$ cd src && npx ts-node encrypt-config.ts
you should note that completed
text is printed out upon compilation.
- Start server and run in foreground
$ docker-compose up
the server should be up and running at localhost:3000
without errors.
- Start server background
$ docker-compose up -d
- Compile test
$ npx tsc
- Execute UTs
$ npm run test
- Test Bundler endpoint
$ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1693369916,"method":"eth_supportedEntryPoints","params":[]}' http://localhost:3000/api/v2/20240801/x
the server should return successful response, such as:
{"jsonrpc":"2.0","id":1693369916,"result":["0xd085d4bf2f695D68Ba79708C646926B01262D53f"]}
- Test Paymaster endpoint
$ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1693369916,"method":"eth_chainId","params":[]}' http://localhost:3000/paymaster/api/v1/20240801/x
the server should return successful response, such as:
{"id":1693369916,"jsonrpc":"2.0","result":"0x134d9a1"}
- Refer to Demo AA client for details.
- Stop server
$ docker-compose down -v
- Build new docker image upon adding new package to
package.json
$ docker-compose build server
or without cache in the case you suspect caching problems
$ docker-compose build --no-cache <service-name>