Edit: Before reading and following this guide, I encourage you all to read the reply from @spalladino from the OpenZeppelin team. You will see that the OpenZeppelin team is working on a more economical solution for Keep3rs, which is much more secure than what I propose below.
@Silver_surfer also included a very helpful reply on how to get started with registering with OpenZeppelin defender as Keep3r user in order to have access to some hot-off-the-press features that will help make running Keep3rs on their system better! It is also free for the time being!
I’ll keep my guide up for educational purposes, but I do ask that no one actually uses it except for testing with a wallet you are willing to abandon and throw away later. Putting your private key into a cloud system is pretty much asking to leak your key.
Soon I will provide an update to the code that users the relayer signer instead of a private key signer, just like Andre’s original solution, but I will include more than just the UniswapOracleV2 job.
Also, after testing my method on my own Keep3r, I am pretty sure my code has an issue with proper gas estimate. So it will end up just failing txs due to out of gas errors.
Andre recently posted this guide showing how to run a Keep3r in the cloud with OpenZeppelin Defender.
However, using OpenZeppelin Defender’s relayer feature costs a lot of money and the code provided by Andre depends on relayers.
So, I decided to post a quick guide and share some code on how to run without relayers so that people can run Keepers using the OpenZeppelin free tier.
Caveats/Warnings:
This method involves uploading a private key to OpenZeppelin in a javascript file. Exporting your private key and putting it in a file is extremely dangerous. This instantly turns any cold wallet into a hot wallet and you should only be doing this with wallets you are prepared to lose. As soon as someone else sees your private key, that wallet is compromised and your coins will be stolen. Do not screenshot this code after pasting your private key and try to ask questions for help here. Be very careful.
I repeat, exporting your private key and putting it in a file is not secure. Do NOT under any circumstance put your main wallet’s private key into a file like this. If you bonded with your main wallet, too bad. Make a new account, send it some ether, bond again and wait 3 days. It is worth the safety.
Once your private key is in a file in OpenZeppelin, you are putting your entire faith into their system to be secure. If they get hacked, your wallet will be stolen. I repeat, DO NOT USE your main wallet. Create a new account and wait the 3 days to bond. Don’t play games and risk your main wallet.
Now that we got that out of the way.
-
Follow Andre’s guide prerequisites to create an OpenZeppelin | defender account and register a Keep3R (remember, make a new Keep3r on a burner account and don’t use your main account)
-
Skip step 1 in Andre’s guide since you won’t need a Relayer
-
For step 3, paste the code from my Github gist into the task instead of the one that Andre posts.
You will need to fill the first couple of lines with your Keep3r address and private key (put these in between the quotes that I included). Also, take time to reread the caveats at the top of the post. Putting your private key in a file on a cloud system is not secure.
- Save your autotask and now you should have a Keep3r that runs in the cloud and checks the UniswapOracleV2, HegicPoolKeep3r, and YearnV1EarnKeep3r jobs and will run them if they are workable.
Cheers!