Add steps to setup userKey, bondId and authority in snowball backend setup

This commit is contained in:
Adw8 2024-10-23 18:37:17 +05:30 committed by nabarun
parent 809eae298f
commit 8b5be6cf29
2 changed files with 102 additions and 31 deletions

View File

@ -3,39 +3,32 @@
port = 8000 port = 8000
gqlPath = "/graphql" gqlPath = "/graphql"
[server.session] [server.session]
secret = "" secret = "<redacted>"
appOriginUrl = "" # Frontend webapp URL origin
appOriginUrl = "https://deploy.pwa.mito.com"
# Set to true if server running behind proxy
trustProxy = true trustProxy = true
domain = "" # Backend URL hostname
domain = "deploy-backend.pwa.mito.com"
[database] [database]
dbPath = "/data/db/snowball" dbPath = "/data/db/snowball"
[gitHub] [gitHub]
webhookUrl = "https://snowball-backend.pwa.laconic.com" webhookUrl = "https://deploy-backend.pwa.mito.com"
[gitHub.oAuth] [gitHub.oAuth]
clientId = "" clientId = "<redacted>"
clientSecret = "" clientSecret = "<redacted>"
[google]
clientId = ""
clientSecret = ""
[turnkey]
apiBaseUrl = ""
apiPrivateKey = ""
apiPublicKey = ""
defaultOrganizationId = ""
[registryConfig] [registryConfig]
fetchDeploymentRecordDelay = 5000 fetchDeploymentRecordDelay = 5000
checkAuctionStatusDelay = 5000 checkAuctionStatusDelay = 5000
restEndpoint = "https://laconicd.laconic.com" restEndpoint = "https://laconicd-sapo.laconic.com"
gqlEndpoint = "https://laconicd.laconic.com/api" gqlEndpoint = "https://laconicd-sapo.laconic.com/api"
chainId = "laconic_9000-2" chainId = "laconic-testnet-2"
privateKey = "" privateKey = "<redacted>"
bondId = "" bondId = "<redacted>"
authority = "snowballtools" authority = "deploy"
[registryConfig.fee] [registryConfig.fee]
gasPrice = "1alnt" gasPrice = "1alnt"
@ -45,6 +38,3 @@
revealFee = "100000" revealFee = "100000"
revealsDuration = "120s" revealsDuration = "120s"
denom = "alnt" denom = "alnt"
[misc]
projectDomain = ""

View File

@ -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 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 `<redacted>` with your credentials. Use the `userKey`, `bondId` and `authority` that you set up
### Start ### Start
@ -1379,18 +1460,18 @@
DEPLOYER_LRN=<target-deployer-lrn> DEPLOYER_LRN=<target-deployer-lrn>
``` ```
* Update required laconic config: * Update required laconic config. You can use the same `userKey` and `bondId` used for snowball-backend:
```bash ```bash
# Replace <user-pk> and <bond-id> # Replace <user-pk> and <bond-id>
cat <<EOF > config.yml cat <<EOF > config.yml
services: services:
registry: registry:
rpcEndpoint: https://laconicd.laconic.com rpcEndpoint: https://laconicd-sapo.laconic.com
gqlEndpoint: https://laconicd.laconic.com/api gqlEndpoint: https://laconicd-sapo.laconic.com/api
userKey: <user-pk> userKey: <user-pk>
bondId: <bond-id> bondId: <bond-id>
chainId: laconic_9000-2 chainId: laconic-testnet-2
gasPrice: 1alnt gasPrice: 1alnt
EOF EOF
``` ```