Documentation

Quick setup

The quick setup command let you deploy a new paymaster instance in 2 minutes with a minimal configuration

Installation

Start by getting the Paymaster CLI:

git clone https://github.com/avnu-labs/paymaster
cd paymaster

Launch quick-setup

In order to run the paymaster, you need to deploy several contracts, but no worries all is done in one cmd as described bellow.

  • --chain-id is either "sepolia" or "mainnet"
  • --master-address is the account which is gonna deploy and become the owner of the forwarder
  • --master-pk is the private key of the master-address account
  • --rpc-url is the url of a Starknet node (optional)
  • --fund is the initial amount of STRK to transfer to each relayer (optional - default: 10)
  • --profile is the complete path of the profile you're setting up (optional - default: default.json)
cargo run --bin paymaster-cli quick-setup --chain-id=CHAIN_ID --master-address=0xdead --master-pk=0xbeef --profile=path/to/my-profile.json
Output example

Starting Paymaster setup...
Using chain-id: SN_SEPOLIA
Using RPC URL: https://starknet-sepolia.public.blastapi.io
Nbr of relayers: 2
Minimum relayer balance: 1 STRK
Rebalancing trigger balance: 8 STRK
Fund estimate account with: 10 STRK
Fund gas tank with: 1 STRK(reserve) + 20 STRK(fund)
Total amount to fund paymaster: 31 STRK
Profile path: path/to/my-profile.json


Do you want to proceed with the deployment? This will transfer 31 STRK tokens to your relayers and estimate account. (y/N): y
Proceeding with deployment...
get_transaction_status; hash=0x...
get_transaction_status; hash=0x...
Transaction succeeded: 0x...
Paymaster contracts are deployed, tx = 0x...
Profile not found, created new configuration profile at: path/to/my-profile.json
Configuration file is updated, see path/to/my-profile.json

📘

Initial funding of the relayers

A part of the paymaster setup consist of relayers deployment & funding to be able to run transactions, therefore you can choose how many relayers you want to deploy and the initial amount of STRK to send to the gas tank.

Additionally, an estimate-account is deployed to be able to run tx estimations, and also have to be funded.

The total amount of STRK = num-relayers * fund + estimate-account-default-funding

Run your instance

You now have all the contract architecture needed to manage Gasless transactions, congrats 🥳

Let's continue by running your instance & monitor it!

❗️

Keep your profile.json in a safe place

If you look at /profiles/my-profile.json you'll see all the configuration of your paymaster, including sensitive data like the relayers private keys.

Good to know: As the forwarder owner is the "master-address"(and master-pk is never saved), the risk associated with leaking your profile is limited to your relayers fund to be drained.


What’s Next

Now your paymaster instance is ready, let's take a look at the architecture