Testing Locally

Setting up a local fork environment requires two servers to be deployed. The hardhat fork will be deployed on http://127.0.0.1:8545 and the bundler service will be deployed on http://127.0.0.1:3000.

1

How to set up a fork:

1

Clone the Bundler repository

git clone https://github.com/TheFunGroup/AA_Bundler.git
2

Change directory into localfork

cd localfork
3

Install packages in localfork

yarn install
4

Run the fork on localhost:8545

npx hardhat node --fork "https://eth-mainnet.g.alchemy.com/v2/lcA7Kyqv42J1Qh-wLm__DdqSCJBtZyd1"
2

How to set up a bundler:

1

OPEN A SEPERATE TERMINAL (in /AA-Bundler home repo)

2

Install packages

yarn && yarn preprocess

IGNORE THIS ERROR: Error: test/Flow.test.ts(7,30): error TS2307: Cannot find module '../src/SimpleAccountABI' or its corresponding type declarations

3

Change Directory into localfork

cd localfork
4

Give permission to run setup.sh

chmod +x setup.sh
5

Run setup.sh to prefund accounts, deploy contracts, and start bundler.

./setup.sh

It's expected to see running on http://localhost:3000/rpc after ./setup.sh is run.

6

(Optional) Run tests

Run the tests outlined in our ReadMe