diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/README.md b/stack-orchestrator/stacks/fixturenet-laconicd/README.md index 836ffd2..5607c18 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/README.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/README.md @@ -82,6 +82,26 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso cp fixturenet-laconicd-deployment/deployment.yml laconic-console-deployment/deployment.yml ``` +## Configuration + +* Inside the `laconic-console-deployment` deployment directory, open `config.env` file and set following env variables: + + ```bash + # Optional CLI configuration + + # laconicd user private key for txs + CERC_LACONICD_USER_KEY= + + # laconicd bond id for txs + CERC_LACONICD_BOND_ID= + + # Gas limit for txs (default: 200000) + CERC_LACONICD_GAS= + + # Max fees for txs (default: 200000photon) + CERC_LACONICD_FEES= + ``` + ## Start the deployment ```bash diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md index 881a794..d3102eb 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -1,4 +1,93 @@ # records-demo - +## Setup +* Set account key and bond id in the CLI config: + + ```bash + # Get the PK from your node + ALICE_PK=$(echo y | laconic-so deployment --dir fixturenet-laconicd-deployment exec laconicd "laconicd keys export alice --unarmored-hex --unsafe") + + # Create a bond: + BOND_ID=$(laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type photon --quantity 100000000000 --user-key $ALICE_PK" | jq -r '.bondId') + + # Update CLI config + laconic-so deployment --dir laconic-console-deployment exec cli "CERC_LACONICD_USER_KEY=${ALICE_PK} CERC_LACONICD_BOND_ID=${BOND_ID} CERC_LACONICD_GAS=900000 /app/create-config.sh" + + # Note: Update the values in 'laconic-console-deployment/config.env' accordingly before restarting + ``` + +## Run + +* Copy over all records from a dir to the data dir in `laconic-console-deployment` (`laconic-console-deployment/data/laconic-registry-data`): + + ```bash + # Example + cp -r /home/user/laconic-testnet-data/records/* laconic-console-deployment/data/laconic-registry-data/ + ``` + +* Publish all records from the `laconic-registry-data` directory: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data" + ``` + +## Query + +* All the published records can be viewed on the console at + +* Query for `geth` service deployment(s): + + * Find the `ServiceRecord` for `geth`: + + ```bash + SERVICE_RECORD_ID=$(laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type ServiceRecord --name geth | jq -r '.[].id'") + ``` + + * Find corresponding deployment(s): + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type ServiceDeploymentRecord service $SERVICE_RECORD_ID" + + # Get the deployment URL(s) + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type ServiceDeploymentRecord service $SERVICE_RECORD_ID | jq -r '.[].attributes.url'" + + # Expected output: + # https://geth-rpc-endpoint-1.example.com + # https://geth-rpc-endpoint-2.example.com + ``` + +* Query for `azimuth-watcher` deployment(s): + + * Find the `WatcherRecord` for `azimuth-watcher`: + + ```bash + WATCHER_RECORD_ID=$(laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type WatcherRecord --name azimuth-watcher | jq -r '.[].id'") + ``` + + * Find corresponding deployment(s): + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID" + + # Get the deployment URL(s) + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID | jq -r '.[].attributes.url'" + + # Expected output: + https://azimuth-watcher-endpoint.example.com + ``` + +* Find the `RepositoryRecord` for `azimuth-watcher-ts` repo: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type RepositoryRecord --name azimuth-watcher-ts" + + # Get the repo URL + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type RepositoryRecord --name azimuth-watcher-ts | jq -r '.[].attributes.url'" + ``` + +* Find the `StackRecord` for `azimuth` stack: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type StackRecord --name azimuth" + ```