From 4813bdaa4df6647ad2d0506561d939c858495819 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Thu, 3 Oct 2024 10:20:38 +0530 Subject: [PATCH] Changes to upgrade registry-sdk --- packages/backend/README.md | 4 +- .../backend/environments/local.toml.example | 6 +- packages/backend/package.json | 3 +- packages/backend/src/config.ts | 4 +- packages/backend/src/registry.ts | 73 ++--- packages/backend/src/utils.ts | 24 ++ packages/backend/test/delete-db.ts | 4 +- packages/backend/test/initialize-db.ts | 4 +- packages/backend/test/initialize-registry.ts | 21 +- .../backend/test/publish-deploy-records.ts | 20 +- .../publish-deployment-removal-records.ts | 16 +- packages/deployer/README.md | 8 +- packages/deployer/config.staging.yml | 7 +- packages/deployer/config.yml | 7 +- packages/deployer/deploy-frontend.sh | 26 +- packages/deployer/deploy-frontend.staging.sh | 26 +- .../test-webapp-deployment-undeployment.sh | 30 +- yarn.lock | 262 +++++++++++++++++- 18 files changed, 413 insertions(+), 132 deletions(-) diff --git a/packages/backend/README.md b/packages/backend/README.md index bfcc2d45..7fb3c8e3 100644 --- a/packages/backend/README.md +++ b/packages/backend/README.md @@ -22,10 +22,10 @@ yarn build --ignore frontend #### Local -Copy the `envionments/local.toml.example` file to `envionments/local.toml`: +Copy the `environments/local.toml.example` file to `environments/local.toml`: ```zsh -cp envionments/local.toml.example envionments/local.toml +cp environments/local.toml.example environments/local.toml ``` #### Staging environment variables diff --git a/packages/backend/environments/local.toml.example b/packages/backend/environments/local.toml.example index e1888989..25ba34cd 100644 --- a/packages/backend/environments/local.toml.example +++ b/packages/backend/environments/local.toml.example @@ -36,9 +36,9 @@ bondId = "" authority = "" [registryConfig.fee] - amount = "200000" - denom = "aphoton" - gas = "750000" + gas = "200000" + fees = "200000alnt" + gasPrice = "" [misc] projectDomain = "apps.snowballtools.com" diff --git a/packages/backend/package.json b/packages/backend/package.json index 676d21ea..68f2321b 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -4,10 +4,11 @@ "version": "1.0.0", "main": "index.js", "dependencies": { + "@cerc-io/registry-sdk": "^0.2.5", + "@cosmjs/stargate": "^0.32.4", "@graphql-tools/schema": "^10.0.2", "@graphql-tools/utils": "^10.0.12", "@octokit/oauth-app": "^6.1.0", - "@snowballtools/laconic-sdk": "^0.1.17", "@turnkey/sdk-server": "^0.1.0", "@types/debug": "^4.1.5", "@types/express": "^4.17.21", diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 2f5f1da9..e326f9b0 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -36,9 +36,9 @@ export interface RegistryConfig { fetchDeploymentRecordDelay: number; authority: string; fee: { - amount: string; - denom: string; gas: string; + fees: string; + gasPrice: string; }; } diff --git a/packages/backend/src/registry.ts b/packages/backend/src/registry.ts index fee386c7..dfb95d80 100644 --- a/packages/backend/src/registry.ts +++ b/packages/backend/src/registry.ts @@ -3,7 +3,7 @@ import assert from 'assert'; import { inc as semverInc } from 'semver'; import { DateTime } from 'luxon'; -import { Registry as LaconicRegistry } from '@snowballtools/laconic-sdk'; +import { Registry as LaconicRegistry } from '@cerc-io/registry-sdk'; import { RegistryConfig } from './config'; import { @@ -13,7 +13,7 @@ import { ApplicationDeploymentRemovalRequest } from './entity/Deployment'; import { AppDeploymentRecord, AppDeploymentRemovalRecord, PackageJSON } from './types'; -import { sleep } from './utils'; +import { parseGasAndFees, sleep } from './utils'; const log = debug('snowball:registry'); @@ -24,7 +24,7 @@ const APP_DEPLOYMENT_RECORD_TYPE = 'ApplicationDeploymentRecord'; const APP_DEPLOYMENT_REMOVAL_RECORD_TYPE = 'ApplicationDeploymentRemovalRecord'; const SLEEP_DURATION = 1000; -// TODO: Move registry code to laconic-sdk/watcher-ts +// TODO: Move registry code to registry-sdk/watcher-ts export class Registry { private registry: LaconicRegistry; private registryConfig: RegistryConfig; @@ -34,7 +34,7 @@ export class Registry { this.registry = new LaconicRegistry( registryConfig.gqlEndpoint, registryConfig.restEndpoint, - registryConfig.chainId + { chainId: registryConfig.chainId } ); } @@ -54,7 +54,7 @@ export class Registry { applicationRecordId: string; applicationRecordData: ApplicationRecord; }> { - // Use laconic-sdk to publish record + // Use registry-sdk to publish record // Reference: https://git.vdb.to/cerc-io/test-progressive-web-app/src/branch/main/scripts/publish-app-record.sh // Fetch previous records const records = await this.registry.queryRecords( @@ -100,48 +100,50 @@ export class Registry { ...(packageJSON.version && { app_version: packageJSON.version }) }; + const fee = parseGasAndFees(this.registryConfig.fee.gas, this.registryConfig.fee.fees); + const result = await this.registry.setRecord( { privateKey: this.registryConfig.privateKey, record: applicationRecord, bondId: this.registryConfig.bondId }, - '', - this.registryConfig.fee + this.registryConfig.privateKey, + fee ); log('Application record data:', applicationRecord); - // TODO: Discuss computation of CRN - const crn = this.getCrn(appName); - log(`Setting name: ${crn} for record ID: ${result.data.id}`); + // TODO: Discuss computation of LRN + const lrn = this.getLrn(appName); + log(`Setting name: ${lrn} for record ID: ${result.id}`); await sleep(SLEEP_DURATION); await this.registry.setName( - { cid: result.data.id, crn }, + { cid: result.id, lrn }, this.registryConfig.privateKey, - this.registryConfig.fee + fee ); await sleep(SLEEP_DURATION); await this.registry.setName( - { cid: result.data.id, crn: `${crn}@${applicationRecord.app_version}` }, + { cid: result.id, lrn: `${lrn}@${applicationRecord.app_version}` }, this.registryConfig.privateKey, - this.registryConfig.fee + fee ); await sleep(SLEEP_DURATION); await this.registry.setName( { - cid: result.data.id, - crn: `${crn}@${applicationRecord.repository_ref}` + cid: result.id, + lrn: `${lrn}@${applicationRecord.repository_ref}` }, this.registryConfig.privateKey, - this.registryConfig.fee + fee ); return { - applicationRecordId: result.data.id, + applicationRecordId: result.id, applicationRecordData: applicationRecord }; } @@ -156,12 +158,12 @@ export class Registry { applicationDeploymentRequestId: string; applicationDeploymentRequestData: ApplicationDeploymentRequest; }> { - const crn = this.getCrn(data.appName); - const records = await this.registry.resolveNames([crn]); + const lrn = this.getLrn(data.appName); + const records = await this.registry.resolveNames([lrn]); const applicationRecord = records[0]; if (!applicationRecord) { - throw new Error(`No record found for ${crn}`); + throw new Error(`No record found for ${lrn}`); } // Create record of type ApplicationDeploymentRequest and publish @@ -169,11 +171,11 @@ export class Registry { type: APP_DEPLOYMENT_REQUEST_TYPE, version: '1.0.0', name: `${applicationRecord.attributes.name}@${applicationRecord.attributes.app_version}`, - application: `${crn}@${applicationRecord.attributes.app_version}`, + application: `${lrn}@${applicationRecord.attributes.app_version}`, dns: data.dns, // TODO: Not set in test-progressive-web-app CI - // deployment: '$CERC_REGISTRY_DEPLOYMENT_CRN', + // deployment: '$CERC_REGISTRY_DEPLOYMENT_LRN', // https://git.vdb.to/cerc-io/laconic-registry-cli/commit/129019105dfb93bebcea02fde0ed64d0f8e5983b config: JSON.stringify({ @@ -189,20 +191,23 @@ export class Registry { }; await sleep(SLEEP_DURATION); + + const fee = parseGasAndFees(this.registryConfig.fee.gas, this.registryConfig.fee.fees); + const result = await this.registry.setRecord( { privateKey: this.registryConfig.privateKey, record: applicationDeploymentRequest, bondId: this.registryConfig.bondId }, - '', - this.registryConfig.fee + this.registryConfig.privateKey, + fee ); - log(`Application deployment request record published: ${result.data.id}`); + log(`Application deployment request record published: ${result.id}`); log('Application deployment request data:', applicationDeploymentRequest); return { - applicationDeploymentRequestId: result.data.id, + applicationDeploymentRequestId: result.id, applicationDeploymentRequestData: applicationDeploymentRequest }; } @@ -281,27 +286,29 @@ export class Registry { deployment: data.deploymentId }; + const fee = parseGasAndFees(this.registryConfig.fee.gas, this.registryConfig.fee.fees); + const result = await this.registry.setRecord( { privateKey: this.registryConfig.privateKey, record: applicationDeploymentRemovalRequest, bondId: this.registryConfig.bondId }, - '', - this.registryConfig.fee + this.registryConfig.privateKey, + fee ); - log(`Application deployment removal request record published: ${result.data.id}`); + log(`Application deployment removal request record published: ${result.id}`); log('Application deployment removal request data:', applicationDeploymentRemovalRequest); return { - applicationDeploymentRemovalRequestId: result.data.id, + applicationDeploymentRemovalRequestId: result.id, applicationDeploymentRemovalRequestData: applicationDeploymentRemovalRequest }; } - getCrn (appName: string): string { + getLrn(appName: string): string { assert(this.registryConfig.authority, "Authority doesn't exist"); - return `crn://${this.registryConfig.authority}/applications/${appName}`; + return `lrn://${this.registryConfig.authority}/applications/${appName}`; } } diff --git a/packages/backend/src/utils.ts b/packages/backend/src/utils.ts index eafc698b..8d3d1eb0 100644 --- a/packages/backend/src/utils.ts +++ b/packages/backend/src/utils.ts @@ -1,8 +1,12 @@ +import assert from 'assert'; import fs from 'fs-extra'; import path from 'path'; import toml from 'toml'; import debug from 'debug'; import { DataSource, DeepPartial, EntityTarget, ObjectLiteral } from 'typeorm'; + +import { parseCoins, StdFee } from '@cosmjs/stargate'; + import { Config } from './config'; import { DEFAULT_CONFIG_FILE_PATH } from './constants'; @@ -76,3 +80,23 @@ export const loadAndSaveData = async ( export const sleep = async (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)); + +export const parseGasAndFees = (gas?: string, fees?: string): StdFee | number | undefined => { + // If fees is not given or a number, treat it as a gas estimation multiplier + if (fees === null || fees === undefined) { + return undefined; + } + + const isFeesANumber = !isNaN(Number(fees)); + if (isFeesANumber) { + return Number(fees); + } + + // If fees is not a gas estimation multiplier, gas is required + assert(gas, 'Invalid gas.'); + + return { + amount: parseCoins(String(fees)), + gas: String(gas) + }; +}; diff --git a/packages/backend/test/delete-db.ts b/packages/backend/test/delete-db.ts index d984fc8c..da840037 100644 --- a/packages/backend/test/delete-db.ts +++ b/packages/backend/test/delete-db.ts @@ -2,8 +2,6 @@ import * as fs from 'fs/promises'; import debug from 'debug'; import { getConfig } from '../src/utils'; -import { Config } from '../src/config'; -import { DEFAULT_CONFIG_FILE_PATH } from '../src/constants'; const log = debug('snowball:delete-database'); @@ -13,7 +11,7 @@ const deleteFile = async (filePath: string) => { }; const main = async () => { - const config = await getConfig(DEFAULT_CONFIG_FILE_PATH); + const config = await getConfig(); deleteFile(config.database.dbPath); }; diff --git a/packages/backend/test/initialize-db.ts b/packages/backend/test/initialize-db.ts index c4384294..e9da407f 100644 --- a/packages/backend/test/initialize-db.ts +++ b/packages/backend/test/initialize-db.ts @@ -16,8 +16,6 @@ import { getEntities, loadAndSaveData } from '../src/utils'; -import { Config } from '../src/config'; -import { DEFAULT_CONFIG_FILE_PATH } from '../src/constants'; const log = debug('snowball:initialize-database'); @@ -156,7 +154,7 @@ const generateTestData = async (dataSource: DataSource) => { }; const main = async () => { - const config = await getConfig(DEFAULT_CONFIG_FILE_PATH); + const config = await getConfig(); const isDbPresent = await checkFileExists(config.database.dbPath); if (!isDbPresent) { diff --git a/packages/backend/test/initialize-registry.ts b/packages/backend/test/initialize-registry.ts index b7dc77bb..414bd88f 100644 --- a/packages/backend/test/initialize-registry.ts +++ b/packages/backend/test/initialize-registry.ts @@ -1,39 +1,40 @@ import debug from 'debug'; -import { Registry } from '@snowballtools/laconic-sdk'; +import { Registry } from '@cerc-io/registry-sdk'; -import { DEFAULT_CONFIG_FILE_PATH } from '../src/constants'; -import { Config } from '../src/config'; -import { getConfig } from '../src/utils'; +import { getConfig, parseGasAndFees } from '../src/utils'; const log = debug('snowball:initialize-registry'); -const DENOM = 'aphoton'; +const DENOM = 'alnt'; const BOND_AMOUNT = '1000000000'; async function main () { - const { registryConfig } = await getConfig(DEFAULT_CONFIG_FILE_PATH); + const { registryConfig } = await getConfig(); // TODO: Get authority names from args const authorityNames = ['snowballtools', registryConfig.authority]; - const registry = new Registry(registryConfig.gqlEndpoint, registryConfig.restEndpoint, registryConfig.chainId); + const registry = new Registry(registryConfig.gqlEndpoint, registryConfig.restEndpoint, {chainId: registryConfig.chainId}); const bondId = await registry.getNextBondId(registryConfig.privateKey); log('bondId:', bondId); + + const fee = parseGasAndFees(registryConfig.fee.gas, registryConfig.fee.fees); + await registry.createBond( { denom: DENOM, amount: BOND_AMOUNT }, registryConfig.privateKey, - registryConfig.fee + fee ); for await (const name of authorityNames) { - await registry.reserveAuthority({ name }, registryConfig.privateKey, registryConfig.fee); + await registry.reserveAuthority({ name }, registryConfig.privateKey, fee); log('Reserved authority name:', name); await registry.setAuthorityBond( { name, bondId }, registryConfig.privateKey, - registryConfig.fee + fee ); log(`Bond ${bondId} set for authority ${name}`); } diff --git a/packages/backend/test/publish-deploy-records.ts b/packages/backend/test/publish-deploy-records.ts index f0fc22e6..7fca02cb 100644 --- a/packages/backend/test/publish-deploy-records.ts +++ b/packages/backend/test/publish-deploy-records.ts @@ -2,22 +2,20 @@ import debug from 'debug'; import { DataSource } from 'typeorm'; import path from 'path'; -import { Registry } from '@snowballtools/laconic-sdk'; +import { Registry } from '@cerc-io/registry-sdk'; -import { Config } from '../src/config'; -import { DEFAULT_CONFIG_FILE_PATH } from '../src/constants'; -import { getConfig } from '../src/utils'; +import { getConfig, parseGasAndFees } from '../src/utils'; import { Deployment, DeploymentStatus, Environment } from '../src/entity/Deployment'; const log = debug('snowball:publish-deploy-records'); -async function main () { - const { registryConfig, database, misc } = await getConfig(DEFAULT_CONFIG_FILE_PATH); +async function main() { + const { registryConfig, database, misc } = await getConfig(); const registry = new Registry( registryConfig.gqlEndpoint, registryConfig.restEndpoint, - registryConfig.chainId + { chainId: registryConfig.chainId } ); const dataSource = new DataSource({ @@ -61,6 +59,8 @@ async function main () { url }; + const fee = parseGasAndFees(registryConfig.fee.gas, registryConfig.fee.fees); + const result = await registry.setRecord( { privateKey: registryConfig.privateKey, @@ -68,7 +68,7 @@ async function main () { bondId: registryConfig.bondId }, '', - registryConfig.fee + fee ); // Remove deployment for project subdomain if deployment is for production environment @@ -82,12 +82,12 @@ async function main () { bondId: registryConfig.bondId }, '', - registryConfig.fee + fee ); } log('Application deployment record data:', applicationDeploymentRecord); - log(`Application deployment record published: ${result.data.id}`); + log(`Application deployment record published: ${result.id}`); } } diff --git a/packages/backend/test/publish-deployment-removal-records.ts b/packages/backend/test/publish-deployment-removal-records.ts index d8b026a3..97f237db 100644 --- a/packages/backend/test/publish-deployment-removal-records.ts +++ b/packages/backend/test/publish-deployment-removal-records.ts @@ -2,22 +2,20 @@ import debug from 'debug'; import { DataSource } from 'typeorm'; import path from 'path'; -import { Registry } from '@cerc-io/laconic-sdk'; +import { Registry } from '@cerc-io/registry-sdk'; -import { Config } from '../src/config'; -import { DEFAULT_CONFIG_FILE_PATH } from '../src/constants'; -import { getConfig } from '../src/utils'; +import { getConfig, parseGasAndFees } from '../src/utils'; import { Deployment, DeploymentStatus } from '../src/entity/Deployment'; const log = debug('snowball:publish-deployment-removal-records'); async function main () { - const { registryConfig, database, misc } = await getConfig(DEFAULT_CONFIG_FILE_PATH); + const { registryConfig, database } = await getConfig(); const registry = new Registry( registryConfig.gqlEndpoint, registryConfig.restEndpoint, - registryConfig.chainId + { chainId: registryConfig.chainId } ); const dataSource = new DataSource({ @@ -47,6 +45,8 @@ async function main () { request: deployment.applicationDeploymentRemovalRequestId, } + const fee = parseGasAndFees(registryConfig.fee.gas, registryConfig.fee.fees); + const result = await registry.setRecord( { privateKey: registryConfig.privateKey, @@ -54,11 +54,11 @@ async function main () { bondId: registryConfig.bondId }, '', - registryConfig.fee + fee ); log('Application deployment removal record data:', applicationDeploymentRemovalRecord); - log(`Application deployment removal record published: ${result.data.id}`); + log(`Application deployment removal record published: ${result.id}`); } } diff --git a/packages/deployer/README.md b/packages/deployer/README.md index b5866c7e..1a9d53dc 100644 --- a/packages/deployer/README.md +++ b/packages/deployer/README.md @@ -17,7 +17,7 @@ ```bash ./deploy-frontend.staging.sh ``` - + - To deploy frontend app to `dashboard.apps.snowballtools.com` ```bash @@ -51,14 +51,14 @@ ```bash # Account balance - yarn laconic cns account get + yarn laconic registry account get # Bond balance - yarn laconic cns bond get --id 99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be32 + yarn laconic registry bond get --id 99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be32 ``` - Command to refill bond ```bash - yarn laconic cns bond refill --id 99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be32 --type aphoton --quantity 10000000 + yarn laconic registry bond refill --id 99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be32 --type alnt --quantity 10000000 ``` diff --git a/packages/deployer/config.staging.yml b/packages/deployer/config.staging.yml index b89e50f2..4e0780c0 100644 --- a/packages/deployer/config.staging.yml +++ b/packages/deployer/config.staging.yml @@ -1,9 +1,10 @@ services: - cns: + registry: restEndpoint: 'http://console.laconic.com:1317' gqlEndpoint: 'http://console.laconic.com:9473/api' userKey: 87d00f66a73e2ca428adeb49ba9164d0ad9a87edc60e33d46ad3031b9c5701fe bondId: 89c75c7bc5759861d10285aff6f9e7227d6855e446b77ad5d8324822dfec7deb chainId: laconic_9000-1 - gas: 1200000 - fees: 200000aphoton + gas: 200000 + fees: 200000alnt + gasPrice: diff --git a/packages/deployer/config.yml b/packages/deployer/config.yml index 4eeaf9a5..2d26ebe9 100644 --- a/packages/deployer/config.yml +++ b/packages/deployer/config.yml @@ -1,9 +1,10 @@ services: - cns: + registry: restEndpoint: http://console.laconic.com:1317 gqlEndpoint: http://console.laconic.com:9473/api userKey: 489c9dd3931c2a2d4dd77973302dc5eb01e2a49552f9d932c58d9da823512311 bondId: 99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be32 chainId: laconic_9000-1 - gas: 1200000 - fees: 200000aphoton + gas: 200000 + fees: 200000alnt + gasPrice: diff --git a/packages/deployer/deploy-frontend.sh b/packages/deployer/deploy-frontend.sh index 77f319f6..47562b39 100755 --- a/packages/deployer/deploy-frontend.sh +++ b/packages/deployer/deploy-frontend.sh @@ -18,7 +18,7 @@ REGISTRY_BOND_ID="99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be # Reference: https://git.vdb.to/cerc-io/test-progressive-web-app/src/branch/main/scripts # Get latest version from registry and increment application-record version -NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "snowballtools-base-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') +NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "snowballtools-base-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') if [ -z "$NEW_APPLICATION_VERSION" ] || [ "1" == "$NEW_APPLICATION_VERSION" ]; then # Set application-record version if no previous records were found @@ -31,7 +31,7 @@ record: type: ApplicationDeploymentRequest version: '1.0.0' name: snowballtools-base-frontend@$PACKAGE_VERSION - application: crn://snowballtools/applications/snowballtools-base-frontend@$PACKAGE_VERSION + application: lrn://snowballtools/applications/snowballtools-base-frontend@$PACKAGE_VERSION dns: dashboard config: env: @@ -64,7 +64,7 @@ echo "Files generated successfully." RECORD_FILE=records/application-record.yml # Publish ApplicationRecord -publish_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE) +publish_response=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $RECORD_FILE) rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to publish record" @@ -75,17 +75,17 @@ echo "ApplicationRecord published" echo $RECORD_ID # Set name to record -REGISTRY_APP_CRN="crn://snowballtools/applications/snowballtools-base-frontend" +REGISTRY_APP_LRN="lrn://snowballtools/applications/snowballtools-base-frontend" sleep 2 -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN@${PACKAGE_VERSION}" "$RECORD_ID" rc=$? if [ $rc -ne 0 ]; then - echo "FATAL: Failed to set name: $REGISTRY_APP_CRN@${PACKAGE_VERSION}" + echo "FATAL: Failed to set name: $REGISTRY_APP_LRN@${PACKAGE_VERSION}" exit $rc fi sleep 2 -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN@${LATEST_HASH}" "$RECORD_ID" rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to set hash" @@ -93,16 +93,16 @@ if [ $rc -ne 0 ]; then fi sleep 2 # Set name if latest release -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN" "$RECORD_ID" rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to set release" exit $rc fi -echo "$REGISTRY_APP_CRN set for ApplicationRecord" +echo "$REGISTRY_APP_LRN set for ApplicationRecord" -# Check if record found for REGISTRY_APP_CRN -query_response=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN") +# Check if record found for REGISTRY_APP_LRN +query_response=$(yarn --silent laconic -c $CONFIG_FILE registry name resolve "$REGISTRY_APP_LRN") rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to query name" @@ -110,14 +110,14 @@ if [ $rc -ne 0 ]; then fi APP_RECORD=$(echo $query_response | jq '.[0]') if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then - echo "No record found for $REGISTRY_APP_CRN." + echo "No record found for $REGISTRY_APP_LRN." exit 1 fi RECORD_FILE=records/application-deployment-request.yml sleep 2 -deployment_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE) +deployment_response=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $RECORD_FILE) if [ $rc -ne 0 ]; then echo "FATAL: Failed to query deployment request" exit $rc diff --git a/packages/deployer/deploy-frontend.staging.sh b/packages/deployer/deploy-frontend.staging.sh index 92df5dbe..0aba8e70 100755 --- a/packages/deployer/deploy-frontend.staging.sh +++ b/packages/deployer/deploy-frontend.staging.sh @@ -18,7 +18,7 @@ REGISTRY_BOND_ID="098c906850b87412f02200e41f449bc79e055eab77acfef32c0b22443bb466 # Reference: https://git.vdb.to/cerc-io/test-progressive-web-app/src/branch/main/scripts # Get latest version from registry and increment application-record version -NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "staging-snowballtools-base-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') +NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "staging-snowballtools-base-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') if [ -z "$NEW_APPLICATION_VERSION" ] || [ "1" == "$NEW_APPLICATION_VERSION" ]; then # Set application-record version if no previous records were found @@ -31,7 +31,7 @@ record: type: ApplicationDeploymentRequest version: '1.0.0' name: staging-snowballtools-base-frontend@$PACKAGE_VERSION - application: crn://staging-snowballtools/applications/staging-snowballtools-base-frontend@$PACKAGE_VERSION + application: lrn://staging-snowballtools/applications/staging-snowballtools-base-frontend@$PACKAGE_VERSION dns: dashboard.staging.apps.snowballtools.com config: env: @@ -70,7 +70,7 @@ echo "Files generated successfully." RECORD_FILE=staging-records/application-record.yml # Publish ApplicationRecord -publish_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE) +publish_response=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $RECORD_FILE) rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to publish record" @@ -81,17 +81,17 @@ echo "ApplicationRecord published" echo $RECORD_ID # Set name to record -REGISTRY_APP_CRN="crn://staging-snowballtools/applications/staging-snowballtools-base-frontend" +REGISTRY_APP_LRN="lrn://staging-snowballtools/applications/staging-snowballtools-base-frontend" sleep 2 -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN@${PACKAGE_VERSION}" "$RECORD_ID" rc=$? if [ $rc -ne 0 ]; then - echo "FATAL: Failed to set name: $REGISTRY_APP_CRN@${PACKAGE_VERSION}" + echo "FATAL: Failed to set name: $REGISTRY_APP_LRN@${PACKAGE_VERSION}" exit $rc fi sleep 2 -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN@${LATEST_HASH}" "$RECORD_ID" rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to set hash" @@ -99,16 +99,16 @@ if [ $rc -ne 0 ]; then fi sleep 2 # Set name if latest release -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN" "$RECORD_ID" rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to set release" exit $rc fi -echo "$REGISTRY_APP_CRN set for ApplicationRecord" +echo "$REGISTRY_APP_LRN set for ApplicationRecord" -# Check if record found for REGISTRY_APP_CRN -query_response=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN") +# Check if record found for REGISTRY_APP_LRN +query_response=$(yarn --silent laconic -c $CONFIG_FILE registry name resolve "$REGISTRY_APP_LRN") rc=$? if [ $rc -ne 0 ]; then echo "FATAL: Failed to query name" @@ -116,14 +116,14 @@ if [ $rc -ne 0 ]; then fi APP_RECORD=$(echo $query_response | jq '.[0]') if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then - echo "No record found for $REGISTRY_APP_CRN." + echo "No record found for $REGISTRY_APP_LRN." exit 1 fi RECORD_FILE=staging-records/application-deployment-request.yml sleep 2 -deployment_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE) +deployment_response=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $RECORD_FILE) if [ $rc -ne 0 ]; then echo "FATAL: Failed to query deployment request" exit $rc diff --git a/packages/deployer/test/test-webapp-deployment-undeployment.sh b/packages/deployer/test/test-webapp-deployment-undeployment.sh index 000160b0..0c23b715 100755 --- a/packages/deployer/test/test-webapp-deployment-undeployment.sh +++ b/packages/deployer/test/test-webapp-deployment-undeployment.sh @@ -22,7 +22,7 @@ REGISTRY_BOND_ID="99c0e9aec0ac1b8187faa579be3b54f93fafb6060ac1fd29170b860df605be APP_NAME=deployment-test-app # Get latest version from registry and increment application-record version -NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "$APP_NAME" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') +NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "$APP_NAME" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') if [ -z "$NEW_APPLICATION_VERSION" ] || [ "1" == "$NEW_APPLICATION_VERSION" ]; then # Set application-record version if no previous records were found @@ -51,7 +51,7 @@ record: type: ApplicationDeploymentRequest version: '1.0.0' name: $APP_NAME@$PACKAGE_VERSION - application: crn://snowballtools/applications/$APP_NAME@$PACKAGE_VERSION + application: lrn://snowballtools/applications/$APP_NAME@$PACKAGE_VERSION dns: deployment-ci-test config: env: @@ -67,31 +67,31 @@ EOF echo "Record files generated successfully." # Publish ApplicationRecord -RECORD_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE | jq -r '.id') +RECORD_ID=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $RECORD_FILE | jq -r '.id') echo "ApplicationRecord published" echo $RECORD_ID # Set name to record -REGISTRY_APP_CRN="crn://snowballtools/applications/$APP_NAME" +REGISTRY_APP_LRN="lrn://snowballtools/applications/$APP_NAME" sleep 2 -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN@${PACKAGE_VERSION}" "$RECORD_ID" sleep 2 -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN@${LATEST_HASH}" "$RECORD_ID" sleep 2 # Set name if latest release -yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID" -echo "$REGISTRY_APP_CRN set for ApplicationRecord" +yarn --silent laconic -c $CONFIG_FILE registry name set "$REGISTRY_APP_LRN" "$RECORD_ID" +echo "$REGISTRY_APP_LRN set for ApplicationRecord" -# Check if record exists for REGISTRY_APP_CRN -APP_RECORD=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN" | jq '.[0]') +# Check if record exists for REGISTRY_APP_LRN +APP_RECORD=$(yarn --silent laconic -c $CONFIG_FILE registry name resolve "$REGISTRY_APP_LRN" | jq '.[0]') if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then - echo "No record found for $REGISTRY_APP_CRN." + echo "No record found for $REGISTRY_APP_LRN." exit 1 fi sleep 2 -DEPLOYMENT_REQUEST_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $REQUEST_RECORD_FILE | jq -r '.id') +DEPLOYMENT_REQUEST_ID=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $REQUEST_RECORD_FILE | jq -r '.id') echo "ApplicationDeploymentRequest published" echo $DEPLOYMENT_REQUEST_ID @@ -102,7 +102,7 @@ MAX_RETRIES=20 # Check that a ApplicationDeploymentRecord is published retry_count=0 while true; do - deployment_records_response=$(yarn --silent laconic -c $CONFIG_FILE cns record list --type ApplicationDeploymentRecord --all --name "$APP_NAME" request $DEPLOYMENT_REQUEST_ID) + deployment_records_response=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationDeploymentRecord --all --name "$APP_NAME" request $DEPLOYMENT_REQUEST_ID) len_deployment_records=$(echo $deployment_records_response | jq 'length') # Check if number of records returned is 0 @@ -170,14 +170,14 @@ record: EOF sleep 2 -REMOVAL_REQUEST_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $REMOVAL_REQUEST_RECORD_FILE | jq -r '.id') +REMOVAL_REQUEST_ID=$(yarn --silent laconic -c $CONFIG_FILE registry record publish --filename $REMOVAL_REQUEST_RECORD_FILE | jq -r '.id') echo "ApplicationDeploymentRemovalRequest published" echo $REMOVAL_REQUEST_ID # Check that an ApplicationDeploymentRemovalRecord is published retry_count=0 while true; do - removal_records_response=$(yarn --silent laconic -c $CONFIG_FILE cns record list --type ApplicationDeploymentRemovalRecord --all request $REMOVAL_REQUEST_ID) + removal_records_response=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationDeploymentRemovalRecord --all request $REMOVAL_REQUEST_ID) len_removal_records=$(echo $removal_records_response | jq 'length') # Check if number of records returned is 0 diff --git a/yarn.lock b/yarn.lock index e9c7dd17..a524c992 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1431,6 +1431,41 @@ resolved "https://registry.yarnpkg.com/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz#22abdcd83e008c369902976730c34c150148a758" integrity sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA== +"@cerc-io/registry-sdk@^0.2.5": + version "0.2.10" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.10/registry-sdk-0.2.10.tgz#15773ea36a862585cdcb0991cbf075736f845f96" + integrity sha512-xxVD7ylrN951TFoSFbluz7mt4SwSCv7z+yry3jGd8v8TWnycoBMMrrYSTfETs6Ydxwziiz/uLrRwk59vFZxLEA== + dependencies: + "@cosmjs/amino" "^0.28.1" + "@cosmjs/crypto" "^0.28.1" + "@cosmjs/encoding" "^0.28.1" + "@cosmjs/launchpad" "^0.27.1" + "@cosmjs/proto-signing" "^0.32.2" + "@cosmjs/stargate" "^0.32.2" + "@cosmjs/tendermint-rpc" "^0.32.2" + "@ipld/dag-cbor" "^7.0.1" + "@ipld/dag-json" "^8.0.9" + "@metamask/eth-sig-util" "^4.0.0" + "@tharsis/address-converter" "^0.1.7" + "@tharsis/eip712" "^0.2.1" + "@tharsis/proto" "^0.1.16" + "@tharsis/provider" "^0.2.4" + "@tharsis/transactions" "^0.2.2" + axios "^0.26.1" + bip32 "3.0.1" + bip39 "^3.0.4" + canonical-json "^0.0.4" + ethers "^5.6.2" + graphql.js "^0.6.8" + js-sha256 "^0.9.0" + js-yaml "^3.14.1" + lodash "^4.17.21" + multiformats "^9.5.4" + node-yaml "^4.0.1" + secp256k1 "^4.0.1" + semver "^7.3.5" + tiny-secp256k1 "^1.1.6" + "@chromatic-com/storybook@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@chromatic-com/storybook/-/storybook-1.3.3.tgz#102d173d7e67cbc7f974648eaa459aa3d3d53f91" @@ -1455,6 +1490,16 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" +"@cosmjs/amino@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.27.1.tgz#0910256b5aecd794420bb5f7319d98fc63252fa1" + integrity sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA== + dependencies: + "@cosmjs/crypto" "0.27.1" + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@cosmjs/utils" "0.27.1" + "@cosmjs/amino@0.28.13", "@cosmjs/amino@^0.28.1": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.28.13.tgz#b51417a23c1ff8ef8b85a6862eba8492c6c44f38" @@ -1475,6 +1520,32 @@ "@cosmjs/math" "^0.30.1" "@cosmjs/utils" "^0.30.1" +"@cosmjs/amino@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.4.tgz#3908946c0394e6d431694c8992c5147079a1c860" + integrity sha512-zKYOt6hPy8obIFtLie/xtygCkH9ZROiQ12UHfKsOkWaZfPQUvVbtgmu6R4Kn1tFLI/SRkw7eqhaogmW/3NYu/Q== + dependencies: + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + +"@cosmjs/crypto@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.27.1.tgz#271c853089a3baf3acd6cf0b2122fd49f8815743" + integrity sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg== + dependencies: + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@cosmjs/utils" "0.27.1" + bip39 "^3.0.2" + bn.js "^5.2.0" + elliptic "^6.5.3" + js-sha3 "^0.8.0" + libsodium-wrappers "^0.7.6" + ripemd160 "^2.0.2" + sha.js "^2.4.11" + "@cosmjs/crypto@0.28.13", "@cosmjs/crypto@^0.28.1": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.28.13.tgz#541b6a36f616b2da5a568ead46d4e83841ceb412" @@ -1501,6 +1572,28 @@ elliptic "^6.5.4" libsodium-wrappers "^0.7.6" +"@cosmjs/crypto@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.4.tgz#5d29633b661eaf092ddb3e7ea6299cfd6f4507a2" + integrity sha512-zicjGU051LF1V9v7bp8p7ovq+VyC91xlaHdsFOTo2oVry3KQikp8L/81RkXmUIT8FxMwdx1T7DmFwVQikcSDIw== + dependencies: + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers-sumo "^0.7.11" + +"@cosmjs/encoding@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1" + integrity sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/encoding@0.28.13", "@cosmjs/encoding@^0.28.1": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.28.13.tgz#7994e8e2c435beaf0690296ffb0f7f3eaec8150b" @@ -1519,6 +1612,15 @@ bech32 "^1.1.4" readonly-date "^1.0.0" +"@cosmjs/encoding@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.4.tgz#646e0e809f7f4f1414d8fa991fb0ffe6c633aede" + integrity sha512-tjvaEy6ZGxJchiizzTn7HVRiyTg1i4CObRRaTRPknm5EalE13SV+TCHq38gIDfyUeden4fCuaBVEdBR5+ti7Hw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/json-rpc@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz#16f21305fc167598c8a23a45549b85106b2372bc" @@ -1527,6 +1629,34 @@ "@cosmjs/stream" "^0.30.1" xstream "^11.14.0" +"@cosmjs/json-rpc@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.4.tgz#be91eb89ea78bd5dc02d0a9fa184dd6790790f0b" + integrity sha512-/jt4mBl7nYzfJ2J/VJ+r19c92mUKF0Lt0JxM3MXEJl7wlwW5haHAWtzRujHkyYMXOwIR+gBqT2S0vntXVBRyhQ== + dependencies: + "@cosmjs/stream" "^0.32.4" + xstream "^11.14.0" + +"@cosmjs/launchpad@^0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/launchpad/-/launchpad-0.27.1.tgz#b6f1995748be96560f5f01e84d3ff907477dda77" + integrity sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw== + dependencies: + "@cosmjs/amino" "0.27.1" + "@cosmjs/crypto" "0.27.1" + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@cosmjs/utils" "0.27.1" + axios "^0.21.2" + fast-deep-equal "^3.1.3" + +"@cosmjs/math@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.27.1.tgz#be78857b008ffc6b1ed6fecaa1c4cd5bc38c07d7" + integrity sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ== + dependencies: + bn.js "^5.2.0" + "@cosmjs/math@0.28.13": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.28.13.tgz#50c05bc67007a04216f7f5e0c93f57270f8cc077" @@ -1541,6 +1671,13 @@ dependencies: bn.js "^5.2.0" +"@cosmjs/math@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.4.tgz#87ac9eadc06696e30a30bdb562a495974bfd0a1a" + integrity sha512-++dqq2TJkoB8zsPVYCvrt88oJWsy1vMOuSOKcdlnXuOA/ASheTJuYy4+oZlTQ3Fr8eALDLGGPhJI02W2HyAQaw== + dependencies: + bn.js "^5.2.0" + "@cosmjs/proto-signing@^0.28.13": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.28.13.tgz#95ac12f0da0f0814f348f5ae996c3e96d015df61" @@ -1567,6 +1704,18 @@ cosmjs-types "^0.7.1" long "^4.0.0" +"@cosmjs/proto-signing@^0.32.2", "@cosmjs/proto-signing@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.4.tgz#5a06e087c6d677439c8c9b25b5223d5e72c4cd93" + integrity sha512-QdyQDbezvdRI4xxSlyM1rSVBO2st5sqtbEIl3IX03uJ7YiZIQHyv6vaHVf1V4mapusCqguiHJzm4N4gsFdLBbQ== + dependencies: + "@cosmjs/amino" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" + "@cosmjs/socket@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.30.1.tgz#00b22f4b5e2ab01f4d82ccdb7b2e59536bfe5ce0" @@ -1577,6 +1726,16 @@ ws "^7" xstream "^11.14.0" +"@cosmjs/socket@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.4.tgz#86ab6adf3a442314774c0810b7a7cfcddf4f2082" + integrity sha512-davcyYziBhkzfXQTu1l5NrpDYv0K9GekZCC9apBRvL1dvMc9F/ygM7iemHjUA+z8tJkxKxrt/YPjJ6XNHzLrkw== + dependencies: + "@cosmjs/stream" "^0.32.4" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + "@cosmjs/stargate@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.30.1.tgz#e1b22e1226cffc6e93914a410755f1f61057ba04" @@ -1595,6 +1754,22 @@ protobufjs "~6.11.3" xstream "^11.14.0" +"@cosmjs/stargate@^0.32.2", "@cosmjs/stargate@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.4.tgz#bd0e4d3bf613b629addbf5f875d3d3b50f640af1" + integrity sha512-usj08LxBSsPRq9sbpCeVdyLx2guEcOHfJS9mHGCLCXpdAPEIEQEtWLDpEUc0LEhWOx6+k/ChXTc5NpFkdrtGUQ== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/proto-signing" "^0.32.4" + "@cosmjs/stream" "^0.32.4" + "@cosmjs/tendermint-rpc" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" + xstream "^11.14.0" + "@cosmjs/stream@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.30.1.tgz#ba038a2aaf41343696b1e6e759d8e03a9516ec1a" @@ -1602,6 +1777,13 @@ dependencies: xstream "^11.14.0" +"@cosmjs/stream@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.4.tgz#83e1f2285807467c56d9ea0e1113f79d9fa63802" + integrity sha512-Gih++NYHEiP+oyD4jNEUxU9antoC0pFSg+33Hpp0JlHwH0wXhtD3OOKnzSfDB7OIoEbrzLJUpEjOgpCp5Z+W3A== + dependencies: + xstream "^11.14.0" + "@cosmjs/tendermint-rpc@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz#c16378892ba1ac63f72803fdf7567eab9d4f0aa0" @@ -1618,6 +1800,27 @@ readonly-date "^1.0.0" xstream "^11.14.0" +"@cosmjs/tendermint-rpc@^0.32.2", "@cosmjs/tendermint-rpc@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.4.tgz#b36f9ec657498e42c97e21bb7368798ef6279752" + integrity sha512-MWvUUno+4bCb/LmlMIErLypXxy7ckUuzEmpufYYYd9wgbdCXaTaO08SZzyFM5PI8UJ/0S2AmUrgWhldlbxO8mw== + dependencies: + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/json-rpc" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/socket" "^0.32.4" + "@cosmjs/stream" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + axios "^1.6.0" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/utils@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.27.1.tgz#1c8efde17256346ef142a3bd15158ee4055470e2" + integrity sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg== + "@cosmjs/utils@0.28.13": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.13.tgz#2fd2844ec832d7833811e2ae1691305d09791a08" @@ -1628,6 +1831,11 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.30.1.tgz#6d92582341be3c2ec8d82090253cfa4b7f959edb" integrity sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g== +"@cosmjs/utils@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671" + integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w== + "@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" @@ -8401,7 +8609,7 @@ bip32@3.0.1: typeforce "^1.11.5" wif "^2.0.6" -bip39@^3.0.4: +bip39@^3.0.2, bip39@^3.0.4: version "3.1.0" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3" integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A== @@ -9393,6 +9601,11 @@ cosmjs-types@^0.7.1: long "^4.0.0" protobufjs "~6.11.2" +cosmjs-types@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc" + integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ== + create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -12537,7 +12750,7 @@ js-sha256@^0.9.0: resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== -js-sha3@0.8.0: +js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== @@ -12874,6 +13087,18 @@ libnpmpublish@7.3.0: sigstore "^1.4.0" ssri "^10.0.1" +libsodium-sumo@^0.7.15: + version "0.7.15" + resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.15.tgz#91c1d863fe3fbce6d6b9db1aadaa622733a1d007" + integrity sha512-5tPmqPmq8T8Nikpm1Nqj0hBHvsLFCXvdhBFV7SGOitQPZAA6jso8XoL0r4L7vmfKXr486fiQInvErHtEvizFMw== + +libsodium-wrappers-sumo@^0.7.11: + version "0.7.15" + resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.15.tgz#0ef2a99b4b17e8385aa7e6850593660dbaf5fb40" + integrity sha512-aSWY8wKDZh5TC7rMvEdTHoyppVq/1dTSAeAR7H6pzd6QRT3vQWcT5pGwCotLcpPEOLXX6VvqihSPkpEhYAjANA== + dependencies: + libsodium-sumo "^0.7.15" + libsodium-wrappers@^0.7.6: version "0.7.13" resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.13.tgz#83299e06ee1466057ba0e64e532777d2929b90d3" @@ -15830,7 +16055,7 @@ ripemd160-min@0.0.6: resolved "https://registry.yarnpkg.com/ripemd160-min/-/ripemd160-min-0.0.6.tgz#a904b77658114474d02503e819dcc55853b67e62" integrity sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A== -ripemd160@^2.0.0, ripemd160@^2.0.1: +ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== @@ -16428,7 +16653,16 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16465,7 +16699,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17705,7 +17946,7 @@ workspace@^0.0.1-preview.1: resolved "https://registry.yarnpkg.com/workspace/-/workspace-0.0.1-preview.1.tgz#0ba0a6b92b3dbc7f1502dd12bc27a37b1eec9083" integrity sha512-oPpEvU7NIQ0MW7ReL+EigMUI2JPNp05kmqzWS6zXVUaSq5KxuQzfgxGd8wuurBulBkTaOnEcGge+2rriyDVHkw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17723,6 +17964,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"