From 85395b44b143c65c77194e59e5980cc75f56db9e Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 21 Jun 2024 09:06:48 +0530 Subject: [PATCH 1/7] Update instructions to setup laconic-console as part of deployment --- .../docker-compose-fixturenet-laconicd.yml | 2 +- .../{scripts => }/create-fixturenet.sh | 0 .../stacks/fixturenet-laconicd/README.md | 49 ++++++++++++++++++- .../fixturenet-laconicd/records-demo.md | 4 ++ 4 files changed, 53 insertions(+), 2 deletions(-) rename stack-orchestrator/config/fixturenet-laconicd/{scripts => }/create-fixturenet.sh (100%) create mode 100644 stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md diff --git a/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml b/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml index 6d92073..a47d3bc 100644 --- a/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml +++ b/stack-orchestrator/compose/docker-compose-fixturenet-laconicd.yml @@ -8,7 +8,7 @@ services: TEST_REGISTRY_EXPIRY: ${TEST_REGISTRY_EXPIRY:-false} volumes: - laconicd-data:/root/.laconicd - - ../config/fixturenet-laconicd/scripts/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh + - ../config/fixturenet-laconicd/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh ports: - "6060" - "26657" diff --git a/stack-orchestrator/config/fixturenet-laconicd/scripts/create-fixturenet.sh b/stack-orchestrator/config/fixturenet-laconicd/create-fixturenet.sh similarity index 100% rename from stack-orchestrator/config/fixturenet-laconicd/scripts/create-fixturenet.sh rename to stack-orchestrator/config/fixturenet-laconicd/create-fixturenet.sh diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/README.md b/stack-orchestrator/stacks/fixturenet-laconicd/README.md index 1429121..836ffd2 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/README.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/README.md @@ -1,36 +1,57 @@ # fixturenet-laconicd-stack +Instructions for running a laconicd fixturenet along with registry CLI and console + ## Setup -* Clone the stack repo +* Clone the stack repos: ```bash laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack + laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack ``` * Clone required repositories: ```bash + # laconicd laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd setup-repositories + + # laocnic cli and console + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories ``` * Build the container images: ```bash + # laconicd laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers + + # laocnic cli and console + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers ``` + This should create the following docker images locally: + + * `cerc/laconic2d` + * `cerc/laconic2-registry-cli` + * `cerc/webapp-base` + * `cerc/laconic2-console-host` + ## Create a deployment * Create a spec file for the deployment: ```bash laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output fixturenet-laconicd-spec.yml + + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml ``` * Edit `network` in the spec file to map container ports to host ports as required: ```bash + # testnet-laconicd-spec.yml ... network: ports: @@ -41,18 +62,31 @@ - '9473:9473' - '9090:9090' - '1317:1317' + + # laconic-console-spec.yml + ... + network: + ports: + console: + - '8080:80' ``` * Create a deployment from the spec file: ```bash laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file fixturenet-laconicd-spec.yml --deployment-dir fixturenet-laconicd-deployment + + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy create --spec-file laconic-console-spec.yml --deployment-dir laconic-console-deployment + + # Place them both in the same namespace (cluster) + cp fixturenet-laconicd-deployment/deployment.yml laconic-console-deployment/deployment.yml ``` ## Start the deployment ```bash laconic-so deployment --dir fixturenet-laconicd-deployment start +laconic-so deployment --dir laconic-console-deployment start ``` ## Check status @@ -67,6 +101,19 @@ laconic-so deployment --dir fixturenet-laconicd-deployment start laconic-so deployment --dir fixturenet-laconicd-deployment logs laconicd -f ``` +* View the laconic console at + +* Use the cli service for registry CLI operations: + + ```bash + # Example + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry status" + ``` + +## Demo + +* Follow the [records-demo](./records-demo.md) to try loading data into registry + ## Clean up * Stop all services running in the background: diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md new file mode 100644 index 0000000..881a794 --- /dev/null +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -0,0 +1,4 @@ +# records-demo + + + -- 2.45.2 From 662b3a051db5f0a456a4b83025e9e16ec3ce2757 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 21 Jun 2024 11:06:02 +0530 Subject: [PATCH 2/7] Add demo instructions to publish and query records using CLI --- .../stacks/fixturenet-laconicd/README.md | 20 ++++ .../fixturenet-laconicd/records-demo.md | 91 ++++++++++++++++++- 2 files changed, 110 insertions(+), 1 deletion(-) 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" + ``` -- 2.45.2 From 008292867a680e294d310b6e0569a223a9c5da40 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 21 Jun 2024 14:47:27 +0530 Subject: [PATCH 3/7] Publish repository records first --- .../stacks/fixturenet-laconicd/README.md | 4 ++-- .../stacks/fixturenet-laconicd/records-demo.md | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/README.md b/stack-orchestrator/stacks/fixturenet-laconicd/README.md index 5607c18..8dba1e3 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/README.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/README.md @@ -40,7 +40,7 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso ## Create a deployment -* Create a spec file for the deployment: +* Create spec files for the deployment: ```bash laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output fixturenet-laconicd-spec.yml @@ -71,7 +71,7 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso - '8080:80' ``` -* Create a deployment from the spec file: +* Create deployment from the spec files: ```bash laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file fixturenet-laconicd-spec.yml --deployment-dir fixturenet-laconicd-deployment diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md index d3102eb..94e7636 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -23,13 +23,19 @@ ```bash # Example - cp -r /home/user/laconic-testnet-data/records/* laconic-console-deployment/data/laconic-registry-data/ + cp -r /home/user/laconic-testnet-data/records/repo laconic-console-deployment/data/laconic-registry-data/ + + rsync -av --exclude 'repo' /home/user/laconic-testnet-data/records laconic-console-deployment/data/laconic-registry-data/ ``` -* Publish all records from the `laconic-registry-data` directory: +* Publish 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" + # Publish repository records first + laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/repo" + + # Publish rest of the records + laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/records" ``` ## Query -- 2.45.2 From 5d6200a4392444ea763dfeb627a451a4607c66ab Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 21 Jun 2024 15:55:53 +0530 Subject: [PATCH 4/7] Update demo steps for stack records --- .../stacks/fixturenet-laconicd/README.md | 4 +-- .../fixturenet-laconicd/records-demo.md | 29 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/README.md b/stack-orchestrator/stacks/fixturenet-laconicd/README.md index 8dba1e3..ee1281d 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/README.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/README.md @@ -17,7 +17,7 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso # laconicd laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd setup-repositories - # laocnic cli and console + # laconic cli and console laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories ``` @@ -27,7 +27,7 @@ Instructions for running a laconicd fixturenet along with registry CLI and conso # laconicd laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers - # laocnic cli and console + # laconic cli and console laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers ``` diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md index 94e7636..a224653 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -23,7 +23,7 @@ ```bash # Example - cp -r /home/user/laconic-testnet-data/records/repo laconic-console-deployment/data/laconic-registry-data/ + cp -r /home/user/laconic-testnet-data/records/repo laconic-console-deployment/data/laconic-registry-data/repo-records rsync -av --exclude 'repo' /home/user/laconic-testnet-data/records laconic-console-deployment/data/laconic-registry-data/ ``` @@ -32,7 +32,7 @@ ```bash # Publish repository records first - laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/repo" + laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/repo-records" # Publish rest of the records laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/records" @@ -83,17 +83,22 @@ https://azimuth-watcher-endpoint.example.com ``` -* Find the `RepositoryRecord` for `azimuth-watcher-ts` repo: +* Query for `bsc-node` stack: - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type RepositoryRecord --name azimuth-watcher-ts" + * Find the `StackRecord` for `bsc-node` stack: - # 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'" - ``` + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type StackRecord --name bsc-node" -* Find the `StackRecord` for `azimuth` stack: + # Get the repo record id + STACK_REPO_RECORD_ID=$(laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type StackRecord --name bsc-node | jq -r '.[].attributes.repository'") + ``` - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type StackRecord --name azimuth" - ``` + * Find the corresponding `RepositoryRecord`: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record get --id $STACK_REPO_RECORD_ID" + + # Get the repo URL + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record get --id $STACK_REPO_RECORD_ID | jq -r '.[].attributes.url'" + ``` -- 2.45.2 From 58407d4cf4404b1f69b916c50237ac83eca3e281 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 24 Jun 2024 16:21:40 +0530 Subject: [PATCH 5/7] Add demo records --- .../config/demo-records/demo-record-1.yml | 7 +++++ .../config/demo-records/demo-record-10.yml | 14 ++++++++++ .../config/demo-records/demo-record-11.yml | 12 ++++++++ .../config/demo-records/demo-record-12.yml | 17 +++++++++++ .../config/demo-records/demo-record-2.yml | 7 +++++ .../config/demo-records/demo-record-3.yml | 7 +++++ .../config/demo-records/demo-record-4.yml | 7 +++++ .../config/demo-records/demo-record-5.yml | 7 +++++ .../config/demo-records/demo-record-6.yml | 7 +++++ .../config/demo-records/demo-record-7.yml | 11 ++++++++ .../config/demo-records/demo-record-8.yml | 18 ++++++++++++ .../config/demo-records/demo-record-9.yml | 17 +++++++++++ .../fixturenet-laconicd/records-demo.md | 28 +++++++++++++++---- 13 files changed, 154 insertions(+), 5 deletions(-) create mode 100644 stack-orchestrator/config/demo-records/demo-record-1.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-10.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-11.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-12.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-2.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-3.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-4.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-5.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-6.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-7.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-8.yml create mode 100644 stack-orchestrator/config/demo-records/demo-record-9.yml diff --git a/stack-orchestrator/config/demo-records/demo-record-1.yml b/stack-orchestrator/config/demo-records/demo-record-1.yml new file mode 100644 index 0000000..47b328c --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-1.yml @@ -0,0 +1,7 @@ +record: + type: WebsiteRegistrationRecord + url: 'https://hello-urbit.laconic.com' + repo_registration_record_cid: QmTZQ8ZJS6mALjEM2wY71msFno6zzxFftVCiZELj9xREPx + build_artifact_cid: '~lostex-rabdur-labtul-moltev/hello-urbit' + tls_cert_cid: QmR1acEmQt7Tjmhp9cFtymie2eFcrHURQKt9kGto1TQTW1 + version: 0.2.4 diff --git a/stack-orchestrator/config/demo-records/demo-record-10.yml b/stack-orchestrator/config/demo-records/demo-record-10.yml new file mode 100644 index 0000000..a467903 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-10.yml @@ -0,0 +1,14 @@ +record: + type: ApplicationDeploymentRecord + version: 1.2.3 + name: name + description: description + application: application + url: url + dns: dns + request: request + meta: + foo: bar + tags: + - a + - b diff --git a/stack-orchestrator/config/demo-records/demo-record-11.yml b/stack-orchestrator/config/demo-records/demo-record-11.yml new file mode 100644 index 0000000..3afbd64 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-11.yml @@ -0,0 +1,12 @@ +record: + type: GeneralRecord + version: 1.2.3 + name: name + description: description + category: category + value: value + meta: + foo: bar + tags: + - a + - b diff --git a/stack-orchestrator/config/demo-records/demo-record-12.yml b/stack-orchestrator/config/demo-records/demo-record-12.yml new file mode 100644 index 0000000..4c5f024 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-12.yml @@ -0,0 +1,17 @@ +record: + type: ApplicationArtifact + version: 1.2.3 + name: name + description: description + application: appidgoeshere + content_type: content_type + os: os + cpu: cpu + uri: + - uri://a + - uri://b + meta: + foo: bar + tags: + - a + - b diff --git a/stack-orchestrator/config/demo-records/demo-record-2.yml b/stack-orchestrator/config/demo-records/demo-record-2.yml new file mode 100644 index 0000000..eae0cf8 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-2.yml @@ -0,0 +1,7 @@ +record: + type: WebsiteRegistrationRecord + url: 'https://dev-hello-urbit.laconic.com' + repo_registration_record_cid: QmPbKkK7gKojnGAgKAE6bK5qBY8BcYp2YDB1e4b28NxvVv + build_artifact_cid: '~lostex-rabdur-labtul-moltev/hello-urbit-dev' + tls_cert_cid: QmWbCv4k9Q9P6XptHNJN6EupDyKVLSLRV6W6T2sAYkfBxr + version: 0.2.5 diff --git a/stack-orchestrator/config/demo-records/demo-record-3.yml b/stack-orchestrator/config/demo-records/demo-record-3.yml new file mode 100644 index 0000000..3197b24 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-3.yml @@ -0,0 +1,7 @@ +record: + type: WebsiteRegistrationRecord + url: 'https://app.osmosis.zone' + repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D + build_artifact_cid: '~larryx-woldyr/osmosis:latest' + tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR + version: 1.3.5 diff --git a/stack-orchestrator/config/demo-records/demo-record-4.yml b/stack-orchestrator/config/demo-records/demo-record-4.yml new file mode 100644 index 0000000..f892ac8 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-4.yml @@ -0,0 +1,7 @@ +record: + type: WebsiteRegistrationRecord + url: 'https://dev.osmosis.zone' + repo_registration_record_cid: QmPbKkK7gKojnGAgKAE6bK5qBY8BcYp2YDB1e4b28NxvVv + build_artifact_cid: '~larryx-woldyr/osmosis:dev' + tls_cert_cid: QmWbCv4k9Q9P6XptHNJN6EupDyKVLSLRV6W6T2sAYkfBxr + version: 1.3.6 diff --git a/stack-orchestrator/config/demo-records/demo-record-5.yml b/stack-orchestrator/config/demo-records/demo-record-5.yml new file mode 100644 index 0000000..d4e21bb --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-5.yml @@ -0,0 +1,7 @@ +record: + type: WebsiteRegistrationRecord + url: 'https://pwa-1-1-3.iglootools.xyz' + repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D + build_artifact_cid: https://ipfs.io/ipfs/QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 + tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR + version: 1.1.3 diff --git a/stack-orchestrator/config/demo-records/demo-record-6.yml b/stack-orchestrator/config/demo-records/demo-record-6.yml new file mode 100644 index 0000000..9e1ffae --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-6.yml @@ -0,0 +1,7 @@ +record: + type: WebsiteRegistrationRecord + url: 'https://pwa-1-2-3.iglootools.xyz' + repo_registration_record_cid: QmVjYQ59z3fuKfYUV1aXhDR82JAKxdqB5JMPfUsHkJUkJq + build_artifact_cid: https://ipfs.io/ipfs/QmN2yevgjC92gzGi2BY6Q2yBWmR6JNWQ9yscoPPyy1V2Hv + tls_cert_cid: QmTAnmDMSnzqAN3yyXtFD4KpyATkeze62ZkbmXHjJ8xQW8 + version: 1.2.3 diff --git a/stack-orchestrator/config/demo-records/demo-record-7.yml b/stack-orchestrator/config/demo-records/demo-record-7.yml new file mode 100644 index 0000000..1bf4ad4 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-7.yml @@ -0,0 +1,11 @@ +record: + type: DnsRecord + version: 0.0.1 + name: "foo" + resource_type: "A" + value: "bar" + meta: + foo: bar + tags: + - a + - b diff --git a/stack-orchestrator/config/demo-records/demo-record-8.yml b/stack-orchestrator/config/demo-records/demo-record-8.yml new file mode 100644 index 0000000..95bd195 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-8.yml @@ -0,0 +1,18 @@ +record: + type: ApplicationRecord + version: 0.0.1 + name: my-demo-app + description: "Description of my app" + homepage: http://my.demo.app + license: license + author: author + repository: + - "https://my.demo.repo" + repository_ref: "v0.1.0" + app_version: "0.1.0" + app_type: "webapp" + meta: + foo: bar + tags: + - a + - b diff --git a/stack-orchestrator/config/demo-records/demo-record-9.yml b/stack-orchestrator/config/demo-records/demo-record-9.yml new file mode 100644 index 0000000..415e5c7 --- /dev/null +++ b/stack-orchestrator/config/demo-records/demo-record-9.yml @@ -0,0 +1,17 @@ +record: + type: ApplicationDeploymentRequest + version: 1.2.3 + application: application + dns: dns + config: + env: + ENV_VAR_A: A + ENV_VAR_B: B + crn: + - crn://foo.bar + - crn://bar.baz + meta: + foo: bar + tags: + - a + - b diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md index a224653..541ac55 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -19,18 +19,25 @@ ## Run -* Copy over all records from a dir to the data dir in `laconic-console-deployment` (`laconic-console-deployment/data/laconic-registry-data`): +* Copy over all records from a dir to the data dir in `laconic-console-deployment` (`laconic-console-deployment/data/laconic-registry-data`) and publish the records: ```bash - # Example - cp -r /home/user/laconic-testnet-data/records/repo laconic-console-deployment/data/laconic-registry-data/repo-records + # Example: for demo records + # Copy over the records + cp -r /home/user/fixturenet-laconicd-stack/stack-orchestrator/config/demo-records laconic-console-deployment/data/laconic-registry-data/ - rsync -av --exclude 'repo' /home/user/laconic-testnet-data/records laconic-console-deployment/data/laconic-registry-data/ + # Publish the records from `laconic-registry-data` directory + laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/records" ``` -* Publish records from the `laconic-registry-data` directory: + OR ```bash + # Example: for testnet records + # Copy over the records + cp -r /home/user/laconic-testnet-data/records/repo laconic-console-deployment/data/laconic-registry-data/repo-records + rsync -av --exclude 'repo' /home/user/laconic-testnet-data/records laconic-console-deployment/data/laconic-registry-data/ + # Publish repository records first laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/repo-records" @@ -41,6 +48,17 @@ ## Query * All the published records can be viewed on the console at + * explore the console for more information + * click on the link aside a record that opens the GraphQL console + * the query is pre-loaded, run it and inspect the output + +### CLI Examples + +* Query all records: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list" + ``` * Query for `geth` service deployment(s): -- 2.45.2 From f80a76117ccb5185fb7e408c18138eadb8b649c4 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 24 Jun 2024 17:13:46 +0530 Subject: [PATCH 6/7] Add instructions to create a bond --- .../stacks/fixturenet-laconicd/README.md | 12 ++++++++++++ .../stacks/fixturenet-laconicd/records-demo.md | 7 ++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/README.md b/stack-orchestrator/stacks/fixturenet-laconicd/README.md index ee1281d..891835f 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/README.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/README.md @@ -130,6 +130,18 @@ laconic-so deployment --dir laconic-console-deployment start laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry status" ``` +## Perform operations + +* Example (bond creation): + + ```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: + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type photon --quantity 100000000000 --user-key $ALICE_PK" | jq -r '.bondId' + ``` + ## Demo * Follow the [records-demo](./records-demo.md) to try loading data into registry diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md index 541ac55..af4dea3 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -5,11 +5,8 @@ * 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') + # Set bond id to the bond created earlier or create a new one + BOND_ID= # 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" -- 2.45.2 From 22ac6ee3cd5868ba9e60b39d4807f36cc9532ad8 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 25 Jun 2024 11:56:00 +0530 Subject: [PATCH 7/7] Avoid increasing gas for publishing records --- stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md index af4dea3..275bc6a 100644 --- a/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md +++ b/stack-orchestrator/stacks/fixturenet-laconicd/records-demo.md @@ -9,7 +9,7 @@ BOND_ID= # 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" + laconic-so deployment --dir laconic-console-deployment exec cli "CERC_LACONICD_USER_KEY=${ALICE_PK} CERC_LACONICD_BOND_ID=${BOND_ID} /app/create-config.sh" # Note: Update the values in 'laconic-console-deployment/config.env' accordingly before restarting ``` @@ -24,7 +24,7 @@ cp -r /home/user/fixturenet-laconicd-stack/stack-orchestrator/config/demo-records laconic-console-deployment/data/laconic-registry-data/ # Publish the records from `laconic-registry-data` directory - laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/records" + laconic-so deployment --dir laconic-console-deployment exec cli "yarn ts-node demo/scripts/publish-records.ts --config config.yml --records /laconic-registry-data/demo-records" ``` OR -- 2.45.2