- Mainnet
- Mainnet
- PP Agent V2 Stats - provides detailed information about a particular
PPAgentV2
deployment by it's address.
- CVP (PowerPool native token) for a deposit. Each Agent contract has its own
min keeper deposit
value. - An RPC node with WebSockets enabled. Note that at the current stage of development, the bot is tested only with standalone nodes and doesn't support RPC endpoints from cloud providers like QuickNode, Alchemy, Infura, etc., due to requests per second limits.
- A server, available 24/7. Minimal requirements are 1CPU/512MB RAM/1G HDD. This bot script works fine at a DigitalOcean 1CPU/1GB/25SSD instance, which costs only $6 at the time of writing.
Agent
- PPAgentV2 contract instance. There could be multiple deployed contract instances within a single network.Keeper
- An actor who registered a pair of admin and worker keys identified by a numerical keeper ID.
To be a keeper, you need at least two keys. (1) One admin key for management and (2) another one for a worker. The management key function is to assign a worker's address and withdraw compensations or initial deposit. The worker key is needed for transaction signing by a bot. If you use flashbots executor, you also need a flashbot key. The flashbots key is only required for signing node's requests to flashbot RPC to keep track of your reputation. There is no need to keep any ETH on your flashbots address.
We highly recommend to use flashbots executor for Ethereum mainnet chain. Flashbots executor does not include the failed transactions on chain thus you pay for the successfully executed txs only. |
To sign as a Keeper you need to perform the following actions:
- Approve at least minKeeperCvp amount of CVP token from your keeper admin account to the agent's address. You can find the
minKeeperCvp
value by callingagent.getConfig()
view method. - Execute
agent.registerAsKeeper(address worker_, uint256 initialDepositAmount_)
from your keeper admin account. After execution you will receive a keeperID (uint256). KeeperID is used to get your keeper info withagent.getKeeper(youKeeperId)
and isn't used for further configuration steps .
-
Install docker if it isn't installed yet. For ex. for Ubuntu you can find the instructions here https://docs.docker.com/engine/install/ubuntu/.
-
Clone and cd into a repo with Docker Compose file:
git clone https://github.com/powerpool-finance/powerpool-agent-v2-compose
cd powerpool-agent-v2-compose
- Put a json file containing your worker key into
./keys
folder. The file name doesn't matter, and you can choose it freely. If you don't have a json key file yet, you can use the json key generator from the compose repository. The generator is written in JavaScript, so you need to have node.js installed to use it. Don't forget to install npm dependencies using `npm i'. Use the following syntax to convert your raw private key to json V3 format:# node jsongen.js <your-private-key> <your-pass> node jsongen.js 0x0c38f1fb1b2d49ea6c6d255a6e50edf0a7a7fa217639281fe1b24a96efc16995 myPass
- If you use flashbots executor do the same for your flashbots key.
- Cd into
config
folder and copy the main config template:
cd config && cp main.template.yaml main.yaml
- You can configure as many networks and agents as you need. The official PPAgentV2 list will be published later.
- Put you WebSockets RPC node URI to
networks->details->{network_name}->rpc
. The example config could contain some RPC nodes, either public ones or maintained by PowerPool, but we don't give any guarantee they will work properly with excellent uptime. - For each agent contract address (
networks->details->{network_name}->agents->{agent_address}
):- Choose either
pga
orflashbots
executor. At the momentflashbots
executor is supported only forgoerli
andmainnet
networks. - Put your keeper worker address into
keeper_address
- Put your keeper worker json key pass into
key_pass
- If you want to accrue rewards on your balance at the PPAgentV2 contract (this could save small amount of gas), set
accrue_reward
totrue
. If set tofalse
the compensation will be sent to the worker's address each time after job execution. The default value isfalse
. - Some jobs could have a limit for the current network
base_fee
. It could happen if a job owner is not ready to provide compensation when the gas price exceeds the initial limit. For ex. the current networkbase_fee
is 15 and the job'smaxBaseFee
is 10. If you send a tx for the job execution with anaccept_max_base_fee_limit
set to false and a gas value of 16, it will revert. But if you setaccept_max_base_fee_limit
to true, the tx won't revert, but your compensation will be calculated usingmin(jobMaxBaseFee, neworkFee) = min(10,15) = 10
.
- Choose either
- Notice that you can't add more than one keeper for a given agent contract on a single node. If you want to setup more than one keeper, we recommend setup another node at least on a different host. Using a different RPCs or even regions are good options too.
- Cd back to the bot folder and run a docker container:
cd ..
docker compose up -d
docker compose down
docker compose pull
docker compose up -d
- Register as a keeper at the new contact.
- Update contract address in a corresponding config section. Here is an example of such address in an example config: https://github.com/powerpool-finance/powerpool-agent-v2-compose/blob/a963aec71829df1ec28adec7523029ab7aec52f9/config/main.template.yaml#L13
- If you want to use another address for a keeper worker you should update corresponding fields in the config.
- Update your Agent node (see the instructions above).
Logs are available with the default docker logs
command. First, you should get your container ID with docker ps
command.
It will output something like:
ubuntu@home:~/powerpool-agent-v2-compose$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8651565f365 polipaul/agent-v2-bot:latest "docker-entrypoint.s…" 3 days ago Up 41 hours powerpool-agent-v2-compose-bot-1
Then, use one of the following commands (don't forget to replace the containter ID with your own one):
docker logs -fn100 e8651565f365
to follow the contanter logs starting from 100 lines behinddocker logs e8651565f365 > out.txt
to save all the container logs toout.txt
file