Giter Site home page Giter Site logo

bundler's Introduction

EIP4337 reference modules

Bundler

A basic eip4337 "bundler"

This is a reference implementation for a bundler, implementing the full EIP-4337 RPC calls (both production and debug calls), required to pass the bundler-spec-tests test suite.

Running local node

In order to implement the full spec storage access rules and opcode banning, it must run against a GETH node, which supports debug_traceCall with javascript "tracer" Specifically, hardhat node and ganache do NOT support this API. You can still run the bundler with such nodes, but with --unsafe so it would skip these security checks

If you don't have geth installed locally, you can use docker to run it:

docker run --rm -ti --name geth -p 8545:8545 ethereum/client-go:v1.10.26 \
  --miner.gaslimit 12000000 \
  --http --http.api personal,eth,net,web3,debug \
  --http.vhosts '*,localhost,host.docker.internal' --http.addr "0.0.0.0" \
  --ignore-legacy-receipts --allow-insecure-unlock --rpc.allow-unprotected-txs \
  --dev \
  --verbosity 2 \
  --nodiscover --maxpeers 0 --mine --miner.threads 1 \
  --networkid 1337

Usage:

  1. run yarn && yarn preprocess
  2. deploy contracts with yarn hardhat-deploy --network localhost
  3. run yarn run bundler (or yarn run bundler --unsafe, if working with "hardhat node")

Now your bundler is active on local url http://localhost:3000/rpc

To run a simple test, do yarn run runop --deployFactory --network http://localhost:8545/ --entryPoint 0x0576a174d229e3cfa37253523e645a78a0c91b57

The runop script:

  • deploys a wallet deployer (if not already there)
  • creates a random signer (owner for wallet)
  • determines the wallet address, and funds it
  • sends a transaction (which also creates the wallet)
  • sends another transaction, on this existing wallet
  • (uses account[0] or mnemonic file for funding, and creating deployer if needed)

NOTE: if running on a testnet, you need to supply the bundler (and runop) the network and mnemonic file, e.g.

yarn run bundler --network localhost --mnemonic file.txt

To run the full test bundler spec test suite, visit https://github.com/eth-infinitism/bundler-spec-tests

sdk

SDK to create and send UserOperations see SDK Readme

utils

internal utility methods/test contracts, used by other packages.

bundler's People

Contributors

drortirosh avatar shahafn avatar skypigr avatar forshtat avatar hazim-j avatar weiihann avatar arc0035 avatar derekchiang avatar plusminushalf avatar kristofgazso avatar naddison36 avatar ququzone avatar zihaoccc avatar delaaxe avatar rachosuar avatar skyh24 avatar leekt avatar tconnolly11 avatar tinchoabbate avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.