laconic-registry-cli/demo
2024-05-09 11:02:24 +05:30
..
records Update records 2024-05-09 11:02:24 +05:30
scripts Read and publish record files recursively 2024-05-08 15:51:26 +05:30
README.md Update records 2024-05-09 11:02:24 +05:30

Registry Demo

Setup

  • Run the laconicd chain:

    # In laconcid
    make install
    ./scripts/init.sh clean
    
  • Create and populate config.yml following config.example.yml:

    # 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:

    yarn && yarn build
    yarn global add file:$PWD
    

Run

  • Publish records from demo/records:

    # Publishes records and corresponding 'deployment' records
    # In laconic-registry-cli
    yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records
    

Example

  • Query for ajna-watcher deployment(s):

    • Find the WatcherRecord for ajna-watcher:

      WATCHER_RECORD_ID=$(laconic registry record list --all --type WatcherRecord --name ajna-watcher | jq -r '.[].id')
      
    • Find corresponding deployment(s):

      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'
      
  • Query for sushiswap-v3-subgraph deployment(s):

    • Find the SubgraphRecord for sushiswap-v3-subgraph:

      SUBGRAPH_RECORD_ID=$(laconic registry record list --all --type SubgraphRecord --name sushiswap-v3-subgraph | jq -r '.[].id')
      
    • Find corresponding deployment(s):

      laconic registry record list --all --type SubgraphDeploymentRecord subgraph $SUBGRAPH_RECORD_ID
      
      # Get the deployment URL(s)
      laconic registry record list --all --type SubgraphDeploymentRecord subgraph $SUBGRAPH_RECORD_ID | jq -r '.[].attributes.url'
      
  • Query for geth service deployment(s):

    • Find the ServiceRecord for geth:

      SERVICE_RECORD_ID=$(laconic registry record list --all --type ServiceRecord --name geth | jq -r '.[].id')
      
    • Find corresponding deployment(s):

      laconic registry record list --all --type ServiceDeploymentRecord service $SERVICE_RECORD_ID
      
      # Get the deployment URL(s)
      laconic registry record list --all --type ServiceDeploymentRecord service $SERVICE_RECORD_ID | jq -r '.[].attributes.url'