Skip to content
forked from bcnmy/bundler

Typescript AA-Bundler and Paymaster service that comply with EIP-4337.

License

Notifications You must be signed in to change notification settings

DERACHAIN/bundler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Account Abstraction (AA) service

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.

Prerequisites

Setup

  • Install yarn and ts-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 the BUNDLER_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.

Run

  • 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

Unit test

  • Compile test
$ npx tsc
  • Execute UTs
$ npm run test

Dry 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"}

Integration test

Clean

  • Stop server
$ docker-compose down -v

Other useful commands

  • 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>

About

Typescript AA-Bundler and Paymaster service that comply with EIP-4337.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 58.9%
  • Smarty 32.1%
  • Shell 4.5%
  • Mustache 4.3%
  • Other 0.2%
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy