diff --git a/config.example.yml b/config.example.yml index 45b0c25..51ebe9e 100644 --- a/config.example.yml +++ b/config.example.yml @@ -1,6 +1,6 @@ services: registry: - restEndpoint: 'http://localhost:26657' + rpcEndpoint: 'http://localhost:26657' gqlEndpoint: 'http://localhost:9473/api' userKey: bondId: diff --git a/src/cmds/registry-cmds/account-cmds/get.ts b/src/cmds/registry-cmds/account-cmds/get.ts index 05e7c0f..d86ab82 100644 --- a/src/cmds/registry-cmds/account-cmds/get.ts +++ b/src/cmds/registry-cmds/account-cmds/get.ts @@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => { let address = argv.address as string; const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); @@ -21,7 +21,7 @@ export const handler = async (argv: Arguments) => { address = new Account(Buffer.from(privateKey, 'hex')).address; } - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.getAccounts([address]); queryOutput(result, argv.output); diff --git a/src/cmds/registry-cmds/auction-cmds/bid-cmds/commit.ts b/src/cmds/registry-cmds/auction-cmds/bid-cmds/commit.ts index 460086e..04a392b 100644 --- a/src/cmds/registry-cmds/auction-cmds/bid-cmds/commit.ts +++ b/src/cmds/registry-cmds/auction-cmds/bid-cmds/commit.ts @@ -22,8 +22,8 @@ export const handler = async (argv: Arguments) => { assert(denom, 'Invalid token type.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); @@ -40,7 +40,7 @@ export const handler = async (argv: Arguments) => { await ensureDir(outDirPath); fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2)); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee); diff --git a/src/cmds/registry-cmds/auction-cmds/bid-cmds/reveal.ts b/src/cmds/registry-cmds/auction-cmds/bid-cmds/reveal.ts index 8c27687..30020c0 100644 --- a/src/cmds/registry-cmds/auction-cmds/bid-cmds/reveal.ts +++ b/src/cmds/registry-cmds/auction-cmds/bid-cmds/reveal.ts @@ -17,13 +17,13 @@ export const handler = async (argv: Arguments) => { assert(filePath, 'Invalid reveal file path.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const reveal = fs.readFileSync(path.resolve(filePath)); diff --git a/src/cmds/registry-cmds/auction-cmds/get.ts b/src/cmds/registry-cmds/auction-cmds/get.ts index 01daac5..3bd2a12 100644 --- a/src/cmds/registry-cmds/auction-cmds/get.ts +++ b/src/cmds/registry-cmds/auction-cmds/get.ts @@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => { assert(id, 'Invalid auction ID.'); const { services: { registry: registryConfig } } = getConfig(config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.getAuctionsByIds([id as string]); queryOutput(result, argv.output); diff --git a/src/cmds/registry-cmds/authority-cmds/bond-cmds/set.ts b/src/cmds/registry-cmds/authority-cmds/bond-cmds/set.ts index 77a8f4c..e1aa8b2 100644 --- a/src/cmds/registry-cmds/authority-cmds/bond-cmds/set.ts +++ b/src/cmds/registry-cmds/authority-cmds/bond-cmds/set.ts @@ -15,13 +15,13 @@ export const handler = async (argv: Arguments) => { assert(bondId, 'Invalid Bond ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/authority-cmds/reserve.ts b/src/cmds/registry-cmds/authority-cmds/reserve.ts index e437f8e..52bf7bb 100644 --- a/src/cmds/registry-cmds/authority-cmds/reserve.ts +++ b/src/cmds/registry-cmds/authority-cmds/reserve.ts @@ -21,13 +21,13 @@ export const handler = async (argv: Arguments) => { assert(name, 'Invalid authority name.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.reserveAuthority({ name, owner }, privateKey, fee); diff --git a/src/cmds/registry-cmds/authority-cmds/whois.ts b/src/cmds/registry-cmds/authority-cmds/whois.ts index fa34a89..19f7a77 100644 --- a/src/cmds/registry-cmds/authority-cmds/whois.ts +++ b/src/cmds/registry-cmds/authority-cmds/whois.ts @@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => { assert(name, 'Invalid authority name.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.lookupAuthorities([name], true); queryOutput(result, argv.output); diff --git a/src/cmds/registry-cmds/bond-cmds/associate.ts b/src/cmds/registry-cmds/bond-cmds/associate.ts index 01f394b..bfc9e45 100644 --- a/src/cmds/registry-cmds/bond-cmds/associate.ts +++ b/src/cmds/registry-cmds/bond-cmds/associate.ts @@ -21,13 +21,13 @@ export const handler = async (argv: Arguments) => { assert(bondId, 'Invalid Bond ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/bond-cmds/cancel.ts b/src/cmds/registry-cmds/bond-cmds/cancel.ts index ea904fc..c2cc21d 100644 --- a/src/cmds/registry-cmds/bond-cmds/cancel.ts +++ b/src/cmds/registry-cmds/bond-cmds/cancel.ts @@ -13,13 +13,13 @@ export const handler = async (argv: Arguments) => { assert(id, 'Invalid Bond ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.cancelBond({ id }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/bond-cmds/create.ts b/src/cmds/registry-cmds/bond-cmds/create.ts index 2ad5dc8..bb2bc13 100644 --- a/src/cmds/registry-cmds/bond-cmds/create.ts +++ b/src/cmds/registry-cmds/bond-cmds/create.ts @@ -26,13 +26,13 @@ export const handler = async (argv: Arguments) => { assert(amount, 'Invalid Quantity.'); const { services: { registry: registryConfig } } = getConfig(config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const bondId = await registry.getNextBondId(privateKey); const result = await registry.createBond({ denom, amount }, privateKey, fee); diff --git a/src/cmds/registry-cmds/bond-cmds/dissociate.ts b/src/cmds/registry-cmds/bond-cmds/dissociate.ts index f1dce52..df69f8e 100644 --- a/src/cmds/registry-cmds/bond-cmds/dissociate.ts +++ b/src/cmds/registry-cmds/bond-cmds/dissociate.ts @@ -13,13 +13,13 @@ export const handler = async (argv: Arguments) => { assert(id, 'Invalid Record ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.dissociateBond({ recordId: id }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/bond-cmds/get.ts b/src/cmds/registry-cmds/bond-cmds/get.ts index a987188..5c41c14 100644 --- a/src/cmds/registry-cmds/bond-cmds/get.ts +++ b/src/cmds/registry-cmds/bond-cmds/get.ts @@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => { console.assert(id, 'Bond Id is required.'); const { services: { registry: registryConfig } } = getConfig(config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.getBondsByIds([id as string]); diff --git a/src/cmds/registry-cmds/bond-cmds/list.ts b/src/cmds/registry-cmds/bond-cmds/list.ts index eb457f2..edc36de 100644 --- a/src/cmds/registry-cmds/bond-cmds/list.ts +++ b/src/cmds/registry-cmds/bond-cmds/list.ts @@ -16,12 +16,12 @@ export const builder = { export const handler = async (argv: Arguments) => { const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const { owner } = argv; const result = await registry.queryBonds({ owner }); diff --git a/src/cmds/registry-cmds/bond-cmds/records-cmds/dissociate.ts b/src/cmds/registry-cmds/bond-cmds/records-cmds/dissociate.ts index ea7d90b..72a733f 100644 --- a/src/cmds/registry-cmds/bond-cmds/records-cmds/dissociate.ts +++ b/src/cmds/registry-cmds/bond-cmds/records-cmds/dissociate.ts @@ -19,13 +19,13 @@ export const handler = async (argv: Arguments) => { assert(bondId, 'Invalid Bond ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.dissociateRecords({ bondId }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/bond-cmds/records-cmds/reassociate.ts b/src/cmds/registry-cmds/bond-cmds/records-cmds/reassociate.ts index 2c3c555..bcf65f3 100644 --- a/src/cmds/registry-cmds/bond-cmds/records-cmds/reassociate.ts +++ b/src/cmds/registry-cmds/bond-cmds/records-cmds/reassociate.ts @@ -24,13 +24,13 @@ export const handler = async (argv: Arguments) => { assert(newBondId, 'Invalid New Bond ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/bond-cmds/refill.ts b/src/cmds/registry-cmds/bond-cmds/refill.ts index 47ed860..9219e51 100644 --- a/src/cmds/registry-cmds/bond-cmds/refill.ts +++ b/src/cmds/registry-cmds/bond-cmds/refill.ts @@ -27,13 +27,13 @@ export const handler = async (argv: Arguments) => { assert(amount, 'Invalid Quantity.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.refillBond({ id, denom, amount }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/bond-cmds/withdraw.ts b/src/cmds/registry-cmds/bond-cmds/withdraw.ts index 8fb615f..862fb50 100644 --- a/src/cmds/registry-cmds/bond-cmds/withdraw.ts +++ b/src/cmds/registry-cmds/bond-cmds/withdraw.ts @@ -27,13 +27,13 @@ export const handler = async (argv: Arguments) => { assert(amount, 'Invalid Quantity.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee); const success = '{"success": true}'; diff --git a/src/cmds/registry-cmds/name-cmds/delete.ts b/src/cmds/registry-cmds/name-cmds/delete.ts index d56677e..1730e8f 100644 --- a/src/cmds/registry-cmds/name-cmds/delete.ts +++ b/src/cmds/registry-cmds/name-cmds/delete.ts @@ -13,13 +13,13 @@ export const handler = async (argv: Arguments) => { assert(name, 'Invalid Name.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.deleteName({ lrn: name }, privateKey, fee); diff --git a/src/cmds/registry-cmds/name-cmds/lookup.ts b/src/cmds/registry-cmds/name-cmds/lookup.ts index 888c0b2..a16c163 100644 --- a/src/cmds/registry-cmds/name-cmds/lookup.ts +++ b/src/cmds/registry-cmds/name-cmds/lookup.ts @@ -19,12 +19,12 @@ export const handler = async (argv: Arguments) => { assert(name, 'Invalid Name.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.lookupNames([name], argv.history as boolean); queryOutput(result, argv.output); diff --git a/src/cmds/registry-cmds/name-cmds/resolve.ts b/src/cmds/registry-cmds/name-cmds/resolve.ts index 3a5242a..2f31a88 100644 --- a/src/cmds/registry-cmds/name-cmds/resolve.ts +++ b/src/cmds/registry-cmds/name-cmds/resolve.ts @@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => { assert(name, 'Invalid Name.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); let result = await registry.resolveNames([name]); result = result.filter((v: any) => v); diff --git a/src/cmds/registry-cmds/name-cmds/set.ts b/src/cmds/registry-cmds/name-cmds/set.ts index 87d9e9d..8f16db4 100644 --- a/src/cmds/registry-cmds/name-cmds/set.ts +++ b/src/cmds/registry-cmds/name-cmds/set.ts @@ -15,13 +15,13 @@ export const handler = async (argv: Arguments) => { assert(id, 'Invalid Record ID.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.setName({ lrn: name, cid: id }, privateKey, fee); diff --git a/src/cmds/registry-cmds/record-cmds/get.ts b/src/cmds/registry-cmds/record-cmds/get.ts index a842166..76d3859 100644 --- a/src/cmds/registry-cmds/record-cmds/get.ts +++ b/src/cmds/registry-cmds/record-cmds/get.ts @@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => { assert(id, 'Invalid Record ID.'); const { services: { registry: registryConfig } } = getConfig(config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.getRecordsByIds([id as string]); queryOutput(result, argv.output); diff --git a/src/cmds/registry-cmds/record-cmds/list.ts b/src/cmds/registry-cmds/record-cmds/list.ts index c3fe8a7..4a0db44 100644 --- a/src/cmds/registry-cmds/record-cmds/list.ts +++ b/src/cmds/registry-cmds/record-cmds/list.ts @@ -29,7 +29,7 @@ export const builder = { export const handler = async (argv: Arguments) => { const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { type, name, bondId, owner, all } = argv; const filters: any = {}; @@ -38,11 +38,11 @@ export const handler = async (argv: Arguments) => { filters[String(filterArgs[i]).replace(/^-+/, '')] = filterArgs[i + 1]; } - assert(restEndpoint, 'Invalid registry REST endpoint.'); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); let result = await registry.queryRecords({ ...filters, type, name }, all as boolean); diff --git a/src/cmds/registry-cmds/record-cmds/publish.ts b/src/cmds/registry-cmds/record-cmds/publish.ts index 6eba8af..4bdeb7b 100644 --- a/src/cmds/registry-cmds/record-cmds/publish.ts +++ b/src/cmds/registry-cmds/record-cmds/publish.ts @@ -19,9 +19,9 @@ export const builder = { export const handler = async (argv: Arguments) => { const { txKey, filename, config } = argv; const { services: { registry: registryConfig } } = getConfig(config as string); - const { restEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig); + const { rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(userKey, 'Invalid User Key.'); assert(bondId, 'Invalid Bond ID.'); @@ -43,7 +43,7 @@ export const handler = async (argv: Arguments) => { } } - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey || userKey, fee); diff --git a/src/cmds/registry-cmds/status.ts b/src/cmds/registry-cmds/status.ts index 8e6aa82..25d03f7 100644 --- a/src/cmds/registry-cmds/status.ts +++ b/src/cmds/registry-cmds/status.ts @@ -10,12 +10,12 @@ export const desc = 'Get registry status.'; export const handler = async (argv: Arguments) => { const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(chainId, 'Invalid registry Chain ID.'); - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const result = await registry.getStatus(); console.log(JSON.stringify(result, undefined, 2)); diff --git a/src/cmds/registry-cmds/tokens-cmds/send.ts b/src/cmds/registry-cmds/tokens-cmds/send.ts index 35d79c1..0aa6dbe 100644 --- a/src/cmds/registry-cmds/tokens-cmds/send.ts +++ b/src/cmds/registry-cmds/tokens-cmds/send.ts @@ -27,8 +27,8 @@ export const handler = async (argv: Arguments) => { assert(amount, 'Invalid Quantity.'); const { services: { registry: registryConfig } } = getConfig(argv.config as string); - const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); - assert(restEndpoint, 'Invalid registry REST endpoint.'); + const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); + assert(rpcEndpoint, 'Invalid registry RPC endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(privateKey, 'Invalid Transaction Key.'); assert(chainId, 'Invalid registry Chain ID.'); @@ -37,7 +37,7 @@ export const handler = async (argv: Arguments) => { await account.init(); const fromAddress = account.address; - const registry = new Registry(gqlEndpoint, restEndpoint, chainId); + const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); const fee = getGasAndFees(argv, registryConfig); await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee); const result = await registry.getAccounts([fromAddress, destinationAddress]); diff --git a/test/run-tests.sh b/test/run-tests.sh index 12d77e3..c09ec97 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -16,7 +16,7 @@ config_file="config.yml" config=$(cat <