From 3d0ac80cde91e9825f718c49c340a7cf229db741 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 7 May 2024 16:06:59 +0530 Subject: [PATCH 01/20] Add a script to publish records from json files to a registry --- README.md | 44 ++++++++++++++++ endpoint-records/.gitkeep | 0 package.json | 1 + src/publish-endponit-records.ts | 77 +++++++++++++++++++++++++++ src/types/common/main.d.ts | 5 ++ src/types/common/package.json | 6 +++ tsconfig.json | 4 +- yarn.lock | 93 ++++++++++++++++++++++++++++++++- 8 files changed, 227 insertions(+), 3 deletions(-) create mode 100644 endpoint-records/.gitkeep create mode 100644 src/publish-endponit-records.ts create mode 100644 src/types/common/main.d.ts create mode 100644 src/types/common/package.json diff --git a/README.md b/README.md index 1c98b03..1011f50 100644 --- a/README.md +++ b/README.md @@ -544,3 +544,47 @@ Reassociate records (switch bond): ```bash $ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0 --new-bond-id 3e11c61f179897e4b12e9b63de35d36f88ac146755e7a28ce0bcdd07cf3a03ae ``` + +## Endpoint Records Demo + +* Create and populate `config.yml` + +* Publish records from [`endpoint-records`](./endpoint-records): + + ```bash + yarn ts-node src/publish-endponit-records.ts -c config.yml -r endpoint-records + ``` + +* View the records at : + + ```gql + { + 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 } } } + } + } + } + } + ``` diff --git a/endpoint-records/.gitkeep b/endpoint-records/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index b9d7c80..aa277ce 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "husky": "^9.0.2", "jest": "29.0.0", "ts-jest": "^29.0.2", + "ts-node": "^10.2.1", "typescript": "^4.6.3" }, "dependencies": { diff --git a/src/publish-endponit-records.ts b/src/publish-endponit-records.ts new file mode 100644 index 0000000..08eef81 --- /dev/null +++ b/src/publish-endponit-records.ts @@ -0,0 +1,77 @@ +import yargs from 'yargs'; +import fs from 'fs'; +import path from 'path'; +import { hideBin } from 'yargs/helpers'; +import { Registry } from '@cerc-io/registry-sdk'; + +import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from './util'; + +async function main () { + const argv = getArgs(); + const { records: recordsDir, config } = argv; + + const { services: { registry: registryConfig } } = getConfig(config as string); + const { rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig); + + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); + const fee = getGasAndFees(argv, registryConfig); + + await fs.readdir(recordsDir, async (err, files) => { + if (err) { + console.error('Error reading directory:', err); + return; + } + + // Filter JSON files + const jsonFiles = files.filter(file => path.extname(file).toLowerCase() === '.json'); + + // Read content of each JSON file + for (let i = 0; i < jsonFiles.length; i++) { + const file = jsonFiles[i]; + + const filePath = path.resolve(recordsDir, file); + + let record; + try { + const data = fs.readFileSync(filePath, 'utf8'); + record = JSON.parse(data); + } catch (error) { + console.error(`Error reading file ${file}:`, err); + } + + // TODO: validate the records using a schema + + const result = await registry.setRecord({ privateKey: userKey, record, bondId }, userKey, fee); + + console.log(`Published record ${file}`); + txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose); + } + }); +} + +function getArgs (): any { + return yargs(hideBin(process.argv)).parserConfiguration({ + 'parse-numbers': false + }).usage('Usage: $0 [options]') + .option('config', { + alias: 'c', + describe: 'Config', + type: 'string', + demandOption: true + }) + .option('records', { + alias: 'r', + describe: 'Endpoint records', + type: 'string', + demandOption: true + }) + .help().argv; +} + +main() + .catch(err => { + console.error(err); + }) + .then(() => { + console.log('Done'); + }); diff --git a/src/types/common/main.d.ts b/src/types/common/main.d.ts new file mode 100644 index 0000000..da0661c --- /dev/null +++ b/src/types/common/main.d.ts @@ -0,0 +1,5 @@ +// +// Copyright 2022 Vulcanize, Inc. +// + +declare module 'lodash-clean'; diff --git a/src/types/common/package.json b/src/types/common/package.json new file mode 100644 index 0000000..5861d0f --- /dev/null +++ b/src/types/common/package.json @@ -0,0 +1,6 @@ +{ + "name": "common", + "version": "0.1.0", + "license": "AGPL-3.0", + "typings": "main.d.ts" +} diff --git a/tsconfig.json b/tsconfig.json index 7e6e42a..3641834 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,7 +30,9 @@ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ + "typeRoots": [ + "./src/types" + ], // "types": [], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "resolveJsonModule": true, /* Enable importing .json files */ diff --git a/yarn.lock b/yarn.lock index a21f606..7b55ecb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -562,6 +562,13 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -1186,6 +1193,11 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -1201,6 +1213,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.22" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" @@ -1378,6 +1398,26 @@ link-module-alias "^1.2.0" shx "^0.3.4" +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/babel__core@^7.1.14": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -1648,7 +1688,12 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.9.0: +acorn-walk@^8.1.1: + version "8.3.2" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" + integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + +acorn@^8.4.1, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -1707,6 +1752,11 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2242,6 +2292,11 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2331,6 +2386,11 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -4072,7 +4132,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -4968,6 +5028,25 @@ ts-jest@^29.0.2: semver "^7.5.3" yargs-parser "^21.0.1" +ts-node@^10.2.1: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -5111,6 +5190,11 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-to-istanbul@^9.0.1: version "9.2.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" @@ -5254,6 +5338,11 @@ yargs@^17.4.1: y18n "^5.0.5" yargs-parser "^21.0.0" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" -- 2.45.2 From 9f094ec9d492551663e0a78d588afceeb5a09c7a Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 7 May 2024 19:15:29 +0530 Subject: [PATCH 02/20] Add ajna watcher and watcher deployment records --- README.md | 10 ++++++++-- endpoint-records/.gitkeep | 0 .../AjnaWatcherDeploymentRecord.json | 10 ++++++++++ records/watcher/AjnaWatcherRecord.json | 11 +++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) delete mode 100644 endpoint-records/.gitkeep create mode 100644 records/watcher-deployments/AjnaWatcherDeploymentRecord.json create mode 100644 records/watcher/AjnaWatcherRecord.json diff --git a/README.md b/README.md index 1011f50..f0f9f08 100644 --- a/README.md +++ b/README.md @@ -549,10 +549,16 @@ $ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b5 * Create and populate `config.yml` -* Publish records from [`endpoint-records`](./endpoint-records): +* Publish watcher records from [`records/watcher`](./records/watcher): ```bash - yarn ts-node src/publish-endponit-records.ts -c config.yml -r endpoint-records + yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher + ``` + +* Publish watcher deployment records from [`records/watcher-deployments`](./records/watcher-deployments): + + ```bash + yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher-deployments ``` * View the records at : diff --git a/endpoint-records/.gitkeep b/endpoint-records/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/records/watcher-deployments/AjnaWatcherDeploymentRecord.json b/records/watcher-deployments/AjnaWatcherDeploymentRecord.json new file mode 100644 index 0000000..7774102 --- /dev/null +++ b/records/watcher-deployments/AjnaWatcherDeploymentRecord.json @@ -0,0 +1,10 @@ +{ + "type": "WatcherDeploymentRecord", + "version": "0.0.1", + "schema_id": "watcher-deployment-record-schema-id", + "name": "ajna-watcher", + "watcher": "watcher-record-id", + "request": "", + "url": "https://ajna-watcher-endpoint.example.com", + "kind": "active" +} diff --git a/records/watcher/AjnaWatcherRecord.json b/records/watcher/AjnaWatcherRecord.json new file mode 100644 index 0000000..a8f1530 --- /dev/null +++ b/records/watcher/AjnaWatcherRecord.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherRecord", + "version": "0.0.1", + "schema_id": "watcher-record-schema-id", + "name": "ajna-watcher", + "repository": "https://git.vdb.to/cerc-io/ajna-watcher-ts", + "repository_ref": "66b8d96308eacab1ef6a4f3cb74a0f28fb18dc67", + "watcher_version": "0.1.3", + "is_subgraph_watcher": true, + "chain": "filecoin" +} -- 2.45.2 From 69ba40d75836bc4f76b64d0ad0fceec1b66061a0 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 7 May 2024 19:25:51 +0530 Subject: [PATCH 03/20] Add an example GQL query with record filters --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index f0f9f08..27baa6c 100644 --- a/README.md +++ b/README.md @@ -594,3 +594,53 @@ $ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b5 } } ``` + +* Query with filters, for example: query all `filecoin` `WatcherRecord`s: + + ```gql + { + 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 } } } + } + } + } + } + ``` -- 2.45.2 From 5584290e5a57abac56e4aef9431d87af7736c1ca Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 7 May 2024 21:04:54 +0530 Subject: [PATCH 04/20] Add watcher and watcher deployment records --- README.md | 2 +- .../{AjnaWatcherRecord.json => AjnaWatcher.json} | 4 ++-- records/watcher/AzimuthWatcher.json | 11 +++++++++++ records/watcher/MerklSushiswapWatcher.json | 11 +++++++++++ records/watcher/SushiswapWatcher.json | 11 +++++++++++ .../deployments/AjnaWatcherDeployment.json} | 11 ++++++----- .../watcher/deployments/AzimuthWatcherDeployment.json | 11 +++++++++++ .../deployments/MerklSushiswapWatcherDeployment.json | 11 +++++++++++ .../deployments/SushiswapWatcherDeployment.json | 11 +++++++++++ src/publish-endponit-records.ts | 2 +- 10 files changed, 76 insertions(+), 9 deletions(-) rename records/watcher/{AjnaWatcherRecord.json => AjnaWatcher.json} (80%) create mode 100644 records/watcher/AzimuthWatcher.json create mode 100644 records/watcher/MerklSushiswapWatcher.json create mode 100644 records/watcher/SushiswapWatcher.json rename records/{watcher-deployments/AjnaWatcherDeploymentRecord.json => watcher/deployments/AjnaWatcherDeployment.json} (51%) create mode 100644 records/watcher/deployments/AzimuthWatcherDeployment.json create mode 100644 records/watcher/deployments/MerklSushiswapWatcherDeployment.json create mode 100644 records/watcher/deployments/SushiswapWatcherDeployment.json diff --git a/README.md b/README.md index 27baa6c..cfa4262 100644 --- a/README.md +++ b/README.md @@ -561,7 +561,7 @@ $ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b5 yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher-deployments ``` -* View the records at : +* View the records at laconicd GQL endpoint : ```gql { diff --git a/records/watcher/AjnaWatcherRecord.json b/records/watcher/AjnaWatcher.json similarity index 80% rename from records/watcher/AjnaWatcherRecord.json rename to records/watcher/AjnaWatcher.json index a8f1530..2bd84ff 100644 --- a/records/watcher/AjnaWatcherRecord.json +++ b/records/watcher/AjnaWatcher.json @@ -1,7 +1,7 @@ { "type": "WatcherRecord", - "version": "0.0.1", - "schema_id": "watcher-record-schema-id", + "version": "0.1.0", + "schema": "", "name": "ajna-watcher", "repository": "https://git.vdb.to/cerc-io/ajna-watcher-ts", "repository_ref": "66b8d96308eacab1ef6a4f3cb74a0f28fb18dc67", diff --git a/records/watcher/AzimuthWatcher.json b/records/watcher/AzimuthWatcher.json new file mode 100644 index 0000000..a0193d0 --- /dev/null +++ b/records/watcher/AzimuthWatcher.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherRecord", + "version": "0.1.0", + "schema": "", + "name": "azimuth-watcher", + "repository": "https://github.com/cerc-io/azimuth-watcher-ts", + "repository_ref": "ffd8baa4bcdd0b0fff701d942de572b7ddf33191", + "watcher_version": "0.1.3", + "is_subgraph_watcher": false, + "chain": "ethereum" +} diff --git a/records/watcher/MerklSushiswapWatcher.json b/records/watcher/MerklSushiswapWatcher.json new file mode 100644 index 0000000..ee64b65 --- /dev/null +++ b/records/watcher/MerklSushiswapWatcher.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherRecord", + "version": "0.1.0", + "schema": "", + "name": "merkl-sushiswap-v3-watcher", + "repository": "https://github.com/cerc-io/merkl-sushiswap-v3-watcher-ts", + "repository_ref": "b7cf79883e73400ad064b0357208c167795ab521", + "watcher_version": "0.1.9", + "is_subgraph_watcher": true, + "chain": "filecoin" +} diff --git a/records/watcher/SushiswapWatcher.json b/records/watcher/SushiswapWatcher.json new file mode 100644 index 0000000..e11cb80 --- /dev/null +++ b/records/watcher/SushiswapWatcher.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherRecord", + "version": "0.1.0", + "schema": "", + "name": "sushiswap-v3-watcher", + "repository": "https://github.com/cerc-io/sushiswap-v3-watcher-ts", + "repository_ref": "2f9f4d1ca191805922a51d1e3b471c06314fbc64", + "watcher_version": "0.1.9", + "is_subgraph_watcher": true, + "chain": "filecoin" +} diff --git a/records/watcher-deployments/AjnaWatcherDeploymentRecord.json b/records/watcher/deployments/AjnaWatcherDeployment.json similarity index 51% rename from records/watcher-deployments/AjnaWatcherDeploymentRecord.json rename to records/watcher/deployments/AjnaWatcherDeployment.json index 7774102..f8a5335 100644 --- a/records/watcher-deployments/AjnaWatcherDeploymentRecord.json +++ b/records/watcher/deployments/AjnaWatcherDeployment.json @@ -1,10 +1,11 @@ { "type": "WatcherDeploymentRecord", - "version": "0.0.1", - "schema_id": "watcher-deployment-record-schema-id", - "name": "ajna-watcher", - "watcher": "watcher-record-id", + "version": "0.1.0", + "schema": "", "request": "", + "name": "ajna-watcher", + "watcher": "", + "kind": "active", "url": "https://ajna-watcher-endpoint.example.com", - "kind": "active" + "requires_api_key": "true" } diff --git a/records/watcher/deployments/AzimuthWatcherDeployment.json b/records/watcher/deployments/AzimuthWatcherDeployment.json new file mode 100644 index 0000000..0c6e414 --- /dev/null +++ b/records/watcher/deployments/AzimuthWatcherDeployment.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "azimuth-watcher", + "watcher": "", + "kind": "active", + "url": "https://azimuth-watcher-endpoint.example.com", + "requires_api_key": "false" +} diff --git a/records/watcher/deployments/MerklSushiswapWatcherDeployment.json b/records/watcher/deployments/MerklSushiswapWatcherDeployment.json new file mode 100644 index 0000000..0c04aee --- /dev/null +++ b/records/watcher/deployments/MerklSushiswapWatcherDeployment.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "merkl-sushiswap-v3-watcher", + "watcher": "", + "kind": "active", + "url": "https://merkl-sushiswap-v3-watcher-endpoint.example.com", + "requires_api_key": "false" +} diff --git a/records/watcher/deployments/SushiswapWatcherDeployment.json b/records/watcher/deployments/SushiswapWatcherDeployment.json new file mode 100644 index 0000000..ca2acf1 --- /dev/null +++ b/records/watcher/deployments/SushiswapWatcherDeployment.json @@ -0,0 +1,11 @@ +{ + "type": "WatcherDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "sushiswap-v3-watcher", + "watcher": "", + "kind": "active", + "url": "https://sushiswap-v3-watcher-endpoint.example.com", + "requires_api_key": "false" +} diff --git a/src/publish-endponit-records.ts b/src/publish-endponit-records.ts index 08eef81..5a0978f 100644 --- a/src/publish-endponit-records.ts +++ b/src/publish-endponit-records.ts @@ -72,6 +72,6 @@ main() .catch(err => { console.error(err); }) - .then(() => { + .finally(() => { console.log('Done'); }); -- 2.45.2 From 7a49cfe0bb45401d9e4bdfe2cc825ab0d31455c5 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 11:13:07 +0530 Subject: [PATCH 05/20] Populate watcher record id in the deployment record before publishing --- README.md | 100 -------------------------------- deploy-records.md | 94 ++++++++++++++++++++++++++++++ src/publish-endponit-records.ts | 82 ++++++++++++++++++-------- 3 files changed, 151 insertions(+), 125 deletions(-) create mode 100644 deploy-records.md diff --git a/README.md b/README.md index cfa4262..1c98b03 100644 --- a/README.md +++ b/README.md @@ -544,103 +544,3 @@ Reassociate records (switch bond): ```bash $ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0 --new-bond-id 3e11c61f179897e4b12e9b63de35d36f88ac146755e7a28ce0bcdd07cf3a03ae ``` - -## Endpoint Records Demo - -* Create and populate `config.yml` - -* Publish watcher records from [`records/watcher`](./records/watcher): - - ```bash - yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher - ``` - -* Publish watcher deployment records from [`records/watcher-deployments`](./records/watcher-deployments): - - ```bash - yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher-deployments - ``` - -* View the records at laconicd GQL endpoint : - - ```gql - { - 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` `WatcherRecord`s: - - ```gql - { - 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 } } } - } - } - } - } - ``` diff --git a/deploy-records.md b/deploy-records.md new file mode 100644 index 0000000..93f0c4d --- /dev/null +++ b/deploy-records.md @@ -0,0 +1,94 @@ +# Records Demo + +* Create and populate `config.yml` + +* Publish watcher records from [`records/watcher`](./records/watcher): + + ```bash + # 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 : + + ```gql + { + 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` `WatcherRecord`s: + + ```gql + { + 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 } } } + } + } + } + } + ``` diff --git a/src/publish-endponit-records.ts b/src/publish-endponit-records.ts index 5a0978f..fae97d7 100644 --- a/src/publish-endponit-records.ts +++ b/src/publish-endponit-records.ts @@ -2,6 +2,7 @@ import yargs from 'yargs'; import fs from 'fs'; import path from 'path'; import { hideBin } from 'yargs/helpers'; + import { Registry } from '@cerc-io/registry-sdk'; import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from './util'; @@ -11,42 +12,73 @@ async function main () { const { records: recordsDir, config } = argv; const { services: { registry: registryConfig } } = getConfig(config as string); + + if (registryConfig.userKey == null) { + throw new Error('userKey not set in config'); + } + + if (registryConfig.bondId == null) { + throw new Error('bondId not set in config'); + } + const { rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig); const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); - await fs.readdir(recordsDir, async (err, files) => { - if (err) { - console.error('Error reading directory:', err); - return; - } + // List record files + const files = fs.readdirSync(recordsDir); + const jsonFiles = files.filter(file => path.extname(file).toLowerCase() === '.json'); - // Filter JSON files - const jsonFiles = files.filter(file => path.extname(file).toLowerCase() === '.json'); + // Read record from each JSON file + for (let i = 0; i < jsonFiles.length; i++) { + const file = jsonFiles[i]; - // Read content of each JSON file - for (let i = 0; i < jsonFiles.length; i++) { - const file = jsonFiles[i]; + const filePath = path.resolve(recordsDir, file); + const record = readRecord(filePath); - const filePath = path.resolve(recordsDir, file); + // Publish record + const result = await registry.setRecord({ privateKey: userKey, record, bondId }, userKey, fee); - let record; - try { - const data = fs.readFileSync(filePath, 'utf8'); - record = JSON.parse(data); - } catch (error) { - console.error(`Error reading file ${file}:`, err); + console.log(`Published record from ${file}`); + txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose); + + // Find the deployment record using filename + const deploymentRecordsDir = path.resolve(recordsDir, 'deployments'); + + if (fs.statSync(deploymentRecordsDir).isDirectory()) { + const recordName = path.basename(file, path.extname(file)); + const deploymentRecordFile = `${recordName}Deployment.json`; + const deploymentRecordFilePath = path.resolve(deploymentRecordsDir, deploymentRecordFile); + + // Check if deployment record exists + if (fs.existsSync(deploymentRecordFilePath)) { + console.log(`Deployment record ${deploymentRecordFile} found`); + const deploymentRecord = readRecord(deploymentRecordFilePath); + + // Set watcher field to watcher record id + deploymentRecord.watcher = result.id; + + // Publish deployment record + const deploymentResult = await registry.setRecord({ privateKey: userKey, record: deploymentRecord, bondId }, userKey, fee); + + console.log(`Published deployment record from ${deploymentRecordFile}`); + txOutput(deploymentResult, JSON.stringify(deploymentResult, undefined, 2), argv.output, argv.verbose); } - - // TODO: validate the records using a schema - - const result = await registry.setRecord({ privateKey: userKey, record, bondId }, userKey, fee); - - console.log(`Published record ${file}`); - txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose); } - }); + } +} + +function readRecord (filePath: string): any { + let record; + try { + const data = fs.readFileSync(filePath, 'utf8'); + record = JSON.parse(data); + } catch (err) { + console.error(`Error reading file ${filePath}:`, err); + } + + return record; } function getArgs (): any { -- 2.45.2 From 4aba3d0168bad32105613dc251b627949c329fc1 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 12:35:40 +0530 Subject: [PATCH 06/20] Fetch record id from registry for deployment record --- src/publish-endponit-records.ts | 64 +++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/src/publish-endponit-records.ts b/src/publish-endponit-records.ts index fae97d7..571715d 100644 --- a/src/publish-endponit-records.ts +++ b/src/publish-endponit-records.ts @@ -7,9 +7,15 @@ import { Registry } from '@cerc-io/registry-sdk'; import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from './util'; +const recordTypeToRecordField = new Map([ + ['WatcherRecord', 'watcher'], + ['SubgraphRecord', 'subgraph'], + ['ServiceRecord', 'service'] +]); + async function main () { const argv = getArgs(); - const { records: recordsDir, config } = argv; + const { records: recordsDir, config, type: recordType } = argv; const { services: { registry: registryConfig } } = getConfig(config as string); @@ -31,6 +37,8 @@ async function main () { const jsonFiles = files.filter(file => path.extname(file).toLowerCase() === '.json'); // Read record from each JSON file + console.log('**************************************'); + console.log(`Publishing records from ${recordsDir}`); for (let i = 0; i < jsonFiles.length; i++) { const file = jsonFiles[i]; @@ -42,30 +50,44 @@ async function main () { console.log(`Published record from ${file}`); txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose); + } - // Find the deployment record using filename - const deploymentRecordsDir = path.resolve(recordsDir, 'deployments'); + // Check if deployment record files exist + const deploymentRecordsDir = path.resolve(recordsDir, 'deployments'); + if (!fs.statSync(deploymentRecordsDir).isDirectory()) { + return; + } - if (fs.statSync(deploymentRecordsDir).isDirectory()) { - const recordName = path.basename(file, path.extname(file)); - const deploymentRecordFile = `${recordName}Deployment.json`; - const deploymentRecordFilePath = path.resolve(deploymentRecordsDir, deploymentRecordFile); + console.log('**************************************'); + console.log(`Publishing deployment records from ${deploymentRecordsDir}`); - // Check if deployment record exists - if (fs.existsSync(deploymentRecordFilePath)) { - console.log(`Deployment record ${deploymentRecordFile} found`); - const deploymentRecord = readRecord(deploymentRecordFilePath); + // List record files + const deploymentFiles = fs.readdirSync(deploymentRecordsDir); + const deploymentJsonFiles = deploymentFiles.filter(file => path.extname(file).toLowerCase() === '.json'); - // Set watcher field to watcher record id - deploymentRecord.watcher = result.id; + for (let i = 0; i < deploymentJsonFiles.length; i++) { + const file = deploymentJsonFiles[i]; - // Publish deployment record - const deploymentResult = await registry.setRecord({ privateKey: userKey, record: deploymentRecord, bondId }, userKey, fee); + const filePath = path.resolve(deploymentRecordsDir, file); + const deploymentRecord = readRecord(filePath); - console.log(`Published deployment record from ${deploymentRecordFile}`); - txOutput(deploymentResult, JSON.stringify(deploymentResult, undefined, 2), argv.output, argv.verbose); - } + // Find record using name and given type + const recordName = deploymentRecord.name; + const queryResult = await registry.queryRecords({ type: recordType, name: recordName }, true); + if (queryResult.length === 0) { + throw new Error(`Record not found, type: ${recordType}, name: ${recordName}`); } + const recordId = queryResult[0].id; + + // Set record field to record id + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + deploymentRecord[recordTypeToRecordField.get(recordType)!] = recordId; + + // Publish record + const deploymentResult = await registry.setRecord({ privateKey: userKey, record: deploymentRecord, bondId }, userKey, fee); + + console.log(`Published record from ${file}`); + txOutput(deploymentResult, JSON.stringify(deploymentResult, undefined, 2), argv.output, argv.verbose); } } @@ -97,6 +119,12 @@ function getArgs (): any { type: 'string', demandOption: true }) + .option('type', { + alias: 't', + describe: 'Record type', + type: 'string', + demandOption: true + }) .help().argv; } -- 2.45.2 From f32a0d1cf102302198d6a78ec52fd86aaaa7b0ec Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 12:36:24 +0530 Subject: [PATCH 07/20] Update instructions --- deploy-records.md => records-demo.md | 49 +++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) rename deploy-records.md => records-demo.md (68%) diff --git a/deploy-records.md b/records-demo.md similarity index 68% rename from deploy-records.md rename to records-demo.md index 93f0c4d..2d182c0 100644 --- a/deploy-records.md +++ b/records-demo.md @@ -1,6 +1,32 @@ # Records Demo -* Create and populate `config.yml` +* 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 + ``` * Publish watcher records from [`records/watcher`](./records/watcher): @@ -9,6 +35,27 @@ yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher ``` +## Example + +* Query for `ajna-watcher` deployment: + + * 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' + ``` + +## Query GQL + * View the records at laconicd GQL endpoint : ```gql -- 2.45.2 From 7bdeab22f8e507cb0a3ba21a6b63dfefc22c325a Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 15:21:23 +0530 Subject: [PATCH 08/20] Refactor to demo dir --- demo/README.md | 59 ++++++++ .../records/subgraph/SushiswapV2Subgraph.json | 11 ++ .../SushiswapV2SubgraphDeployment.json | 11 ++ .../records}/watcher/AjnaWatcher.json | 2 +- .../records}/watcher/AzimuthWatcher.json | 2 +- .../watcher/MerklSushiswapWatcher.json | 2 +- .../records}/watcher/SushiswapWatcher.json | 2 +- .../deployments/AjnaWatcherDeployment.json | 2 +- .../deployments/AzimuthWatcherDeployment.json | 2 +- .../MerklSushiswapWatcherDeployment.json | 2 +- .../SushiswapWatcherDeployment.json | 2 +- .../scripts/publish-records.ts | 18 ++- records-demo.md | 141 ------------------ 13 files changed, 99 insertions(+), 157 deletions(-) create mode 100644 demo/README.md create mode 100644 demo/records/subgraph/SushiswapV2Subgraph.json create mode 100644 demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json rename {records => demo/records}/watcher/AjnaWatcher.json (92%) rename {records => demo/records}/watcher/AzimuthWatcher.json (92%) rename {records => demo/records}/watcher/MerklSushiswapWatcher.json (93%) rename {records => demo/records}/watcher/SushiswapWatcher.json (93%) rename {records => demo/records}/watcher/deployments/AjnaWatcherDeployment.json (88%) rename {records => demo/records}/watcher/deployments/AzimuthWatcherDeployment.json (88%) rename {records => demo/records}/watcher/deployments/MerklSushiswapWatcherDeployment.json (89%) rename {records => demo/records}/watcher/deployments/SushiswapWatcherDeployment.json (89%) rename src/publish-endponit-records.ts => demo/scripts/publish-records.ts (94%) delete mode 100644 records-demo.md diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 0000000..63a0f55 --- /dev/null +++ b/demo/README.md @@ -0,0 +1,59 @@ +# 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 + +* Publish watcher records from [`demo/records`](./demo/records): + + ```bash + # Publishes records and corresponding 'deployment' records from the given directory + yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records/watcher + ``` + +### 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' + ``` diff --git a/demo/records/subgraph/SushiswapV2Subgraph.json b/demo/records/subgraph/SushiswapV2Subgraph.json new file mode 100644 index 0000000..0ffd07a --- /dev/null +++ b/demo/records/subgraph/SushiswapV2Subgraph.json @@ -0,0 +1,11 @@ +{ + "type": "SubgraphRecord", + "version": "0.1.0", + "schema": "", + "name": "sushiswap-v2-subgraph", + "subgraphName": "sushiswap/v2-filecoin", + "repository": "https://github.com/sushiswap/subgraphs", + "repository_ref": "8a465f0b583a916debdbe357e1bb99205d8709f4", + "network": "filecoin", + "chain": "314" +} diff --git a/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json new file mode 100644 index 0000000..0b93058 --- /dev/null +++ b/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json @@ -0,0 +1,11 @@ +{ + "type": "SubgraphDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "sushiswap-v2-subgraph", + "subgraph": "", + "subgraph_id": "QmejnkeYZxJKxz6kV62V6mSmAKVDuyoiDsempRC6NMunYo", + "url": "https://sushiswap-v2-subgraph-endpoint.example.com", + "needs_auth": false +} diff --git a/records/watcher/AjnaWatcher.json b/demo/records/watcher/AjnaWatcher.json similarity index 92% rename from records/watcher/AjnaWatcher.json rename to demo/records/watcher/AjnaWatcher.json index 2bd84ff..f2ec2f8 100644 --- a/records/watcher/AjnaWatcher.json +++ b/demo/records/watcher/AjnaWatcher.json @@ -7,5 +7,5 @@ "repository_ref": "66b8d96308eacab1ef6a4f3cb74a0f28fb18dc67", "watcher_version": "0.1.3", "is_subgraph_watcher": true, - "chain": "filecoin" + "chain": "314" } diff --git a/records/watcher/AzimuthWatcher.json b/demo/records/watcher/AzimuthWatcher.json similarity index 92% rename from records/watcher/AzimuthWatcher.json rename to demo/records/watcher/AzimuthWatcher.json index a0193d0..7d4b4d0 100644 --- a/records/watcher/AzimuthWatcher.json +++ b/demo/records/watcher/AzimuthWatcher.json @@ -7,5 +7,5 @@ "repository_ref": "ffd8baa4bcdd0b0fff701d942de572b7ddf33191", "watcher_version": "0.1.3", "is_subgraph_watcher": false, - "chain": "ethereum" + "chain": "1" } diff --git a/records/watcher/MerklSushiswapWatcher.json b/demo/records/watcher/MerklSushiswapWatcher.json similarity index 93% rename from records/watcher/MerklSushiswapWatcher.json rename to demo/records/watcher/MerklSushiswapWatcher.json index ee64b65..13fecbd 100644 --- a/records/watcher/MerklSushiswapWatcher.json +++ b/demo/records/watcher/MerklSushiswapWatcher.json @@ -7,5 +7,5 @@ "repository_ref": "b7cf79883e73400ad064b0357208c167795ab521", "watcher_version": "0.1.9", "is_subgraph_watcher": true, - "chain": "filecoin" + "chain": "314" } diff --git a/records/watcher/SushiswapWatcher.json b/demo/records/watcher/SushiswapWatcher.json similarity index 93% rename from records/watcher/SushiswapWatcher.json rename to demo/records/watcher/SushiswapWatcher.json index e11cb80..4687af5 100644 --- a/records/watcher/SushiswapWatcher.json +++ b/demo/records/watcher/SushiswapWatcher.json @@ -7,5 +7,5 @@ "repository_ref": "2f9f4d1ca191805922a51d1e3b471c06314fbc64", "watcher_version": "0.1.9", "is_subgraph_watcher": true, - "chain": "filecoin" + "chain": "314" } diff --git a/records/watcher/deployments/AjnaWatcherDeployment.json b/demo/records/watcher/deployments/AjnaWatcherDeployment.json similarity index 88% rename from records/watcher/deployments/AjnaWatcherDeployment.json rename to demo/records/watcher/deployments/AjnaWatcherDeployment.json index f8a5335..834a356 100644 --- a/records/watcher/deployments/AjnaWatcherDeployment.json +++ b/demo/records/watcher/deployments/AjnaWatcherDeployment.json @@ -7,5 +7,5 @@ "watcher": "", "kind": "active", "url": "https://ajna-watcher-endpoint.example.com", - "requires_api_key": "true" + "needs_auth": true } diff --git a/records/watcher/deployments/AzimuthWatcherDeployment.json b/demo/records/watcher/deployments/AzimuthWatcherDeployment.json similarity index 88% rename from records/watcher/deployments/AzimuthWatcherDeployment.json rename to demo/records/watcher/deployments/AzimuthWatcherDeployment.json index 0c6e414..197b573 100644 --- a/records/watcher/deployments/AzimuthWatcherDeployment.json +++ b/demo/records/watcher/deployments/AzimuthWatcherDeployment.json @@ -7,5 +7,5 @@ "watcher": "", "kind": "active", "url": "https://azimuth-watcher-endpoint.example.com", - "requires_api_key": "false" + "needs_auth": false } diff --git a/records/watcher/deployments/MerklSushiswapWatcherDeployment.json b/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json similarity index 89% rename from records/watcher/deployments/MerklSushiswapWatcherDeployment.json rename to demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json index 0c04aee..b3ad954 100644 --- a/records/watcher/deployments/MerklSushiswapWatcherDeployment.json +++ b/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json @@ -7,5 +7,5 @@ "watcher": "", "kind": "active", "url": "https://merkl-sushiswap-v3-watcher-endpoint.example.com", - "requires_api_key": "false" + "needs_auth": true } diff --git a/records/watcher/deployments/SushiswapWatcherDeployment.json b/demo/records/watcher/deployments/SushiswapWatcherDeployment.json similarity index 89% rename from records/watcher/deployments/SushiswapWatcherDeployment.json rename to demo/records/watcher/deployments/SushiswapWatcherDeployment.json index ca2acf1..5a56139 100644 --- a/records/watcher/deployments/SushiswapWatcherDeployment.json +++ b/demo/records/watcher/deployments/SushiswapWatcherDeployment.json @@ -7,5 +7,5 @@ "watcher": "", "kind": "active", "url": "https://sushiswap-v3-watcher-endpoint.example.com", - "requires_api_key": "false" + "needs_auth": true } diff --git a/src/publish-endponit-records.ts b/demo/scripts/publish-records.ts similarity index 94% rename from src/publish-endponit-records.ts rename to demo/scripts/publish-records.ts index 571715d..152df51 100644 --- a/src/publish-endponit-records.ts +++ b/demo/scripts/publish-records.ts @@ -1,11 +1,12 @@ import yargs from 'yargs'; import fs from 'fs'; import path from 'path'; +import assert from 'assert'; import { hideBin } from 'yargs/helpers'; import { Registry } from '@cerc-io/registry-sdk'; -import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from './util'; +import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from '../../src/util'; const recordTypeToRecordField = new Map([ ['WatcherRecord', 'watcher'], @@ -15,7 +16,7 @@ const recordTypeToRecordField = new Map([ async function main () { const argv = getArgs(); - const { records: recordsDir, config, type: recordType } = argv; + const { records: recordsDir, config } = argv; const { services: { registry: registryConfig } } = getConfig(config as string); @@ -39,6 +40,8 @@ async function main () { // Read record from each JSON file console.log('**************************************'); console.log(`Publishing records from ${recordsDir}`); + + let recordType; for (let i = 0; i < jsonFiles.length; i++) { const file = jsonFiles[i]; @@ -50,6 +53,8 @@ async function main () { console.log(`Published record from ${file}`); txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose); + + recordType = record.type; } // Check if deployment record files exist @@ -73,10 +78,13 @@ async function main () { // Find record using name and given type const recordName = deploymentRecord.name; + assert(recordType, 'recordType could not be resolved'); const queryResult = await registry.queryRecords({ type: recordType, name: recordName }, true); if (queryResult.length === 0) { throw new Error(`Record not found, type: ${recordType}, name: ${recordName}`); } + + // Assume the first query result const recordId = queryResult[0].id; // Set record field to record id @@ -119,12 +127,6 @@ function getArgs (): any { type: 'string', demandOption: true }) - .option('type', { - alias: 't', - describe: 'Record type', - type: 'string', - demandOption: true - }) .help().argv; } diff --git a/records-demo.md b/records-demo.md deleted file mode 100644 index 2d182c0..0000000 --- a/records-demo.md +++ /dev/null @@ -1,141 +0,0 @@ -# Records Demo - -* 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 - ``` - -* Publish watcher records from [`records/watcher`](./records/watcher): - - ```bash - # Publishes records and corresponding 'deployment' records from the given directory - yarn ts-node src/publish-endponit-records.ts -c config.yml -r records/watcher - ``` - -## Example - -* Query for `ajna-watcher` deployment: - - * 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' - ``` - -## Query GQL - -* View the records at laconicd GQL endpoint : - - ```gql - { - 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` `WatcherRecord`s: - - ```gql - { - 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 } } } - } - } - } - } - ``` -- 2.45.2 From 52a16c1c6bb087c77f480da450c790204e8702e2 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 15:47:42 +0530 Subject: [PATCH 09/20] Read and publish record files recursively --- demo/README.md | 6 ++-- demo/scripts/publish-records.ts | 49 +++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/demo/README.md b/demo/README.md index 63a0f55..093f587 100644 --- a/demo/README.md +++ b/demo/README.md @@ -32,11 +32,11 @@ ## Run -* Publish watcher records from [`demo/records`](./demo/records): +* Publish records from [`demo/records`](./demo/records): ```bash - # Publishes records and corresponding 'deployment' records from the given directory - yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records/watcher + # Publishes records and corresponding 'deployment' records + yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records ``` ### Example diff --git a/demo/scripts/publish-records.ts b/demo/scripts/publish-records.ts index 152df51..aa4c1c6 100644 --- a/demo/scripts/publish-records.ts +++ b/demo/scripts/publish-records.ts @@ -14,6 +14,11 @@ const recordTypeToRecordField = new Map([ ['ServiceRecord', 'service'] ]); +let registry: Registry; +let fee: any; +let userKey: string; +let bondId: string; + async function main () { const argv = getArgs(); const { records: recordsDir, config } = argv; @@ -28,11 +33,38 @@ async function main () { throw new Error('bondId not set in config'); } - const { rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig); + let rpcEndpoint, gqlEndpoint, chainId: string; + ({ rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig)); - const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); - const fee = getGasAndFees(argv, registryConfig); + registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); + fee = getGasAndFees(argv, registryConfig); + await processDir(path.resolve(recordsDir)); +} + +async function processDir (directoryPath: string): Promise { + const files = fs.readdirSync(directoryPath); + + // Check if any JSON record file exists in the directory + if (files.some(file => file.endsWith('.json'))) { + await publishRecordsFromDir(directoryPath); + + // Skip further recursion in the current dir + return; + } + + // Recursively iterate through subdirectories + for (let i = 0; i < files.length; i++) { + const file = files[i]; + const filePath = path.join(directoryPath, file); + + if (fs.statSync(filePath).isDirectory()) { + await processDir(filePath); + } + } +} + +async function publishRecordsFromDir (recordsDir: string): Promise { // List record files const files = fs.readdirSync(recordsDir); const jsonFiles = files.filter(file => path.extname(file).toLowerCase() === '.json'); @@ -51,8 +83,8 @@ async function main () { // Publish record const result = await registry.setRecord({ privateKey: userKey, record, bondId }, userKey, fee); - console.log(`Published record from ${file}`); - txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose); + console.log(`Published record ${file}`); + txOutput(result, JSON.stringify(result, undefined, 2), '', false); recordType = record.type; } @@ -62,8 +94,7 @@ async function main () { if (!fs.statSync(deploymentRecordsDir).isDirectory()) { return; } - - console.log('**************************************'); + console.log('--------------------------------------'); console.log(`Publishing deployment records from ${deploymentRecordsDir}`); // List record files @@ -94,8 +125,8 @@ async function main () { // Publish record const deploymentResult = await registry.setRecord({ privateKey: userKey, record: deploymentRecord, bondId }, userKey, fee); - console.log(`Published record from ${file}`); - txOutput(deploymentResult, JSON.stringify(deploymentResult, undefined, 2), argv.output, argv.verbose); + console.log(`Published record ${file}`); + txOutput(deploymentResult, JSON.stringify(deploymentResult, undefined, 2), '', false); } } -- 2.45.2 From bc7153fcdc3932395d2b0db6bd964c89006b1466 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 16:27:52 +0530 Subject: [PATCH 10/20] Update records --- demo/records/subgraph/SushiswapV2Subgraph.json | 4 +--- .../subgraph/deployments/SushiswapV2SubgraphDeployment.json | 3 +++ demo/records/watcher/AjnaWatcher.json | 3 +-- demo/records/watcher/AzimuthWatcher.json | 3 +-- demo/records/watcher/MerklSushiswapWatcher.json | 3 +-- demo/records/watcher/SushiswapWatcher.json | 3 +-- demo/records/watcher/deployments/AjnaWatcherDeployment.json | 1 + .../records/watcher/deployments/AzimuthWatcherDeployment.json | 1 + .../watcher/deployments/MerklSushiswapWatcherDeployment.json | 1 + .../watcher/deployments/SushiswapWatcherDeployment.json | 1 + 10 files changed, 12 insertions(+), 11 deletions(-) diff --git a/demo/records/subgraph/SushiswapV2Subgraph.json b/demo/records/subgraph/SushiswapV2Subgraph.json index 0ffd07a..f99c511 100644 --- a/demo/records/subgraph/SushiswapV2Subgraph.json +++ b/demo/records/subgraph/SushiswapV2Subgraph.json @@ -3,9 +3,7 @@ "version": "0.1.0", "schema": "", "name": "sushiswap-v2-subgraph", - "subgraphName": "sushiswap/v2-filecoin", "repository": "https://github.com/sushiswap/subgraphs", "repository_ref": "8a465f0b583a916debdbe357e1bb99205d8709f4", - "network": "filecoin", - "chain": "314" + "subgraph_dir": "subgraphs/v2" } diff --git a/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json index 0b93058..b632c9c 100644 --- a/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json +++ b/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json @@ -4,8 +4,11 @@ "schema": "", "request": "", "name": "sushiswap-v2-subgraph", + "subgraphName": "sushiswap/v2-filecoin", "subgraph": "", "subgraph_id": "QmejnkeYZxJKxz6kV62V6mSmAKVDuyoiDsempRC6NMunYo", + "network": "filecoin", + "chain": "314", "url": "https://sushiswap-v2-subgraph-endpoint.example.com", "needs_auth": false } diff --git a/demo/records/watcher/AjnaWatcher.json b/demo/records/watcher/AjnaWatcher.json index f2ec2f8..45df775 100644 --- a/demo/records/watcher/AjnaWatcher.json +++ b/demo/records/watcher/AjnaWatcher.json @@ -6,6 +6,5 @@ "repository": "https://git.vdb.to/cerc-io/ajna-watcher-ts", "repository_ref": "66b8d96308eacab1ef6a4f3cb74a0f28fb18dc67", "watcher_version": "0.1.3", - "is_subgraph_watcher": true, - "chain": "314" + "is_subgraph_watcher": true } diff --git a/demo/records/watcher/AzimuthWatcher.json b/demo/records/watcher/AzimuthWatcher.json index 7d4b4d0..3381dc9 100644 --- a/demo/records/watcher/AzimuthWatcher.json +++ b/demo/records/watcher/AzimuthWatcher.json @@ -6,6 +6,5 @@ "repository": "https://github.com/cerc-io/azimuth-watcher-ts", "repository_ref": "ffd8baa4bcdd0b0fff701d942de572b7ddf33191", "watcher_version": "0.1.3", - "is_subgraph_watcher": false, - "chain": "1" + "is_subgraph_watcher": false } diff --git a/demo/records/watcher/MerklSushiswapWatcher.json b/demo/records/watcher/MerklSushiswapWatcher.json index 13fecbd..2efb169 100644 --- a/demo/records/watcher/MerklSushiswapWatcher.json +++ b/demo/records/watcher/MerklSushiswapWatcher.json @@ -6,6 +6,5 @@ "repository": "https://github.com/cerc-io/merkl-sushiswap-v3-watcher-ts", "repository_ref": "b7cf79883e73400ad064b0357208c167795ab521", "watcher_version": "0.1.9", - "is_subgraph_watcher": true, - "chain": "314" + "is_subgraph_watcher": true } diff --git a/demo/records/watcher/SushiswapWatcher.json b/demo/records/watcher/SushiswapWatcher.json index 4687af5..c110a74 100644 --- a/demo/records/watcher/SushiswapWatcher.json +++ b/demo/records/watcher/SushiswapWatcher.json @@ -6,6 +6,5 @@ "repository": "https://github.com/cerc-io/sushiswap-v3-watcher-ts", "repository_ref": "2f9f4d1ca191805922a51d1e3b471c06314fbc64", "watcher_version": "0.1.9", - "is_subgraph_watcher": true, - "chain": "314" + "is_subgraph_watcher": true } diff --git a/demo/records/watcher/deployments/AjnaWatcherDeployment.json b/demo/records/watcher/deployments/AjnaWatcherDeployment.json index 834a356..352f6d1 100644 --- a/demo/records/watcher/deployments/AjnaWatcherDeployment.json +++ b/demo/records/watcher/deployments/AjnaWatcherDeployment.json @@ -6,6 +6,7 @@ "name": "ajna-watcher", "watcher": "", "kind": "active", + "chain": "314", "url": "https://ajna-watcher-endpoint.example.com", "needs_auth": true } diff --git a/demo/records/watcher/deployments/AzimuthWatcherDeployment.json b/demo/records/watcher/deployments/AzimuthWatcherDeployment.json index 197b573..68a4e53 100644 --- a/demo/records/watcher/deployments/AzimuthWatcherDeployment.json +++ b/demo/records/watcher/deployments/AzimuthWatcherDeployment.json @@ -6,6 +6,7 @@ "name": "azimuth-watcher", "watcher": "", "kind": "active", + "chain": "1", "url": "https://azimuth-watcher-endpoint.example.com", "needs_auth": false } diff --git a/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json b/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json index b3ad954..bd1a56f 100644 --- a/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json +++ b/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json @@ -6,6 +6,7 @@ "name": "merkl-sushiswap-v3-watcher", "watcher": "", "kind": "active", + "chain": "314", "url": "https://merkl-sushiswap-v3-watcher-endpoint.example.com", "needs_auth": true } diff --git a/demo/records/watcher/deployments/SushiswapWatcherDeployment.json b/demo/records/watcher/deployments/SushiswapWatcherDeployment.json index 5a56139..aedbc0f 100644 --- a/demo/records/watcher/deployments/SushiswapWatcherDeployment.json +++ b/demo/records/watcher/deployments/SushiswapWatcherDeployment.json @@ -6,6 +6,7 @@ "name": "sushiswap-v3-watcher", "watcher": "", "kind": "active", + "chain": "314", "url": "https://sushiswap-v3-watcher-endpoint.example.com", "needs_auth": true } -- 2.45.2 From 1dfe8f27e4de141557691d8befae713d73b272cf Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 18:39:01 +0530 Subject: [PATCH 11/20] Add service and service deployment records --- demo/records/service/GethRPC.json | 9 +++++++++ demo/records/service/LotusRPC.json | 9 +++++++++ .../deployments/ArchiveLotusRPCDeployment.json | 14 ++++++++++++++ .../deployments/GibbonGethRPCDeployment.json | 14 ++++++++++++++ .../deployments/KindredGethRPCDeployment.json | 14 ++++++++++++++ .../deployments/SandmanLotusRPCDeployment.json | 14 ++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 demo/records/service/GethRPC.json create mode 100644 demo/records/service/LotusRPC.json create mode 100644 demo/records/service/deployments/ArchiveLotusRPCDeployment.json create mode 100644 demo/records/service/deployments/GibbonGethRPCDeployment.json create mode 100644 demo/records/service/deployments/KindredGethRPCDeployment.json create mode 100644 demo/records/service/deployments/SandmanLotusRPCDeployment.json diff --git a/demo/records/service/GethRPC.json b/demo/records/service/GethRPC.json new file mode 100644 index 0000000..4223258 --- /dev/null +++ b/demo/records/service/GethRPC.json @@ -0,0 +1,9 @@ +{ + "type": "ServiceRecord", + "version": "0.1.0", + "schema": "", + "name": "geth-rpc", + "repository": "https://github.com/ethereum/go-ethereum", + "repository_ref": "87246f3cbaf10f83f56bc4d45f0f3e36e83e71e9", + "repository_tag": "v1.14.0" +} diff --git a/demo/records/service/LotusRPC.json b/demo/records/service/LotusRPC.json new file mode 100644 index 0000000..c75260a --- /dev/null +++ b/demo/records/service/LotusRPC.json @@ -0,0 +1,9 @@ +{ + "type": "ServiceRecord", + "version": "0.1.0", + "schema": "", + "name": "lotus-rpc", + "repository": "https://github.com/filecoin-project/lotus", + "repository_ref": "560826d5c61405006603c4f3d734a586a856d865", + "repository_tag": "v1.26.3" +} diff --git a/demo/records/service/deployments/ArchiveLotusRPCDeployment.json b/demo/records/service/deployments/ArchiveLotusRPCDeployment.json new file mode 100644 index 0000000..db9112f --- /dev/null +++ b/demo/records/service/deployments/ArchiveLotusRPCDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "ServiceDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "lotus-rpc", + "service": "", + "node_name": "", + "chain": "314", + "url": "https://lotus-rpc-endpoint.example.com", + "needs_auth": false, + "node_type": "full", + "eth_rpc_enabled": true +} diff --git a/demo/records/service/deployments/GibbonGethRPCDeployment.json b/demo/records/service/deployments/GibbonGethRPCDeployment.json new file mode 100644 index 0000000..7099c3c --- /dev/null +++ b/demo/records/service/deployments/GibbonGethRPCDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "ServiceDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "geth-rpc", + "service": "", + "node_name": "Geth/kindred-laconic-snap/v1.14.0-unstable-2e06fbd4/linux-amd64/go1.22.2", + "chain": "1", + "url": "https://geth-rpc-endpoint.example.com", + "needs_auth": false, + "sync_mode": "snap", + "gc_mode": "archive" +} diff --git a/demo/records/service/deployments/KindredGethRPCDeployment.json b/demo/records/service/deployments/KindredGethRPCDeployment.json new file mode 100644 index 0000000..a1baf94 --- /dev/null +++ b/demo/records/service/deployments/KindredGethRPCDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "ServiceDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "geth-rpc", + "service": "", + "node_name": "Geth/kindred-laconic/v1.14.0-unstable-3c26ffeb/linux-amd64/go1.21.8", + "chain": "1", + "url": "https://geth-rpc-endpoint.example.com", + "needs_auth": false, + "sync_mode": "full", + "gc_mode": "archive" +} diff --git a/demo/records/service/deployments/SandmanLotusRPCDeployment.json b/demo/records/service/deployments/SandmanLotusRPCDeployment.json new file mode 100644 index 0000000..eb08e55 --- /dev/null +++ b/demo/records/service/deployments/SandmanLotusRPCDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "ServiceDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "lotus-rpc", + "service": "", + "node_name": "", + "chain": "314", + "url": "https://lotus-rpc-endpoint.example.com", + "needs_auth": false, + "node_type": "lite", + "eth_rpc_enabled": true +} -- 2.45.2 From 62bf37e76dd892e95a9fdaffb8d2bc9471b9a3f0 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 19:10:36 +0530 Subject: [PATCH 12/20] Add subgraph and subgraph deployment records --- demo/records/subgraph/SushiswapBlocksSubgraph.json | 9 +++++++++ .../subgraph/SushiswapRouteProcessorSubgraph.json | 9 +++++++++ demo/records/subgraph/SushiswapSubgraph.json | 9 +++++++++ demo/records/subgraph/SushiswapV2Subgraph.json | 2 +- demo/records/subgraph/SushiswapV3Subgraph.json | 9 +++++++++ .../SushiswapBlocksSubgraphDeployment.json | 14 ++++++++++++++ .../SushiswapRouteProcessorSubgraphDeployment.json | 14 ++++++++++++++ .../deployments/SushiswapSubgraphDeployment.json | 14 ++++++++++++++ .../deployments/SushiswapV3SubgraphDeployment.json | 14 ++++++++++++++ 9 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 demo/records/subgraph/SushiswapBlocksSubgraph.json create mode 100644 demo/records/subgraph/SushiswapRouteProcessorSubgraph.json create mode 100644 demo/records/subgraph/SushiswapSubgraph.json create mode 100644 demo/records/subgraph/SushiswapV3Subgraph.json create mode 100644 demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json create mode 100644 demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json create mode 100644 demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json create mode 100644 demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json diff --git a/demo/records/subgraph/SushiswapBlocksSubgraph.json b/demo/records/subgraph/SushiswapBlocksSubgraph.json new file mode 100644 index 0000000..0f7c830 --- /dev/null +++ b/demo/records/subgraph/SushiswapBlocksSubgraph.json @@ -0,0 +1,9 @@ +{ + "type": "SubgraphRecord", + "version": "0.1.0", + "schema": "", + "name": "sushiswap-blocks-subgraph", + "repository": "https://github.com/sushiswap/subgraphs", + "repository_ref": "533749731563023903410a58013167bc10d06a88", + "subgraph_dir": "subgraphs/blocks" +} diff --git a/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json b/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json new file mode 100644 index 0000000..62d109e --- /dev/null +++ b/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json @@ -0,0 +1,9 @@ +{ + "type": "SubgraphRecord", + "version": "0.1.0", + "schema": "", + "name": "sushiswap-route-processor-subgraph", + "repository": "https://github.com/sushiswap/subgraphs", + "repository_ref": "382f888489ffc27d394775f9c1719dba7bacef63", + "subgraph_dir": "subgraphs/route-processor" +} diff --git a/demo/records/subgraph/SushiswapSubgraph.json b/demo/records/subgraph/SushiswapSubgraph.json new file mode 100644 index 0000000..78cb878 --- /dev/null +++ b/demo/records/subgraph/SushiswapSubgraph.json @@ -0,0 +1,9 @@ +{ + "type": "SubgraphRecord", + "version": "0.1.0", + "schema": "", + "name": "sushiswap-subgraph", + "repository": "https://github.com/sushiswap/subgraphs", + "repository_ref": "533749731563023903410a58013167bc10d06a88", + "subgraph_dir": "subgraphs/sushiswap" +} diff --git a/demo/records/subgraph/SushiswapV2Subgraph.json b/demo/records/subgraph/SushiswapV2Subgraph.json index f99c511..d932985 100644 --- a/demo/records/subgraph/SushiswapV2Subgraph.json +++ b/demo/records/subgraph/SushiswapV2Subgraph.json @@ -4,6 +4,6 @@ "schema": "", "name": "sushiswap-v2-subgraph", "repository": "https://github.com/sushiswap/subgraphs", - "repository_ref": "8a465f0b583a916debdbe357e1bb99205d8709f4", + "repository_ref": "d491b69adb9ff3666162ac284ab77a146f231794", "subgraph_dir": "subgraphs/v2" } diff --git a/demo/records/subgraph/SushiswapV3Subgraph.json b/demo/records/subgraph/SushiswapV3Subgraph.json new file mode 100644 index 0000000..b9a9f3c --- /dev/null +++ b/demo/records/subgraph/SushiswapV3Subgraph.json @@ -0,0 +1,9 @@ +{ + "type": "SubgraphRecord", + "version": "0.1.0", + "schema": "", + "name": "sushiswap-v3-subgraph", + "repository": "https://github.com/sushiswap/subgraphs", + "repository_ref": "d491b69adb9ff3666162ac284ab77a146f231794", + "subgraph_dir": "subgraphs/v3" +} diff --git a/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json new file mode 100644 index 0000000..a6ff195 --- /dev/null +++ b/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "SubgraphDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "sushiswap-blocks-subgraph", + "subgraphName": "sushiswap/blocks", + "subgraph": "", + "subgraph_id": "QmfBt5NbZdNhBoZS6MFj891YpNWQs8ysWkwVeEHF6rvscg", + "network": "filecoin", + "chain": "314", + "url": "https://sushiswap-blocks-subgraph-endpoint.example.com", + "needs_auth": false +} diff --git a/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json new file mode 100644 index 0000000..bd5a396 --- /dev/null +++ b/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "SubgraphDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "sushiswap-route-processor-subgraph", + "subgraphName": "sushiswap/rp4-filecoin", + "subgraph": "", + "subgraph_id": "QmcHTxwH74YgaMJFXKrNqpVVdQQWAyhbxMh9xUtYjKa3fw", + "network": "filecoin", + "chain": "314", + "url": "https://sushiswap-route-processor-subgraph-endpoint.example.com", + "needs_auth": false +} diff --git a/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json new file mode 100644 index 0000000..9cb5a42 --- /dev/null +++ b/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "SubgraphDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "sushiswap-subgraph", + "subgraphName": "sushiswap/sushiswap-filecoin", + "subgraph": "", + "subgraph_id": "QmbZdkSH5NoS1aycafeqQZ7QJycokDVBXG2526g5KmuR1F", + "network": "filecoin", + "chain": "314", + "url": "https://sushiswap-subgraph-endpoint.example.com", + "needs_auth": false +} diff --git a/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json new file mode 100644 index 0000000..fa3b1ee --- /dev/null +++ b/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json @@ -0,0 +1,14 @@ +{ + "type": "SubgraphDeploymentRecord", + "version": "0.1.0", + "schema": "", + "request": "", + "name": "sushiswap-v3-subgraph", + "subgraphName": "sushiswap/v3-filecoin", + "subgraph": "", + "subgraph_id": "QmRPQM4ZtRJYr8WiNdg6oqKRNQHHXv5rZrD4gzqQrJpPhz", + "network": "filecoin", + "chain": "314", + "url": "https://sushiswap-v3-subgraph-endpoint.example.com", + "needs_auth": false +} -- 2.45.2 From d07a0942b5c7ce4f343b2bc7cfa0d223003ffce6 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 8 May 2024 19:30:55 +0530 Subject: [PATCH 13/20] Add subgraph and service examples --- demo/README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/demo/README.md b/demo/README.md index 093f587..61cf45f 100644 --- a/demo/README.md +++ b/demo/README.md @@ -57,3 +57,37 @@ # 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`: + + ```bash + SUBGRAPH_RECORD_ID=$(laconic registry record list --all --type SubgraphRecord --name sushiswap-v3-subgraph | jq -r '.[].id') + ``` + + * Find corresponding deployment(s): + + ```bash + 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-rpc` service deployment(s): + + * Find the `ServiceRecord` for `geth-rpc`: + + ```bash + SERVICE_RECORD_ID=$(laconic registry record list --all --type ServiceRecord --name geth-rpc | jq -r '.[].id') + ``` + + * Find corresponding deployment(s): + + ```bash + 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' + ``` -- 2.45.2 From e8779f8d568f1d179d48f286917418893d427f91 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 11:02:24 +0530 Subject: [PATCH 14/20] Update records --- demo/README.md | 7 ++++--- demo/records/service/Geth.json | 9 +++++++++ demo/records/service/GethRPC.json | 9 --------- demo/records/service/Lotus.json | 9 +++++++++ demo/records/service/LotusRPC.json | 9 --------- ...PCDeployment.json => ArchiveLotusDeployment.json} | 12 +++++++----- ...hRPCDeployment.json => GibbonGethDeployment.json} | 12 +++++++----- ...RPCDeployment.json => KindredGethDeployment.json} | 12 +++++++----- ...PCDeployment.json => SandmanLotusDeployment.json} | 12 +++++++----- demo/records/subgraph/SushiswapBlocksSubgraph.json | 1 + .../subgraph/SushiswapRouteProcessorSubgraph.json | 1 + demo/records/subgraph/SushiswapSubgraph.json | 1 + demo/records/subgraph/SushiswapV2Subgraph.json | 1 + demo/records/subgraph/SushiswapV3Subgraph.json | 1 + .../SushiswapBlocksSubgraphDeployment.json | 2 +- .../SushiswapRouteProcessorSubgraphDeployment.json | 2 +- .../deployments/SushiswapSubgraphDeployment.json | 2 +- .../deployments/SushiswapV2SubgraphDeployment.json | 2 +- .../deployments/SushiswapV3SubgraphDeployment.json | 2 +- demo/records/watcher/AjnaWatcher.json | 2 +- demo/records/watcher/AzimuthWatcher.json | 2 +- demo/records/watcher/MerklSushiswapWatcher.json | 10 ---------- demo/records/watcher/SushiswapWatcher.json | 2 +- .../deployments/MerklSushiswapWatcherDeployment.json | 12 ------------ 24 files changed, 63 insertions(+), 71 deletions(-) create mode 100644 demo/records/service/Geth.json delete mode 100644 demo/records/service/GethRPC.json create mode 100644 demo/records/service/Lotus.json delete mode 100644 demo/records/service/LotusRPC.json rename demo/records/service/deployments/{SandmanLotusRPCDeployment.json => ArchiveLotusDeployment.json} (60%) rename demo/records/service/deployments/{KindredGethRPCDeployment.json => GibbonGethDeployment.json} (54%) rename demo/records/service/deployments/{GibbonGethRPCDeployment.json => KindredGethDeployment.json} (53%) rename demo/records/service/deployments/{ArchiveLotusRPCDeployment.json => SandmanLotusDeployment.json} (59%) delete mode 100644 demo/records/watcher/MerklSushiswapWatcher.json delete mode 100644 demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json diff --git a/demo/README.md b/demo/README.md index 61cf45f..b826d15 100644 --- a/demo/README.md +++ b/demo/README.md @@ -36,6 +36,7 @@ ```bash # Publishes records and corresponding 'deployment' records + # In laconic-registry-cli yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records ``` @@ -75,12 +76,12 @@ laconic registry record list --all --type SubgraphDeploymentRecord subgraph $SUBGRAPH_RECORD_ID | jq -r '.[].attributes.url' ``` -* Query for `geth-rpc` service deployment(s): +* Query for `geth` service deployment(s): - * Find the `ServiceRecord` for `geth-rpc`: + * Find the `ServiceRecord` for `geth`: ```bash - SERVICE_RECORD_ID=$(laconic registry record list --all --type ServiceRecord --name geth-rpc | jq -r '.[].id') + SERVICE_RECORD_ID=$(laconic registry record list --all --type ServiceRecord --name geth | jq -r '.[].id') ``` * Find corresponding deployment(s): diff --git a/demo/records/service/Geth.json b/demo/records/service/Geth.json new file mode 100644 index 0000000..8d7ff5e --- /dev/null +++ b/demo/records/service/Geth.json @@ -0,0 +1,9 @@ +{ + "type": "ServiceRecord", + "version": "0.1.0", + "schema": "", + "name": "geth", + "repository": "https://git.vdb.to/cerc-io/plugeth", + "repository_ref": "c50b6cc026207b195ad7f9afdbe919a1fe676e67", + "repository_tag": "v1.13.14-cerc-0" +} diff --git a/demo/records/service/GethRPC.json b/demo/records/service/GethRPC.json deleted file mode 100644 index 4223258..0000000 --- a/demo/records/service/GethRPC.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "ServiceRecord", - "version": "0.1.0", - "schema": "", - "name": "geth-rpc", - "repository": "https://github.com/ethereum/go-ethereum", - "repository_ref": "87246f3cbaf10f83f56bc4d45f0f3e36e83e71e9", - "repository_tag": "v1.14.0" -} diff --git a/demo/records/service/Lotus.json b/demo/records/service/Lotus.json new file mode 100644 index 0000000..393915e --- /dev/null +++ b/demo/records/service/Lotus.json @@ -0,0 +1,9 @@ +{ + "type": "ServiceRecord", + "version": "0.1.0", + "schema": "", + "name": "lotus", + "repository": "https://git.vdb.to/cerc-io/lotus", + "repository_ref": "9dc9a5cf45acc7ee86371af2092dd7c04db26930", + "repository_tag": "v1.26.1" +} diff --git a/demo/records/service/LotusRPC.json b/demo/records/service/LotusRPC.json deleted file mode 100644 index c75260a..0000000 --- a/demo/records/service/LotusRPC.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "ServiceRecord", - "version": "0.1.0", - "schema": "", - "name": "lotus-rpc", - "repository": "https://github.com/filecoin-project/lotus", - "repository_ref": "560826d5c61405006603c4f3d734a586a856d865", - "repository_tag": "v1.26.3" -} diff --git a/demo/records/service/deployments/SandmanLotusRPCDeployment.json b/demo/records/service/deployments/ArchiveLotusDeployment.json similarity index 60% rename from demo/records/service/deployments/SandmanLotusRPCDeployment.json rename to demo/records/service/deployments/ArchiveLotusDeployment.json index eb08e55..8ff94e8 100644 --- a/demo/records/service/deployments/SandmanLotusRPCDeployment.json +++ b/demo/records/service/deployments/ArchiveLotusDeployment.json @@ -3,12 +3,14 @@ "version": "0.1.0", "schema": "", "request": "", - "name": "lotus-rpc", + "name": "lotus", "service": "", - "node_name": "", - "chain": "314", "url": "https://lotus-rpc-endpoint.example.com", "needs_auth": false, - "node_type": "lite", - "eth_rpc_enabled": true + "meta": { + "machine_name": "", + "node_type": "archive", + "chain": "314", + "eth_rpc_enabled": true + } } diff --git a/demo/records/service/deployments/KindredGethRPCDeployment.json b/demo/records/service/deployments/GibbonGethDeployment.json similarity index 54% rename from demo/records/service/deployments/KindredGethRPCDeployment.json rename to demo/records/service/deployments/GibbonGethDeployment.json index a1baf94..45e755d 100644 --- a/demo/records/service/deployments/KindredGethRPCDeployment.json +++ b/demo/records/service/deployments/GibbonGethDeployment.json @@ -3,12 +3,14 @@ "version": "0.1.0", "schema": "", "request": "", - "name": "geth-rpc", + "name": "geth", "service": "", - "node_name": "Geth/kindred-laconic/v1.14.0-unstable-3c26ffeb/linux-amd64/go1.21.8", - "chain": "1", "url": "https://geth-rpc-endpoint.example.com", "needs_auth": false, - "sync_mode": "full", - "gc_mode": "archive" + "meta": { + "machine_name": "gibbon", + "chain": "1", + "sync_mode": "snap", + "gc_mode": "archive" + } } diff --git a/demo/records/service/deployments/GibbonGethRPCDeployment.json b/demo/records/service/deployments/KindredGethDeployment.json similarity index 53% rename from demo/records/service/deployments/GibbonGethRPCDeployment.json rename to demo/records/service/deployments/KindredGethDeployment.json index 7099c3c..3c24e15 100644 --- a/demo/records/service/deployments/GibbonGethRPCDeployment.json +++ b/demo/records/service/deployments/KindredGethDeployment.json @@ -3,12 +3,14 @@ "version": "0.1.0", "schema": "", "request": "", - "name": "geth-rpc", + "name": "geth", "service": "", - "node_name": "Geth/kindred-laconic-snap/v1.14.0-unstable-2e06fbd4/linux-amd64/go1.22.2", - "chain": "1", "url": "https://geth-rpc-endpoint.example.com", "needs_auth": false, - "sync_mode": "snap", - "gc_mode": "archive" + "meta": { + "machine_name": "kindred", + "chain": "1", + "sync_mode": "full", + "gc_mode": "archive" + } } diff --git a/demo/records/service/deployments/ArchiveLotusRPCDeployment.json b/demo/records/service/deployments/SandmanLotusDeployment.json similarity index 59% rename from demo/records/service/deployments/ArchiveLotusRPCDeployment.json rename to demo/records/service/deployments/SandmanLotusDeployment.json index db9112f..977fb33 100644 --- a/demo/records/service/deployments/ArchiveLotusRPCDeployment.json +++ b/demo/records/service/deployments/SandmanLotusDeployment.json @@ -3,12 +3,14 @@ "version": "0.1.0", "schema": "", "request": "", - "name": "lotus-rpc", + "name": "lotus", "service": "", - "node_name": "", - "chain": "314", "url": "https://lotus-rpc-endpoint.example.com", "needs_auth": false, - "node_type": "full", - "eth_rpc_enabled": true + "meta": { + "machine_name": "sandman", + "node_type": "full", + "chain": "314", + "eth_rpc_enabled": true + } } diff --git a/demo/records/subgraph/SushiswapBlocksSubgraph.json b/demo/records/subgraph/SushiswapBlocksSubgraph.json index 0f7c830..2c7f942 100644 --- a/demo/records/subgraph/SushiswapBlocksSubgraph.json +++ b/demo/records/subgraph/SushiswapBlocksSubgraph.json @@ -5,5 +5,6 @@ "name": "sushiswap-blocks-subgraph", "repository": "https://github.com/sushiswap/subgraphs", "repository_ref": "533749731563023903410a58013167bc10d06a88", + "repository_tag": "", "subgraph_dir": "subgraphs/blocks" } diff --git a/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json b/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json index 62d109e..a826587 100644 --- a/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json +++ b/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json @@ -5,5 +5,6 @@ "name": "sushiswap-route-processor-subgraph", "repository": "https://github.com/sushiswap/subgraphs", "repository_ref": "382f888489ffc27d394775f9c1719dba7bacef63", + "repository_tag": "", "subgraph_dir": "subgraphs/route-processor" } diff --git a/demo/records/subgraph/SushiswapSubgraph.json b/demo/records/subgraph/SushiswapSubgraph.json index 78cb878..ca7b666 100644 --- a/demo/records/subgraph/SushiswapSubgraph.json +++ b/demo/records/subgraph/SushiswapSubgraph.json @@ -5,5 +5,6 @@ "name": "sushiswap-subgraph", "repository": "https://github.com/sushiswap/subgraphs", "repository_ref": "533749731563023903410a58013167bc10d06a88", + "repository_tag": "", "subgraph_dir": "subgraphs/sushiswap" } diff --git a/demo/records/subgraph/SushiswapV2Subgraph.json b/demo/records/subgraph/SushiswapV2Subgraph.json index d932985..d68fcfb 100644 --- a/demo/records/subgraph/SushiswapV2Subgraph.json +++ b/demo/records/subgraph/SushiswapV2Subgraph.json @@ -5,5 +5,6 @@ "name": "sushiswap-v2-subgraph", "repository": "https://github.com/sushiswap/subgraphs", "repository_ref": "d491b69adb9ff3666162ac284ab77a146f231794", + "repository_tag": "", "subgraph_dir": "subgraphs/v2" } diff --git a/demo/records/subgraph/SushiswapV3Subgraph.json b/demo/records/subgraph/SushiswapV3Subgraph.json index b9a9f3c..09fc58f 100644 --- a/demo/records/subgraph/SushiswapV3Subgraph.json +++ b/demo/records/subgraph/SushiswapV3Subgraph.json @@ -5,5 +5,6 @@ "name": "sushiswap-v3-subgraph", "repository": "https://github.com/sushiswap/subgraphs", "repository_ref": "d491b69adb9ff3666162ac284ab77a146f231794", + "repository_tag": "", "subgraph_dir": "subgraphs/v3" } diff --git a/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json index a6ff195..ad78a6b 100644 --- a/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json +++ b/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json @@ -4,7 +4,7 @@ "schema": "", "request": "", "name": "sushiswap-blocks-subgraph", - "subgraphName": "sushiswap/blocks", + "subgraph_name": "sushiswap/blocks", "subgraph": "", "subgraph_id": "QmfBt5NbZdNhBoZS6MFj891YpNWQs8ysWkwVeEHF6rvscg", "network": "filecoin", diff --git a/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json index bd5a396..d35d16a 100644 --- a/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json +++ b/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json @@ -4,7 +4,7 @@ "schema": "", "request": "", "name": "sushiswap-route-processor-subgraph", - "subgraphName": "sushiswap/rp4-filecoin", + "subgraph_name": "sushiswap/rp4-filecoin", "subgraph": "", "subgraph_id": "QmcHTxwH74YgaMJFXKrNqpVVdQQWAyhbxMh9xUtYjKa3fw", "network": "filecoin", diff --git a/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json index 9cb5a42..cd83669 100644 --- a/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json +++ b/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json @@ -4,7 +4,7 @@ "schema": "", "request": "", "name": "sushiswap-subgraph", - "subgraphName": "sushiswap/sushiswap-filecoin", + "subgraph_name": "sushiswap/sushiswap-filecoin", "subgraph": "", "subgraph_id": "QmbZdkSH5NoS1aycafeqQZ7QJycokDVBXG2526g5KmuR1F", "network": "filecoin", diff --git a/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json index b632c9c..ab71419 100644 --- a/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json +++ b/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json @@ -4,7 +4,7 @@ "schema": "", "request": "", "name": "sushiswap-v2-subgraph", - "subgraphName": "sushiswap/v2-filecoin", + "subgraph_name": "sushiswap/v2-filecoin", "subgraph": "", "subgraph_id": "QmejnkeYZxJKxz6kV62V6mSmAKVDuyoiDsempRC6NMunYo", "network": "filecoin", diff --git a/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json b/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json index fa3b1ee..dec8b61 100644 --- a/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json +++ b/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json @@ -4,7 +4,7 @@ "schema": "", "request": "", "name": "sushiswap-v3-subgraph", - "subgraphName": "sushiswap/v3-filecoin", + "subgraph_name": "sushiswap/v3-filecoin", "subgraph": "", "subgraph_id": "QmRPQM4ZtRJYr8WiNdg6oqKRNQHHXv5rZrD4gzqQrJpPhz", "network": "filecoin", diff --git a/demo/records/watcher/AjnaWatcher.json b/demo/records/watcher/AjnaWatcher.json index 45df775..2433ebb 100644 --- a/demo/records/watcher/AjnaWatcher.json +++ b/demo/records/watcher/AjnaWatcher.json @@ -5,6 +5,6 @@ "name": "ajna-watcher", "repository": "https://git.vdb.to/cerc-io/ajna-watcher-ts", "repository_ref": "66b8d96308eacab1ef6a4f3cb74a0f28fb18dc67", - "watcher_version": "0.1.3", + "repository_tag": "v0.1.3", "is_subgraph_watcher": true } diff --git a/demo/records/watcher/AzimuthWatcher.json b/demo/records/watcher/AzimuthWatcher.json index 3381dc9..c3075a2 100644 --- a/demo/records/watcher/AzimuthWatcher.json +++ b/demo/records/watcher/AzimuthWatcher.json @@ -5,6 +5,6 @@ "name": "azimuth-watcher", "repository": "https://github.com/cerc-io/azimuth-watcher-ts", "repository_ref": "ffd8baa4bcdd0b0fff701d942de572b7ddf33191", - "watcher_version": "0.1.3", + "repository_tag": "v0.1.3", "is_subgraph_watcher": false } diff --git a/demo/records/watcher/MerklSushiswapWatcher.json b/demo/records/watcher/MerklSushiswapWatcher.json deleted file mode 100644 index 2efb169..0000000 --- a/demo/records/watcher/MerklSushiswapWatcher.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "WatcherRecord", - "version": "0.1.0", - "schema": "", - "name": "merkl-sushiswap-v3-watcher", - "repository": "https://github.com/cerc-io/merkl-sushiswap-v3-watcher-ts", - "repository_ref": "b7cf79883e73400ad064b0357208c167795ab521", - "watcher_version": "0.1.9", - "is_subgraph_watcher": true -} diff --git a/demo/records/watcher/SushiswapWatcher.json b/demo/records/watcher/SushiswapWatcher.json index c110a74..b036f73 100644 --- a/demo/records/watcher/SushiswapWatcher.json +++ b/demo/records/watcher/SushiswapWatcher.json @@ -5,6 +5,6 @@ "name": "sushiswap-v3-watcher", "repository": "https://github.com/cerc-io/sushiswap-v3-watcher-ts", "repository_ref": "2f9f4d1ca191805922a51d1e3b471c06314fbc64", - "watcher_version": "0.1.9", + "repository_tag": "v0.1.9", "is_subgraph_watcher": true } diff --git a/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json b/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json deleted file mode 100644 index bd1a56f..0000000 --- a/demo/records/watcher/deployments/MerklSushiswapWatcherDeployment.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "WatcherDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "merkl-sushiswap-v3-watcher", - "watcher": "", - "kind": "active", - "chain": "314", - "url": "https://merkl-sushiswap-v3-watcher-endpoint.example.com", - "needs_auth": true -} -- 2.45.2 From 578f2153e86a31fa0ba127a3a719e3429b0a8160 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 11:20:14 +0530 Subject: [PATCH 15/20] Update instructions --- demo/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/demo/README.md b/demo/README.md index b826d15..e78b1ae 100644 --- a/demo/README.md +++ b/demo/README.md @@ -13,6 +13,8 @@ * Create and populate `config.yml` following [config.example.yml](./config.example.yml): ```bash + cp config.example.yml config.yml + # Get user key laconicd keys export alice --unarmored-hex --unsafe --keyring-backend test --home ~/.laconicd @@ -21,6 +23,9 @@ # Get the bond id laconicd query bond list + + # Change the gas value + # gas: 500000 ``` * Install the CLI: -- 2.45.2 From 2c85935af41937346c44e6f499799eb200553c27 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 11:56:57 +0530 Subject: [PATCH 16/20] Update record names --- demo/README.md | 12 +++++++----- ...Deployment.json => archive-lotus-deployment.json} | 0 ...thDeployment.json => gibbon-geth-deployment.json} | 0 ...hDeployment.json => kindred-geth-deployment.json} | 0 ...Deployment.json => sandman-lotus-deployment.json} | 0 demo/records/service/{Geth.json => geth.json} | 0 demo/records/service/{Lotus.json => lotus.json} | 0 ...son => sushiswap-blocks-subgraph-deployment.json} | 0 ...shiswap-route-processor-subgraph-deployment.json} | 0 ...yment.json => sushiswap-subgraph-deployment.json} | 0 ...nt.json => sushiswap-v2-subgraph-deployment.json} | 0 ...nt.json => sushiswap-v3-subgraph-deployment.json} | 0 ...sSubgraph.json => sushiswap-blocks-subgraph.json} | 0 ....json => sushiswap-route-processor-subgraph.json} | 0 ...ushiswapSubgraph.json => sushiswap-subgraph.json} | 0 ...wapV2Subgraph.json => sushiswap-v2-subgraph.json} | 0 ...wapV3Subgraph.json => sushiswap-v3-subgraph.json} | 0 .../watcher/{AjnaWatcher.json => ajna-watcher.json} | 0 .../{AzimuthWatcher.json => azimuth-watcher.json} | 0 ...rDeployment.json => ajna-watcher-deployment.json} | 0 ...ployment.json => azimuth-watcher-deployment.json} | 0 ...oyment.json => sushiswap-watcher-deployment.json} | 0 ...{SushiswapWatcher.json => sushiswap-watcher.json} | 0 demo/scripts/publish-records.ts | 2 +- {src => demo}/types/common/main.d.ts | 0 {src => demo}/types/common/package.json | 0 tsconfig.json | 4 ++-- 27 files changed, 10 insertions(+), 8 deletions(-) rename demo/records/service/deployments/{ArchiveLotusDeployment.json => archive-lotus-deployment.json} (100%) rename demo/records/service/deployments/{GibbonGethDeployment.json => gibbon-geth-deployment.json} (100%) rename demo/records/service/deployments/{KindredGethDeployment.json => kindred-geth-deployment.json} (100%) rename demo/records/service/deployments/{SandmanLotusDeployment.json => sandman-lotus-deployment.json} (100%) rename demo/records/service/{Geth.json => geth.json} (100%) rename demo/records/service/{Lotus.json => lotus.json} (100%) rename demo/records/subgraph/deployments/{SushiswapBlocksSubgraphDeployment.json => sushiswap-blocks-subgraph-deployment.json} (100%) rename demo/records/subgraph/deployments/{SushiswapRouteProcessorSubgraphDeployment.json => sushiswap-route-processor-subgraph-deployment.json} (100%) rename demo/records/subgraph/deployments/{SushiswapSubgraphDeployment.json => sushiswap-subgraph-deployment.json} (100%) rename demo/records/subgraph/deployments/{SushiswapV2SubgraphDeployment.json => sushiswap-v2-subgraph-deployment.json} (100%) rename demo/records/subgraph/deployments/{SushiswapV3SubgraphDeployment.json => sushiswap-v3-subgraph-deployment.json} (100%) rename demo/records/subgraph/{SushiswapBlocksSubgraph.json => sushiswap-blocks-subgraph.json} (100%) rename demo/records/subgraph/{SushiswapRouteProcessorSubgraph.json => sushiswap-route-processor-subgraph.json} (100%) rename demo/records/subgraph/{SushiswapSubgraph.json => sushiswap-subgraph.json} (100%) rename demo/records/subgraph/{SushiswapV2Subgraph.json => sushiswap-v2-subgraph.json} (100%) rename demo/records/subgraph/{SushiswapV3Subgraph.json => sushiswap-v3-subgraph.json} (100%) rename demo/records/watcher/{AjnaWatcher.json => ajna-watcher.json} (100%) rename demo/records/watcher/{AzimuthWatcher.json => azimuth-watcher.json} (100%) rename demo/records/watcher/deployments/{AjnaWatcherDeployment.json => ajna-watcher-deployment.json} (100%) rename demo/records/watcher/deployments/{AzimuthWatcherDeployment.json => azimuth-watcher-deployment.json} (100%) rename demo/records/watcher/deployments/{SushiswapWatcherDeployment.json => sushiswap-watcher-deployment.json} (100%) rename demo/records/watcher/{SushiswapWatcher.json => sushiswap-watcher.json} (100%) rename {src => demo}/types/common/main.d.ts (100%) rename {src => demo}/types/common/package.json (100%) diff --git a/demo/README.md b/demo/README.md index e78b1ae..87eac91 100644 --- a/demo/README.md +++ b/demo/README.md @@ -15,17 +15,17 @@ ```bash cp config.example.yml config.yml - # Get user key + # Change the gas value in config.yml + # gas: 500000 + + # Get user key and set it to userKey in config.yml 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 + # Get the bond id and set it to bondId in config.yml laconicd query bond list - - # Change the gas value - # gas: 500000 ``` * Install the CLI: @@ -41,7 +41,9 @@ ```bash # Publishes records and corresponding 'deployment' records + # In laconic-registry-cli + # Use records dir path for '--records' as required yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records ``` diff --git a/demo/records/service/deployments/ArchiveLotusDeployment.json b/demo/records/service/deployments/archive-lotus-deployment.json similarity index 100% rename from demo/records/service/deployments/ArchiveLotusDeployment.json rename to demo/records/service/deployments/archive-lotus-deployment.json diff --git a/demo/records/service/deployments/GibbonGethDeployment.json b/demo/records/service/deployments/gibbon-geth-deployment.json similarity index 100% rename from demo/records/service/deployments/GibbonGethDeployment.json rename to demo/records/service/deployments/gibbon-geth-deployment.json diff --git a/demo/records/service/deployments/KindredGethDeployment.json b/demo/records/service/deployments/kindred-geth-deployment.json similarity index 100% rename from demo/records/service/deployments/KindredGethDeployment.json rename to demo/records/service/deployments/kindred-geth-deployment.json diff --git a/demo/records/service/deployments/SandmanLotusDeployment.json b/demo/records/service/deployments/sandman-lotus-deployment.json similarity index 100% rename from demo/records/service/deployments/SandmanLotusDeployment.json rename to demo/records/service/deployments/sandman-lotus-deployment.json diff --git a/demo/records/service/Geth.json b/demo/records/service/geth.json similarity index 100% rename from demo/records/service/Geth.json rename to demo/records/service/geth.json diff --git a/demo/records/service/Lotus.json b/demo/records/service/lotus.json similarity index 100% rename from demo/records/service/Lotus.json rename to demo/records/service/lotus.json diff --git a/demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json b/demo/records/subgraph/deployments/sushiswap-blocks-subgraph-deployment.json similarity index 100% rename from demo/records/subgraph/deployments/SushiswapBlocksSubgraphDeployment.json rename to demo/records/subgraph/deployments/sushiswap-blocks-subgraph-deployment.json diff --git a/demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json b/demo/records/subgraph/deployments/sushiswap-route-processor-subgraph-deployment.json similarity index 100% rename from demo/records/subgraph/deployments/SushiswapRouteProcessorSubgraphDeployment.json rename to demo/records/subgraph/deployments/sushiswap-route-processor-subgraph-deployment.json diff --git a/demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json b/demo/records/subgraph/deployments/sushiswap-subgraph-deployment.json similarity index 100% rename from demo/records/subgraph/deployments/SushiswapSubgraphDeployment.json rename to demo/records/subgraph/deployments/sushiswap-subgraph-deployment.json diff --git a/demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json b/demo/records/subgraph/deployments/sushiswap-v2-subgraph-deployment.json similarity index 100% rename from demo/records/subgraph/deployments/SushiswapV2SubgraphDeployment.json rename to demo/records/subgraph/deployments/sushiswap-v2-subgraph-deployment.json diff --git a/demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json b/demo/records/subgraph/deployments/sushiswap-v3-subgraph-deployment.json similarity index 100% rename from demo/records/subgraph/deployments/SushiswapV3SubgraphDeployment.json rename to demo/records/subgraph/deployments/sushiswap-v3-subgraph-deployment.json diff --git a/demo/records/subgraph/SushiswapBlocksSubgraph.json b/demo/records/subgraph/sushiswap-blocks-subgraph.json similarity index 100% rename from demo/records/subgraph/SushiswapBlocksSubgraph.json rename to demo/records/subgraph/sushiswap-blocks-subgraph.json diff --git a/demo/records/subgraph/SushiswapRouteProcessorSubgraph.json b/demo/records/subgraph/sushiswap-route-processor-subgraph.json similarity index 100% rename from demo/records/subgraph/SushiswapRouteProcessorSubgraph.json rename to demo/records/subgraph/sushiswap-route-processor-subgraph.json diff --git a/demo/records/subgraph/SushiswapSubgraph.json b/demo/records/subgraph/sushiswap-subgraph.json similarity index 100% rename from demo/records/subgraph/SushiswapSubgraph.json rename to demo/records/subgraph/sushiswap-subgraph.json diff --git a/demo/records/subgraph/SushiswapV2Subgraph.json b/demo/records/subgraph/sushiswap-v2-subgraph.json similarity index 100% rename from demo/records/subgraph/SushiswapV2Subgraph.json rename to demo/records/subgraph/sushiswap-v2-subgraph.json diff --git a/demo/records/subgraph/SushiswapV3Subgraph.json b/demo/records/subgraph/sushiswap-v3-subgraph.json similarity index 100% rename from demo/records/subgraph/SushiswapV3Subgraph.json rename to demo/records/subgraph/sushiswap-v3-subgraph.json diff --git a/demo/records/watcher/AjnaWatcher.json b/demo/records/watcher/ajna-watcher.json similarity index 100% rename from demo/records/watcher/AjnaWatcher.json rename to demo/records/watcher/ajna-watcher.json diff --git a/demo/records/watcher/AzimuthWatcher.json b/demo/records/watcher/azimuth-watcher.json similarity index 100% rename from demo/records/watcher/AzimuthWatcher.json rename to demo/records/watcher/azimuth-watcher.json diff --git a/demo/records/watcher/deployments/AjnaWatcherDeployment.json b/demo/records/watcher/deployments/ajna-watcher-deployment.json similarity index 100% rename from demo/records/watcher/deployments/AjnaWatcherDeployment.json rename to demo/records/watcher/deployments/ajna-watcher-deployment.json diff --git a/demo/records/watcher/deployments/AzimuthWatcherDeployment.json b/demo/records/watcher/deployments/azimuth-watcher-deployment.json similarity index 100% rename from demo/records/watcher/deployments/AzimuthWatcherDeployment.json rename to demo/records/watcher/deployments/azimuth-watcher-deployment.json diff --git a/demo/records/watcher/deployments/SushiswapWatcherDeployment.json b/demo/records/watcher/deployments/sushiswap-watcher-deployment.json similarity index 100% rename from demo/records/watcher/deployments/SushiswapWatcherDeployment.json rename to demo/records/watcher/deployments/sushiswap-watcher-deployment.json diff --git a/demo/records/watcher/SushiswapWatcher.json b/demo/records/watcher/sushiswap-watcher.json similarity index 100% rename from demo/records/watcher/SushiswapWatcher.json rename to demo/records/watcher/sushiswap-watcher.json diff --git a/demo/scripts/publish-records.ts b/demo/scripts/publish-records.ts index aa4c1c6..efb2a72 100644 --- a/demo/scripts/publish-records.ts +++ b/demo/scripts/publish-records.ts @@ -154,7 +154,7 @@ function getArgs (): any { }) .option('records', { alias: 'r', - describe: 'Endpoint records', + describe: 'Records dir path', type: 'string', demandOption: true }) diff --git a/src/types/common/main.d.ts b/demo/types/common/main.d.ts similarity index 100% rename from src/types/common/main.d.ts rename to demo/types/common/main.d.ts diff --git a/src/types/common/package.json b/demo/types/common/package.json similarity index 100% rename from src/types/common/package.json rename to demo/types/common/package.json diff --git a/tsconfig.json b/tsconfig.json index 3641834..1f4d39c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,7 +31,7 @@ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ "typeRoots": [ - "./src/types" + "./demo/types" ], // "types": [], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -100,6 +100,6 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "include": ["src"], + "include": ["src", "demo"], "exclude": ["test"] } -- 2.45.2 From cb4f0d6fe87de410e5cc47d26d21823df02ae667 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 12:24:32 +0530 Subject: [PATCH 17/20] Add expected outputs --- demo/README.md | 10 ++++++++++ .../service/deployments/gibbon-geth-deployment.json | 2 +- .../service/deployments/kindred-geth-deployment.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/demo/README.md b/demo/README.md index 87eac91..8b975d2 100644 --- a/demo/README.md +++ b/demo/README.md @@ -64,6 +64,9 @@ # Get the deployment URL(s) laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID | jq -r '.[].attributes.url' + + # Expected output: + https://ajna-watcher-endpoint.example.com ``` * Query for `sushiswap-v3-subgraph` deployment(s): @@ -81,6 +84,9 @@ # Get the deployment URL(s) laconic registry record list --all --type SubgraphDeploymentRecord subgraph $SUBGRAPH_RECORD_ID | jq -r '.[].attributes.url' + + # Expected output: + # https://sushiswap-v3-subgraph-endpoint.example.com ``` * Query for `geth` service deployment(s): @@ -98,4 +104,8 @@ # Get the deployment URL(s) 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 ``` diff --git a/demo/records/service/deployments/gibbon-geth-deployment.json b/demo/records/service/deployments/gibbon-geth-deployment.json index 45e755d..167578d 100644 --- a/demo/records/service/deployments/gibbon-geth-deployment.json +++ b/demo/records/service/deployments/gibbon-geth-deployment.json @@ -5,7 +5,7 @@ "request": "", "name": "geth", "service": "", - "url": "https://geth-rpc-endpoint.example.com", + "url": "https://geth-rpc-endpoint-2.example.com", "needs_auth": false, "meta": { "machine_name": "gibbon", diff --git a/demo/records/service/deployments/kindred-geth-deployment.json b/demo/records/service/deployments/kindred-geth-deployment.json index 3c24e15..7be6902 100644 --- a/demo/records/service/deployments/kindred-geth-deployment.json +++ b/demo/records/service/deployments/kindred-geth-deployment.json @@ -5,7 +5,7 @@ "request": "", "name": "geth", "service": "", - "url": "https://geth-rpc-endpoint.example.com", + "url": "https://geth-rpc-endpoint-1.example.com", "needs_auth": false, "meta": { "machine_name": "kindred", -- 2.45.2 From 401493eaac1dcd261c080a32a53014c78d0c883c Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 14:28:57 +0530 Subject: [PATCH 18/20] Update instructions --- demo/README.md | 34 ++++++++++--------- .../deployments/archive-lotus-deployment.json | 16 --------- .../deployments/gibbon-geth-deployment.json | 16 --------- .../deployments/kindred-geth-deployment.json | 16 --------- .../deployments/sandman-lotus-deployment.json | 16 --------- demo/records/service/geth.json | 9 ----- demo/records/service/lotus.json | 9 ----- .../sushiswap-blocks-subgraph-deployment.json | 14 -------- ...p-route-processor-subgraph-deployment.json | 14 -------- .../sushiswap-subgraph-deployment.json | 14 -------- .../sushiswap-v2-subgraph-deployment.json | 14 -------- .../sushiswap-v3-subgraph-deployment.json | 14 -------- .../subgraph/sushiswap-blocks-subgraph.json | 10 ------ .../sushiswap-route-processor-subgraph.json | 10 ------ demo/records/subgraph/sushiswap-subgraph.json | 10 ------ .../subgraph/sushiswap-v2-subgraph.json | 10 ------ .../subgraph/sushiswap-v3-subgraph.json | 10 ------ demo/records/watcher/ajna-watcher.json | 10 ------ demo/records/watcher/azimuth-watcher.json | 10 ------ .../deployments/ajna-watcher-deployment.json | 12 ------- .../azimuth-watcher-deployment.json | 12 ------- .../sushiswap-watcher-deployment.json | 12 ------- demo/records/watcher/sushiswap-watcher.json | 10 ------ demo/types/common/main.d.ts | 5 --- src/types/common/main.d.ts | 1 + {demo => src}/types/common/package.json | 0 tsconfig.json | 4 +-- 27 files changed, 21 insertions(+), 291 deletions(-) delete mode 100644 demo/records/service/deployments/archive-lotus-deployment.json delete mode 100644 demo/records/service/deployments/gibbon-geth-deployment.json delete mode 100644 demo/records/service/deployments/kindred-geth-deployment.json delete mode 100644 demo/records/service/deployments/sandman-lotus-deployment.json delete mode 100644 demo/records/service/geth.json delete mode 100644 demo/records/service/lotus.json delete mode 100644 demo/records/subgraph/deployments/sushiswap-blocks-subgraph-deployment.json delete mode 100644 demo/records/subgraph/deployments/sushiswap-route-processor-subgraph-deployment.json delete mode 100644 demo/records/subgraph/deployments/sushiswap-subgraph-deployment.json delete mode 100644 demo/records/subgraph/deployments/sushiswap-v2-subgraph-deployment.json delete mode 100644 demo/records/subgraph/deployments/sushiswap-v3-subgraph-deployment.json delete mode 100644 demo/records/subgraph/sushiswap-blocks-subgraph.json delete mode 100644 demo/records/subgraph/sushiswap-route-processor-subgraph.json delete mode 100644 demo/records/subgraph/sushiswap-subgraph.json delete mode 100644 demo/records/subgraph/sushiswap-v2-subgraph.json delete mode 100644 demo/records/subgraph/sushiswap-v3-subgraph.json delete mode 100644 demo/records/watcher/ajna-watcher.json delete mode 100644 demo/records/watcher/azimuth-watcher.json delete mode 100644 demo/records/watcher/deployments/ajna-watcher-deployment.json delete mode 100644 demo/records/watcher/deployments/azimuth-watcher-deployment.json delete mode 100644 demo/records/watcher/deployments/sushiswap-watcher-deployment.json delete mode 100644 demo/records/watcher/sushiswap-watcher.json delete mode 100644 demo/types/common/main.d.ts create mode 100644 src/types/common/main.d.ts rename {demo => src}/types/common/package.json (100%) diff --git a/demo/README.md b/demo/README.md index 8b975d2..dc85552 100644 --- a/demo/README.md +++ b/demo/README.md @@ -2,10 +2,12 @@ ## Setup +* Install laconic CLI globally as suggested in the [installation steps](../README.md#install) + * Run the laconicd chain: ```bash - # In laconcid + # In laconci2d repo make install ./scripts/init.sh clean ``` @@ -13,38 +15,38 @@ * Create and populate `config.yml` following [config.example.yml](./config.example.yml): ```bash + # In laconic-registry-cli repo root cp config.example.yml config.yml - # Change the gas value in config.yml + # Update the gas value in config.yml # gas: 500000 - # Get user key and set it to userKey in config.yml + # Get user private key laconicd keys export alice --unarmored-hex --unsafe --keyring-backend test --home ~/.laconicd + # Set the output as 'userKey' in config.yml + # userKey: + # Create a bond - laconicd tx bond create 100000000000photon --fees 100photon --from alice + laconic --config config.yml registry bond create --type photon --quantity 100000000000 - # Get the bond id and set it to bondId in config.yml - laconicd query bond list - ``` + # Get the bond id + laconic --config config.yml registry bond list | jq -r '.[].id' -* Install the CLI: - - ```bash - yarn && yarn build - yarn global add file:$PWD + # Set the output as 'bondId' in config.yml + # bondId: ``` ## Run -* Publish records from [`demo/records`](./demo/records): +* Publish records: ```bash - # Publishes records and corresponding 'deployment' records + # Publishes records and corresponding 'deployment' records from given directory - # In laconic-registry-cli + # In laconic-registry-cli repo root # Use records dir path for '--records' as required - yarn ts-node demo/scripts/publish-records.ts --config config.yml --records demo/records + yarn ts-node demo/scripts/publish-records.ts --config config.yml --records ``` ### Example diff --git a/demo/records/service/deployments/archive-lotus-deployment.json b/demo/records/service/deployments/archive-lotus-deployment.json deleted file mode 100644 index 8ff94e8..0000000 --- a/demo/records/service/deployments/archive-lotus-deployment.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "ServiceDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "lotus", - "service": "", - "url": "https://lotus-rpc-endpoint.example.com", - "needs_auth": false, - "meta": { - "machine_name": "", - "node_type": "archive", - "chain": "314", - "eth_rpc_enabled": true - } -} diff --git a/demo/records/service/deployments/gibbon-geth-deployment.json b/demo/records/service/deployments/gibbon-geth-deployment.json deleted file mode 100644 index 167578d..0000000 --- a/demo/records/service/deployments/gibbon-geth-deployment.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "ServiceDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "geth", - "service": "", - "url": "https://geth-rpc-endpoint-2.example.com", - "needs_auth": false, - "meta": { - "machine_name": "gibbon", - "chain": "1", - "sync_mode": "snap", - "gc_mode": "archive" - } -} diff --git a/demo/records/service/deployments/kindred-geth-deployment.json b/demo/records/service/deployments/kindred-geth-deployment.json deleted file mode 100644 index 7be6902..0000000 --- a/demo/records/service/deployments/kindred-geth-deployment.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "ServiceDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "geth", - "service": "", - "url": "https://geth-rpc-endpoint-1.example.com", - "needs_auth": false, - "meta": { - "machine_name": "kindred", - "chain": "1", - "sync_mode": "full", - "gc_mode": "archive" - } -} diff --git a/demo/records/service/deployments/sandman-lotus-deployment.json b/demo/records/service/deployments/sandman-lotus-deployment.json deleted file mode 100644 index 977fb33..0000000 --- a/demo/records/service/deployments/sandman-lotus-deployment.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "ServiceDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "lotus", - "service": "", - "url": "https://lotus-rpc-endpoint.example.com", - "needs_auth": false, - "meta": { - "machine_name": "sandman", - "node_type": "full", - "chain": "314", - "eth_rpc_enabled": true - } -} diff --git a/demo/records/service/geth.json b/demo/records/service/geth.json deleted file mode 100644 index 8d7ff5e..0000000 --- a/demo/records/service/geth.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "ServiceRecord", - "version": "0.1.0", - "schema": "", - "name": "geth", - "repository": "https://git.vdb.to/cerc-io/plugeth", - "repository_ref": "c50b6cc026207b195ad7f9afdbe919a1fe676e67", - "repository_tag": "v1.13.14-cerc-0" -} diff --git a/demo/records/service/lotus.json b/demo/records/service/lotus.json deleted file mode 100644 index 393915e..0000000 --- a/demo/records/service/lotus.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "ServiceRecord", - "version": "0.1.0", - "schema": "", - "name": "lotus", - "repository": "https://git.vdb.to/cerc-io/lotus", - "repository_ref": "9dc9a5cf45acc7ee86371af2092dd7c04db26930", - "repository_tag": "v1.26.1" -} diff --git a/demo/records/subgraph/deployments/sushiswap-blocks-subgraph-deployment.json b/demo/records/subgraph/deployments/sushiswap-blocks-subgraph-deployment.json deleted file mode 100644 index ad78a6b..0000000 --- a/demo/records/subgraph/deployments/sushiswap-blocks-subgraph-deployment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "SubgraphDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "sushiswap-blocks-subgraph", - "subgraph_name": "sushiswap/blocks", - "subgraph": "", - "subgraph_id": "QmfBt5NbZdNhBoZS6MFj891YpNWQs8ysWkwVeEHF6rvscg", - "network": "filecoin", - "chain": "314", - "url": "https://sushiswap-blocks-subgraph-endpoint.example.com", - "needs_auth": false -} diff --git a/demo/records/subgraph/deployments/sushiswap-route-processor-subgraph-deployment.json b/demo/records/subgraph/deployments/sushiswap-route-processor-subgraph-deployment.json deleted file mode 100644 index d35d16a..0000000 --- a/demo/records/subgraph/deployments/sushiswap-route-processor-subgraph-deployment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "SubgraphDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "sushiswap-route-processor-subgraph", - "subgraph_name": "sushiswap/rp4-filecoin", - "subgraph": "", - "subgraph_id": "QmcHTxwH74YgaMJFXKrNqpVVdQQWAyhbxMh9xUtYjKa3fw", - "network": "filecoin", - "chain": "314", - "url": "https://sushiswap-route-processor-subgraph-endpoint.example.com", - "needs_auth": false -} diff --git a/demo/records/subgraph/deployments/sushiswap-subgraph-deployment.json b/demo/records/subgraph/deployments/sushiswap-subgraph-deployment.json deleted file mode 100644 index cd83669..0000000 --- a/demo/records/subgraph/deployments/sushiswap-subgraph-deployment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "SubgraphDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "sushiswap-subgraph", - "subgraph_name": "sushiswap/sushiswap-filecoin", - "subgraph": "", - "subgraph_id": "QmbZdkSH5NoS1aycafeqQZ7QJycokDVBXG2526g5KmuR1F", - "network": "filecoin", - "chain": "314", - "url": "https://sushiswap-subgraph-endpoint.example.com", - "needs_auth": false -} diff --git a/demo/records/subgraph/deployments/sushiswap-v2-subgraph-deployment.json b/demo/records/subgraph/deployments/sushiswap-v2-subgraph-deployment.json deleted file mode 100644 index ab71419..0000000 --- a/demo/records/subgraph/deployments/sushiswap-v2-subgraph-deployment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "SubgraphDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "sushiswap-v2-subgraph", - "subgraph_name": "sushiswap/v2-filecoin", - "subgraph": "", - "subgraph_id": "QmejnkeYZxJKxz6kV62V6mSmAKVDuyoiDsempRC6NMunYo", - "network": "filecoin", - "chain": "314", - "url": "https://sushiswap-v2-subgraph-endpoint.example.com", - "needs_auth": false -} diff --git a/demo/records/subgraph/deployments/sushiswap-v3-subgraph-deployment.json b/demo/records/subgraph/deployments/sushiswap-v3-subgraph-deployment.json deleted file mode 100644 index dec8b61..0000000 --- a/demo/records/subgraph/deployments/sushiswap-v3-subgraph-deployment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "SubgraphDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "sushiswap-v3-subgraph", - "subgraph_name": "sushiswap/v3-filecoin", - "subgraph": "", - "subgraph_id": "QmRPQM4ZtRJYr8WiNdg6oqKRNQHHXv5rZrD4gzqQrJpPhz", - "network": "filecoin", - "chain": "314", - "url": "https://sushiswap-v3-subgraph-endpoint.example.com", - "needs_auth": false -} diff --git a/demo/records/subgraph/sushiswap-blocks-subgraph.json b/demo/records/subgraph/sushiswap-blocks-subgraph.json deleted file mode 100644 index 2c7f942..0000000 --- a/demo/records/subgraph/sushiswap-blocks-subgraph.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "SubgraphRecord", - "version": "0.1.0", - "schema": "", - "name": "sushiswap-blocks-subgraph", - "repository": "https://github.com/sushiswap/subgraphs", - "repository_ref": "533749731563023903410a58013167bc10d06a88", - "repository_tag": "", - "subgraph_dir": "subgraphs/blocks" -} diff --git a/demo/records/subgraph/sushiswap-route-processor-subgraph.json b/demo/records/subgraph/sushiswap-route-processor-subgraph.json deleted file mode 100644 index a826587..0000000 --- a/demo/records/subgraph/sushiswap-route-processor-subgraph.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "SubgraphRecord", - "version": "0.1.0", - "schema": "", - "name": "sushiswap-route-processor-subgraph", - "repository": "https://github.com/sushiswap/subgraphs", - "repository_ref": "382f888489ffc27d394775f9c1719dba7bacef63", - "repository_tag": "", - "subgraph_dir": "subgraphs/route-processor" -} diff --git a/demo/records/subgraph/sushiswap-subgraph.json b/demo/records/subgraph/sushiswap-subgraph.json deleted file mode 100644 index ca7b666..0000000 --- a/demo/records/subgraph/sushiswap-subgraph.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "SubgraphRecord", - "version": "0.1.0", - "schema": "", - "name": "sushiswap-subgraph", - "repository": "https://github.com/sushiswap/subgraphs", - "repository_ref": "533749731563023903410a58013167bc10d06a88", - "repository_tag": "", - "subgraph_dir": "subgraphs/sushiswap" -} diff --git a/demo/records/subgraph/sushiswap-v2-subgraph.json b/demo/records/subgraph/sushiswap-v2-subgraph.json deleted file mode 100644 index d68fcfb..0000000 --- a/demo/records/subgraph/sushiswap-v2-subgraph.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "SubgraphRecord", - "version": "0.1.0", - "schema": "", - "name": "sushiswap-v2-subgraph", - "repository": "https://github.com/sushiswap/subgraphs", - "repository_ref": "d491b69adb9ff3666162ac284ab77a146f231794", - "repository_tag": "", - "subgraph_dir": "subgraphs/v2" -} diff --git a/demo/records/subgraph/sushiswap-v3-subgraph.json b/demo/records/subgraph/sushiswap-v3-subgraph.json deleted file mode 100644 index 09fc58f..0000000 --- a/demo/records/subgraph/sushiswap-v3-subgraph.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "SubgraphRecord", - "version": "0.1.0", - "schema": "", - "name": "sushiswap-v3-subgraph", - "repository": "https://github.com/sushiswap/subgraphs", - "repository_ref": "d491b69adb9ff3666162ac284ab77a146f231794", - "repository_tag": "", - "subgraph_dir": "subgraphs/v3" -} diff --git a/demo/records/watcher/ajna-watcher.json b/demo/records/watcher/ajna-watcher.json deleted file mode 100644 index 2433ebb..0000000 --- a/demo/records/watcher/ajna-watcher.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "WatcherRecord", - "version": "0.1.0", - "schema": "", - "name": "ajna-watcher", - "repository": "https://git.vdb.to/cerc-io/ajna-watcher-ts", - "repository_ref": "66b8d96308eacab1ef6a4f3cb74a0f28fb18dc67", - "repository_tag": "v0.1.3", - "is_subgraph_watcher": true -} diff --git a/demo/records/watcher/azimuth-watcher.json b/demo/records/watcher/azimuth-watcher.json deleted file mode 100644 index c3075a2..0000000 --- a/demo/records/watcher/azimuth-watcher.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "WatcherRecord", - "version": "0.1.0", - "schema": "", - "name": "azimuth-watcher", - "repository": "https://github.com/cerc-io/azimuth-watcher-ts", - "repository_ref": "ffd8baa4bcdd0b0fff701d942de572b7ddf33191", - "repository_tag": "v0.1.3", - "is_subgraph_watcher": false -} diff --git a/demo/records/watcher/deployments/ajna-watcher-deployment.json b/demo/records/watcher/deployments/ajna-watcher-deployment.json deleted file mode 100644 index 352f6d1..0000000 --- a/demo/records/watcher/deployments/ajna-watcher-deployment.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "WatcherDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "ajna-watcher", - "watcher": "", - "kind": "active", - "chain": "314", - "url": "https://ajna-watcher-endpoint.example.com", - "needs_auth": true -} diff --git a/demo/records/watcher/deployments/azimuth-watcher-deployment.json b/demo/records/watcher/deployments/azimuth-watcher-deployment.json deleted file mode 100644 index 68a4e53..0000000 --- a/demo/records/watcher/deployments/azimuth-watcher-deployment.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "WatcherDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "azimuth-watcher", - "watcher": "", - "kind": "active", - "chain": "1", - "url": "https://azimuth-watcher-endpoint.example.com", - "needs_auth": false -} diff --git a/demo/records/watcher/deployments/sushiswap-watcher-deployment.json b/demo/records/watcher/deployments/sushiswap-watcher-deployment.json deleted file mode 100644 index aedbc0f..0000000 --- a/demo/records/watcher/deployments/sushiswap-watcher-deployment.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "WatcherDeploymentRecord", - "version": "0.1.0", - "schema": "", - "request": "", - "name": "sushiswap-v3-watcher", - "watcher": "", - "kind": "active", - "chain": "314", - "url": "https://sushiswap-v3-watcher-endpoint.example.com", - "needs_auth": true -} diff --git a/demo/records/watcher/sushiswap-watcher.json b/demo/records/watcher/sushiswap-watcher.json deleted file mode 100644 index b036f73..0000000 --- a/demo/records/watcher/sushiswap-watcher.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "WatcherRecord", - "version": "0.1.0", - "schema": "", - "name": "sushiswap-v3-watcher", - "repository": "https://github.com/cerc-io/sushiswap-v3-watcher-ts", - "repository_ref": "2f9f4d1ca191805922a51d1e3b471c06314fbc64", - "repository_tag": "v0.1.9", - "is_subgraph_watcher": true -} diff --git a/demo/types/common/main.d.ts b/demo/types/common/main.d.ts deleted file mode 100644 index da0661c..0000000 --- a/demo/types/common/main.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// -// Copyright 2022 Vulcanize, Inc. -// - -declare module 'lodash-clean'; diff --git a/src/types/common/main.d.ts b/src/types/common/main.d.ts new file mode 100644 index 0000000..c9cad7c --- /dev/null +++ b/src/types/common/main.d.ts @@ -0,0 +1 @@ +declare module 'lodash-clean'; diff --git a/demo/types/common/package.json b/src/types/common/package.json similarity index 100% rename from demo/types/common/package.json rename to src/types/common/package.json diff --git a/tsconfig.json b/tsconfig.json index 1f4d39c..aad8af0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,7 +31,7 @@ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ "typeRoots": [ - "./demo/types" + "src/types" ], // "types": [], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -100,6 +100,6 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "include": ["src", "demo"], + "include": ["src"], "exclude": ["test"] } -- 2.45.2 From 95fb072568baf41fd3ef49a3d93fd5a7f0a9bcc7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 14:42:32 +0530 Subject: [PATCH 19/20] Update typeRoots in tsconfig --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index aad8af0..91d62b2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,6 +31,7 @@ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ "typeRoots": [ + "node_modules/@types", "src/types" ], // "types": [], /* Specify type package names to be included without being referenced in a source file. */ -- 2.45.2 From 0a38d13eea1a2dcae914b2f50a3c27bb5958b90d Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 15:16:08 +0530 Subject: [PATCH 20/20] Update laconic CLI installation --- demo/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/demo/README.md b/demo/README.md index dc85552..0611fa8 100644 --- a/demo/README.md +++ b/demo/README.md @@ -2,7 +2,13 @@ ## Setup -* Install laconic CLI globally as suggested in the [installation steps](../README.md#install) +* Install laconic CLI globally: + + ```bash + # In laconic-registry-cli repo root + yarn && yarn build + yarn global add file:$PWD + ``` * Run the laconicd chain: -- 2.45.2