Skip to content

Commit

Permalink
Update README: add Relayer
Browse files Browse the repository at this point in the history
  • Loading branch information
NIC619 committed Sep 13, 2021
1 parent d5153b4 commit 41fab36
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
Binary file added imgs/relayer_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/relayer_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions setupAutotask.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
## Set up Autotask instances

1. Go to https://defender.openzeppelin.com/#/autotask and sign up
2. Hit the `Secrets` button and then the `New secret` button to add secrets like private key or RPC api key
- Note that saving private key as secrets in Autotask is not 100% safe since you might accidentally print out these secrets during debugging of `Autotask` script
- as Openzeppelin suggested, you should use the `Relayer` service to control your EOA
- Note that the `sentinel` referred here in `Autotask` scripts refers to the role `sentinel` in our settings, not the `Sentinel` service

![](./imgs/autotask_secrets1.png)
![](./imgs/autotask_secrets2.png)

2. To set up an account that executes tasks/transactions instructed in our Autotask scripts, we have two choices: **use our own EOA** or **use a `Relayer` instance**
- Here we will use relayer, go [set up a Relayer instance](./setupRelayer.md)

3. Back to `Autotask` dashboard and hit the `Create Autotask` button to create new Autotask instnace

![](./imgs/autotask_create1.png)

4. Input instance name, choose `Webhook` as trigger
5. Paste the `Autotask` scripts to `Code` section and hit `Create` button
5. In `Connect to a relayer` section, select the name of the relayer instance you created
6. Paste the `Autotask` scripts to `Code` section and hit `Create` button
- `pause` contract [script](./scripts/autotask/pause/OneRoleAccessControl.js) for `OneRoleAccessControl` contract
- `pause` contract [script](./scripts/autotask/pause/UpgradeProxyImplementation.js) for `UpgradeProxyImplementation` contract
- Note that these javscritp scripts are compiled from its original one written in typescript
- everytime you modify any of these scripts, e.g., [OneRoleAccessControl.ts](./scripts/autotask/pause/OneRoleAccessControl.ts), you have to run `npx tsc scripts/autotask/pause/OneRoleAccessControl.ts` and copy-paste the compiled OneRoleAccessControl.js scripts to `Code` section in your Autotask instance

![](./imgs/autotask_create2.png)

6. You are all set, go invoke functions and see if scripts are executed as expected.
7. You are all set, go invoke functions and see if scripts are executed as expected.


___

Expand All @@ -38,3 +34,7 @@ ___
- you can `console.log` in your script and they will show up in `Logs` section

![](./imgs/autotask_run_info.png)

___

More about `Autotask` service: https://docs.openzeppelin.com/defender/autotasks
24 changes: 24 additions & 0 deletions setupRelayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Set up Relayer instances

1. Go to https://defender.openzeppelin.com/#/relay and sign up
2. Hit the `Create Relayer` button to create new Relayer instnace
3. Input instance name, choose network and hit `Create`
![](./imgs/relayer_create.png)

4. It will generate an EOA and show you it's `address`, `API Key` and API's `Secret Key`
- You need to write down API's `Secret Key` if you want to send request to your relayer outside of Defender services
- But you don't have to if you are using it from within, e.g., from an `Autotask` instance, it will automatically handle the authentications for you
- And it is easy to create a new API key so don't worry too much if you forgot the secret key
5. Finally you need to fund this relayer by sending ETH to it
- For relayers in Goerli and Rinkeby networks, you don't have to fund them yourself, Defender will top up the balance for you
- Defender will send you email notification once the relayer is running low on funds (below 0.1 ETH)
6. Now you can use the relayer from other services like `Autotask`

___

- You can create new API keys or sending arbitrary transactions like sending ETH/tokens from your relayer
![](./imgs/relayer_edit.png)

___

More about `Relayer` service: https://docs.openzeppelin.com/defender/relay
4 changes: 4 additions & 0 deletions setupSentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
- you can use the default threshold values which will send notification on every matched event/function call

![](./imgs/sentinel_notifications.png)

___

More about `Sentinel` service: https://docs.openzeppelin.com/defender/sentinel

0 comments on commit 41fab36

Please sign in to comment.