From 8b5be6cf29d6cd07b8c6253334d219bce684c4ba Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 23 Oct 2024 18:37:17 +0530 Subject: [PATCH] Add steps to setup userKey, bondId and authority in snowball backend setup --- ops/configs/snowball-config.toml | 40 ++++++-------- ops/deployments-from-scratch.md | 93 +++++++++++++++++++++++++++++--- 2 files changed, 102 insertions(+), 31 deletions(-) diff --git a/ops/configs/snowball-config.toml b/ops/configs/snowball-config.toml index bb947d8..11350b5 100644 --- a/ops/configs/snowball-config.toml +++ b/ops/configs/snowball-config.toml @@ -3,39 +3,32 @@ port = 8000 gqlPath = "/graphql" [server.session] - secret = "" - appOriginUrl = "" + secret = "" + # Frontend webapp URL origin + appOriginUrl = "https://deploy.pwa.mito.com" + # Set to true if server running behind proxy trustProxy = true - domain = "" + # Backend URL hostname + domain = "deploy-backend.pwa.mito.com" [database] dbPath = "/data/db/snowball" [gitHub] - webhookUrl = "https://snowball-backend.pwa.laconic.com" + webhookUrl = "https://deploy-backend.pwa.mito.com" [gitHub.oAuth] - clientId = "" - clientSecret = "" - -[google] - clientId = "" - clientSecret = "" - -[turnkey] - apiBaseUrl = "" - apiPrivateKey = "" - apiPublicKey = "" - defaultOrganizationId = "" + clientId = "" + clientSecret = "" [registryConfig] fetchDeploymentRecordDelay = 5000 checkAuctionStatusDelay = 5000 - restEndpoint = "https://laconicd.laconic.com" - gqlEndpoint = "https://laconicd.laconic.com/api" - chainId = "laconic_9000-2" - privateKey = "" - bondId = "" - authority = "snowballtools" + restEndpoint = "https://laconicd-sapo.laconic.com" + gqlEndpoint = "https://laconicd-sapo.laconic.com/api" + chainId = "laconic-testnet-2" + privateKey = "" + bondId = "" + authority = "deploy" [registryConfig.fee] gasPrice = "1alnt" @@ -45,6 +38,3 @@ revealFee = "100000" revealsDuration = "120s" denom = "alnt" - -[misc] - projectDomain = "" diff --git a/ops/deployments-from-scratch.md b/ops/deployments-from-scratch.md index 081cdd6..f218f1c 100644 --- a/ops/deployments-from-scratch.md +++ b/ops/deployments-from-scratch.md @@ -1322,9 +1322,90 @@ wget -O /srv/snowball/snowball-deployment/data/config/local.toml https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/configs/snowball-config.toml ``` -* Reserve authority `snowballtools` using a funded account and create a bond +* Setup private key and bond id. Execute the following commands in the directory containing `stage2-deployment` -* Update `/srv/snowball/snowball-deployment/data/config/local.toml` with the required values + * Create a new account and fetch the private key + + ```bash + laconic-so deployment --dir stage2-deployment exec laconicd "laconicd keys add deploy" + # - address: laconic1yr758d5vkg28text073vlzdjdgd7ud6w729tww + ... + export deployKey=$(laconic-so deployment --dir stage2-deployment exec laconicd "echo y | laconicd keys export deploy --keyring-backend test --unarmored-hex --unsafe") + # ... + # txhash: 262D380259AC06024F87C909EB0BF7814CEC26CDF527B003C4C10631E1DB5893 + ``` + + * Send tokens to this account + + ```bash + laconic-so deployment --dir stage2-deployment exec laconicd "laconicd tx bank send alice laconic1yr758d5vkg28text073vlzdjdgd7ud6w729tww 1000000000000000000alnt --from alice --fees 200000alnt -y" + ``` + + * Create a bond using this account + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry bond create --type alnt --quantity 1000000000000 --user-key $deployKey" | jq -r '.bondId' + # 15e5bc37c40f67adc9ab498fa3fa50b090770f9bb56b27d71714a99138df9a22 + ``` + + * Set bond id + + ```bash + export bondId=15e5bc37c40f67adc9ab498fa3fa50b090770f9bb56b27d71714a99138df9a22 + ``` + +* Register authority. Execute the following commands in the directory containing `laconic-console-testnet2-deployment` + + * Reserve an authority + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority reserve deploy-mito --txKey $deployKey" + ``` + + * Obtain the auction ID + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority whois deploy-mito --txKey $deployKey" + # "auction": { + # "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" + ``` + + * Commit a bid using the auction ID. A reveal file will be generated + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic-testnet-2 --txKey $deployKey" + + # {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"} + ``` + + * Reveal a bid using the auction ID and the reveal file generated from the bid commit + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic-testnet-2 --txKey $deployKey" + # {"success": true} + ``` + + * Verify status after the auction ends. It should list a completed status and a winner + + ``` + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry auction get 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 -txKey $deployKey" + ``` + + * Set the authority using a bond ID. + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority bond set deploy-mito $bondId --txKey $deployKey" + # {"success": true} + ``` + + * Verify the authority has been registered. + + ```bash + laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority whois deploy-mito --txKey $deployKey" + ``` + + +* Update `/srv/snowball/snowball-deployment/data/config/local.toml`. Replace `` with your credentials. Use the `userKey`, `bondId` and `authority` that you set up ### Start @@ -1379,18 +1460,18 @@ DEPLOYER_LRN= ``` -* Update required laconic config: +* Update required laconic config. You can use the same `userKey` and `bondId` used for snowball-backend: ```bash # Replace and cat < config.yml services: registry: - rpcEndpoint: https://laconicd.laconic.com - gqlEndpoint: https://laconicd.laconic.com/api + rpcEndpoint: https://laconicd-sapo.laconic.com + gqlEndpoint: https://laconicd-sapo.laconic.com/api userKey: bondId: - chainId: laconic_9000-2 + chainId: laconic-testnet-2 gasPrice: 1alnt EOF ```