2024-05-08 09:51:23 +00:00
|
|
|
# Registry Demo
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
* Run the laconicd chain:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# In laconcid
|
|
|
|
make install
|
|
|
|
./scripts/init.sh clean
|
|
|
|
```
|
|
|
|
|
|
|
|
* Create and populate `config.yml` following [config.example.yml](./config.example.yml):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Get user key
|
|
|
|
laconicd keys export alice --unarmored-hex --unsafe --keyring-backend test --home ~/.laconicd
|
|
|
|
|
|
|
|
# Create a bond
|
|
|
|
laconicd tx bond create 100000000000photon --fees 100photon --from alice
|
|
|
|
|
|
|
|
# Get the bond id
|
|
|
|
laconicd query bond list
|
|
|
|
```
|
|
|
|
|
|
|
|
* Install the CLI:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
yarn && yarn build
|
|
|
|
yarn global add file:$PWD
|
|
|
|
```
|
|
|
|
|
|
|
|
## Run
|
|
|
|
|
2024-05-08 10:17:42 +00:00
|
|
|
* Publish records from [`demo/records`](./demo/records):
|
2024-05-08 09:51:23 +00:00
|
|
|
|
|
|
|
```bash
|
2024-05-08 10:17:42 +00:00
|
|
|
# Publishes records and corresponding 'deployment' records
|
|
|
|
yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records
|
2024-05-08 09:51:23 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Example
|
|
|
|
|
|
|
|
* Query for `ajna-watcher` deployment(s):
|
|
|
|
|
|
|
|
* Find the `WatcherRecord` for `ajna-watcher`:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
WATCHER_RECORD_ID=$(laconic registry record list --all --type WatcherRecord --name ajna-watcher | jq -r '.[].id')
|
|
|
|
```
|
|
|
|
|
|
|
|
* Find corresponding deployment(s):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID
|
|
|
|
|
|
|
|
# Get the deployment URL(s)
|
|
|
|
laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID | jq -r '.[].attributes.url'
|
|
|
|
```
|