-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DKG initiation workflow definition for GitHub Actions.
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
|
||
from ape_accounts import import_account_from_private_key | ||
|
||
|
||
def main(): | ||
try: | ||
passphrase = os.environ["DKG_INITIATOR_PASSPHRASE"] | ||
private_key = os.environ["DKG_INITIATOR_PRIVATE_KEY"] | ||
except KeyError: | ||
raise Exception( | ||
"There are missing environment variables." | ||
"Please set DKG_INITIATOR_PASSPHRASE and DKG_INITIATOR_PRIVATE_KEY." | ||
) | ||
account = import_account_from_private_key( | ||
'AUTOMATION', | ||
passphrase, | ||
private_key | ||
) | ||
print(f"Account imported: {account.address}") | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ape run initiate_ritual \ | ||
--autosign \ | ||
--account AUTOMATION \ | ||
--network polygon:mainnet:${RPC_PROVIDER} \ | ||
--domain mainnet \ | ||
--duration 86400 \ | ||
--access-controller GlobalAllowList \ | ||
--fee-model FreeFeeModel \ | ||
--authority ${DKG_AUTHORITY_ADDRESS} \ | ||
--min-version ${MIN_VERSION} \ | ||
--num-nodes 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Heartbeat DKG | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
initiate_dkg: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip3 install eth-ape ape-infura ape-polygon ape-etherscan | ||
pip3 install -e . | ||
- name: Import Ape Account | ||
run: .github/scripts/import_account.py | ||
env: | ||
DKG_INITIATOR_PRIVATE_KEY: ${{ secrets.DKG_INITIATOR_PRIVATE_KEY }} | ||
DKG_INITIATOR_PASSPHRASE: ${{ secrets.DKG_INITIATOR_PASSPHRASE }} | ||
|
||
- name: Initiate Ritual | ||
run: .github/scripts/initiate_ritual.sh | ||
env: | ||
DKG_INITIATOR_ADDRESS: ${{ secrets.DKG_INITIATOR_ADDRESS }} | ||
APE_ACCOUNTS_AUTOMATION_PASSPHRASE: ${{ secrets.DKG_INITIATOR_PASSPHRASE }} | ||
DKG_AUTHORITY_ADDRESS: ${{ secrets.DKG_AUTHORITY_ADDRESS }} | ||
RPC_PROVIDER: ${{ secrets.RPC_PROVIDER }} | ||
MIN_VERSION: ${{ secrets.MIN_VERSION }} | ||
WEB3_INFURA_API_KEY: ${{ secrets.WEB3_INFURA_API_KEY }} | ||
POLYGONSCAN_API_KEY: ${{ secrets.POLYGONSCAN_API_KEY }} |