laconic-registry-cli/deploy-records.md

2.4 KiB

Records Demo

  • Create and populate config.yml

  • Publish watcher records from records/watcher:

    # Publishes records and corresponding 'deployment' records from the given directory
    yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher
    
  • View the records at laconicd GQL endpoint http://localhost:9473:

    {
      queryRecords {
        id
        bondId
        names
        attributes {
          key
          value {
            ... on BooleanValue { bool: value }
            ... on IntValue { int: value }
            ... on FloatValue { float: value }
            ... on StringValue { string: value }
            ... on BytesValue { bytes: value }
            ... on LinkValue { link: value }
            ... on ArrayValue {
              array: value {
                ... on BooleanValue { bool: value }
                ... on IntValue { int: value }
                ... on FloatValue { float: value }
                ... on StringValue { string: value }
                ... on BytesValue { bytes: value }
                ... on LinkValue { link: value }
              }
            }
            ... on MapValue { map: value { key mapping: value { __typename } } }
          }
        }
      }
    }
    
  • Query with filters, for example: query all filecoin WatcherRecords:

    {
      queryRecords (
        attributes: [
          {
            key: "type",
            value: {
              string: "WatcherRecord"
            }
          },
          {
            key: "chain",
            value: {
              string: "filecoin"
            }
          }
        ],
        all: true
      ) {
        id
        bondId
        names
        attributes {
          key
          value {
            ... on BooleanValue { bool: value }
            ... on IntValue { int: value }
            ... on FloatValue { float: value }
            ... on StringValue { string: value }
            ... on BytesValue { bytes: value }
            ... on LinkValue { link: value }
            ... on ArrayValue {
              array: value {
                ... on BooleanValue { bool: value }
                ... on IntValue { int: value }
                ... on FloatValue { float: value }
                ... on StringValue { string: value }
                ... on BytesValue { bytes: value }
                ... on LinkValue { link: value }
              }
            }
            ... on MapValue { map: value { key mapping: value {  __typename } } }
          }
        }
      }
    }