The node monitors on-chain events and executes jobs when required. This node is distributed as a Docker image and a DappNode package. However, you can also build it from the source by following the instructions below.
Detailed instructions on how to setup a Keeper Node:
-
Sepolia test contracts:
- Sepolia testnet Power Agent V2 Proxy Admin contract - 0x3a779286E14EFcAD664D20023C2CE0209486fF9c.
- Sepolia testnet Power Agent V2 Proxy contract - 0xbdE2Aed54521000DC033B67FB522034e0F93A7e5.
- Sepolia testnet Power Agent V2 Implementation contract - 0xaE32C29AfE1eB46B4fCa7E5f77e95217eF987332.
- Sepolia testnet Power Agent V2 Lens contract - 0x937991108511f1850bd476b9ab56433afde7c92a.
- Sepolia testnet Power Agent V2 subgraph - api.studio.thegraph.com.
-
Gnosis chain test contracts:
- Gnosis chain test Power Agent V2 Proxy Admin contract - 0xe07d0e0671767f1556d0245dc7e8590d15e5bd4f.
- Gnosis chain test Power Agent V2 Proxy contract - 0x071412e301C2087A4DAA055CF4aFa2683cE1e499.
- Gnosis chain test Power Agent V2 Implementation contract - 0xb7912f43D49Af2DcD117f6C25333aa20d5EA1642.
- Gnosis chain Power Agent V2 Lens contract - 0x2b3d29daa9f41c4171416af3d66f5a2ae210616e.
- Gnosis chain test Power Agent V2 subgraph - api.studio.thegraph.com.
-
Ethereum mainnet test contracts:
- Ethereum mainnet test Power Agent V2 Proxy Admin contract - 0x96c1AA4E6eD3a0579C78038Da7e4A17A19A72106.
- Ethereum mainnet test Power Agent V2 Proxy contract - 0xc9ce4CdA5897707546F3904C0FfCC6e429bC4546.
- Ethereum mainnet test Power Agent V2 Implementation contract - 0x31779098cf5da5e16e4b74cef8608aeac216eda3.
- Ethereum mainnet Power Agent V2 Lens contract - 0xbB8dAC006c8B6F67c4bc2563b64ed669Faa54F07.
- Ethereum mainnet test Power Agent V2 subgraph - api.studio.thegraph.com.
To see active Power Agent V2 deployments, go to app.powerpool.finance.
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 node.
To sign as a Keeper you need to perform the following actions:
Go to app.powerpool.finance. Here, you can see all available Power Agent contracts for the selected network and click the Create Keeper
button.
In the pop-up modal window, the Admin address will be set automatically to the connected wallet. Manually fill in the Worker address and the CVP stake amount, ensuring it's above the minimum level. Your CVP stake determines the compensation the Keeper receives and their ability to be assigned a job. Sign the approval transaction and then create a Keeper.
You will see all your created keepers in the My Keepers section.
-
Install Node.js version 18.
-
Clone this repository:
git clone https://github.com/powerpool-finance/powerpool-agent-v2-node.git cd powerpool-agent-v2-node
-
Install dependencies and build Power Agent node:
yarn && yarn build
-
Place a JSON file containing your worker key into the
./keys
folder. You can choose any filename. If you don't yet have a JSON key file, you can use the JSON key generator from this repository. To convert your raw private key to the JSON V3 format, use the following syntax:# node jsongen.js <your-private-key> <your-pass> node jsongen.js 0x0c38f1fb1b2d49ea6c6d255a6e50edf0a7a7fa217639281fe1b24a96efc16995 myPass
-
Copy the main config template:
cp config/main.template.yaml main.yaml
-
Edit
main.yaml
using nano, vim or any other editor. -
You can edit
main.yaml
file and add as many networks and agents as you need. However, at the current stage, it's highly recommended to use only one Network and Power Agent contract. -
Enter your WebSockets RPC node URI in
networks->details->{network_name}->rpc
. The example config might include some RPC nodes, either public ones or those maintained by PowerPool. However, we cannot guarantee that they will operate flawlessly with excellent uptime. To achieve better uptime, it is highly recommended to use your own personal RPC. -
For each Agent contract address (
networks->details->{network_name}->agents->{agent_address}
):- Choose
pga
executor. - Put your Keeper worker address into
keeper_address
. - Put your Keeper worker json key password into
key_pass
. - If you wish to accrue rewards on your balance in the Power Agent contract (which could save a small amount of gas), set
accrue_reward
totrue
. If set tofalse
, the compensation will be sent to the worker's address after each job execution. The default value isfalse
.
- Choose
-
Please note that you cannot add more than one Keeper for a given agent contract on a single node. If you wish to set up more than one Keeper, we recommend setting up another node, preferably on a different host. Using different RPCs or even different regions are also good options.
-
The main.yaml file should look like this example for Sepolia:
networks:
enabled:
- sepolia
details:
sepolia:
rpc: 'wss://sepolia-1.powerpool.finance'
agents:
'0xbdE2Aed54521000DC033B67FB522034e0F93A7e5':
data_source: subgraph
subgraph_url: https://api.studio.thegraph.com/query/48711/ppav2-rd-sepolia-b12-ui/version/latest
executor: pga
keeper_worker_address: '0x840ccC99c425eDCAfebb0e7ccAC022CD15Fd49Ca'
key_pass: 'Very%ReliablePassword292'
accrue_reward: false
- The main.yaml file should look like this example for Gnosis chain:
networks:
enabled:
- gnosis
details:
gnosis:
rpc: 'wss://gnosis-1.powerpool.finance'
agents:
'0x071412e301C2087A4DAA055CF4aFa2683cE1e499':
data_source: subgraph
subgraph_url: https://api.studio.thegraph.com/query/48711/ppav2-rd-gnosis-b12-ui/version/latest
executor: pga
keeper_worker_address: '0x840ccC99c425eDCAfebb0e7ccAC022CD15Fd49Ca'
key_pass: 'Very%ReliablePassword292'
accrue_reward: false
- The main.yaml file should look like this example for Ethereum mainnet:
networks:
enabled:
- mainnet
details:
mainnet:
rpc: 'wss://mainnet-1.powerpool.finance'
agents:
'0x071412e301C2087A4DAA055CF4aFa2683cE1e499':
data_source: subgraph
subgraph_url: https://api.studio.thegraph.com/query/48711/ppav2-rd-gnosis-b12-ui/version/latest
executor: pga
keeper_worker_address: '0x840ccC99c425eDCAfebb0e7ccAC022CD15Fd49Ca'
key_pass: 'Very%ReliablePassword292'
accrue_reward: false
- To start the node and ensure that everything is okay:
node dist/Cli.js
- To start the node in background using pm2:
yarn add global pm2
pm2 start dist/Cli.js --name power-agent
pm2 startup && pm2 save
- There is an alternative way to start the node by using only environment variables instead of a config file:
NETWORK_NAME='sepolia' NETWORK_RPC='wss://sepolia-1.powerpool.finance' AGENT_ADDRESS='0xbdE2Aed54521000DC033B67FB522034e0F93A7e5' KEEPER_WORKER_ADDRESS='0x840ccC99c425eDCAfebb0e7ccAC022CD15Fd49Ca' KEYPASSWORD='Very%ReliablePassword292' node dist/Cli.js
- Full list of environment variables:
-
NETWORK_NAME
- Name of the network (e.g., sepolia, goerli, gnosis, ethereum, etc.) -
NETWORK_RPC
- Provided RPC URL -
AGENT_ADDRESS
- Power Agent smart contract address -
KEEPER_WORKER_ADDRESS
- Your Worker address -
KEYPASSWORD
- Password for your keyfile -
DATA_SOURCE
- Currently only 'subgraph'. -
SUBGRAPH_URL
- URL for the subgraph (e.g.,https://api.studio.thegraph.com/query/48711/ppav2-rd-sepolia-b12-ui/version/latest
). -
ACCRUE_REWARD
- If provided, will be set totrue
-
Eventually, you will see the following logs in the console. Pay attention: your keeper is still disabled, so you cannot execute jobs.
Go back to https://app.powerpool.finance/#/sepolia/ppv2/my-keepers, click the 'Complete' button, and then sign the transaction. In the console, you will see that the Keeper was successfully activated. Congratulations!
docker buildx build -t power-agent-node:latest .
- Not an actual error, but some condition when it's better to restart an entire app. Used for some event handlers.
- Critical errors. Should stop the app. For ex. worker address not found, can't resolve RPC, etc.
- Non-critical errors. Should restart the app. For ex. hanged WS endpoint connection.
The Power Agent node sends basic, anonymous data about transactions to the backend for debugging.