Rename laconic2d to laconicd and upgrade SDK #61

Merged
nabarun merged 3 commits from deep-stack/laconic-registry-cli:nv-rename-laconic into laconic2 2024-04-02 13:25:32 +00:00
28 changed files with 80 additions and 80 deletions
Showing only changes of commit cf0df0a923 - Show all commits

View File

@ -1,6 +1,6 @@
services: services:
registry: registry:
restEndpoint: 'http://localhost:26657' rpcEndpoint: 'http://localhost:26657'
gqlEndpoint: 'http://localhost:9473/api' gqlEndpoint: 'http://localhost:9473/api'
userKey: userKey:
bondId: bondId:

View File

@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => {
let address = argv.address as string; let address = argv.address as string;
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); assert(chainId, 'Invalid registry Chain ID.');
@ -21,7 +21,7 @@ export const handler = async (argv: Arguments) => {
address = new Account(Buffer.from(privateKey, 'hex')).address; 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]); const result = await registry.getAccounts([address]);
queryOutput(result, argv.output); queryOutput(result, argv.output);

View File

@ -22,8 +22,8 @@ export const handler = async (argv: Arguments) => {
assert(denom, 'Invalid token type.'); assert(denom, 'Invalid token type.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); assert(chainId, 'Invalid registry Chain ID.');
@ -40,7 +40,7 @@ export const handler = async (argv: Arguments) => {
await ensureDir(outDirPath); await ensureDir(outDirPath);
fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2)); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee); const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);

View File

@ -17,13 +17,13 @@ export const handler = async (argv: Arguments) => {
assert(filePath, 'Invalid reveal file path.'); assert(filePath, 'Invalid reveal file path.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const reveal = fs.readFileSync(path.resolve(filePath)); const reveal = fs.readFileSync(path.resolve(filePath));

View File

@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => {
assert(id, 'Invalid auction ID.'); assert(id, 'Invalid auction ID.');
const { services: { registry: registryConfig } } = getConfig(config as string); const { services: { registry: registryConfig } } = getConfig(config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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]); const result = await registry.getAuctionsByIds([id as string]);
queryOutput(result, argv.output); queryOutput(result, argv.output);

View File

@ -15,13 +15,13 @@ export const handler = async (argv: Arguments) => {
assert(bondId, 'Invalid Bond ID.'); assert(bondId, 'Invalid Bond ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee); const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -21,13 +21,13 @@ export const handler = async (argv: Arguments) => {
assert(name, 'Invalid authority name.'); assert(name, 'Invalid authority name.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee); const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);

View File

@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => {
assert(name, 'Invalid authority name.'); assert(name, 'Invalid authority name.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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); const result = await registry.lookupAuthorities([name], true);
queryOutput(result, argv.output); queryOutput(result, argv.output);

View File

@ -21,13 +21,13 @@ export const handler = async (argv: Arguments) => {
assert(bondId, 'Invalid Bond ID.'); assert(bondId, 'Invalid Bond ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee); const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -13,13 +13,13 @@ export const handler = async (argv: Arguments) => {
assert(id, 'Invalid Bond ID.'); assert(id, 'Invalid Bond ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.cancelBond({ id }, privateKey, fee); const result = await registry.cancelBond({ id }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -26,13 +26,13 @@ export const handler = async (argv: Arguments) => {
assert(amount, 'Invalid Quantity.'); assert(amount, 'Invalid Quantity.');
const { services: { registry: registryConfig } } = getConfig(config as string); const { services: { registry: registryConfig } } = getConfig(config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const bondId = await registry.getNextBondId(privateKey); const bondId = await registry.getNextBondId(privateKey);
const result = await registry.createBond({ denom, amount }, privateKey, fee); const result = await registry.createBond({ denom, amount }, privateKey, fee);

View File

@ -13,13 +13,13 @@ export const handler = async (argv: Arguments) => {
assert(id, 'Invalid Record ID.'); assert(id, 'Invalid Record ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee); const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => {
console.assert(id, 'Bond Id is required.'); console.assert(id, 'Bond Id is required.');
const { services: { registry: registryConfig } } = getConfig(config as string); const { services: { registry: registryConfig } } = getConfig(config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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]); const result = await registry.getBondsByIds([id as string]);

View File

@ -16,12 +16,12 @@ export const builder = {
export const handler = async (argv: Arguments) => { export const handler = async (argv: Arguments) => {
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); assert(chainId, 'Invalid registry Chain ID.');
const registry = new Registry(gqlEndpoint, restEndpoint, chainId); const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
const { owner } = argv; const { owner } = argv;
const result = await registry.queryBonds({ owner }); const result = await registry.queryBonds({ owner });

View File

@ -19,13 +19,13 @@ export const handler = async (argv: Arguments) => {
assert(bondId, 'Invalid Bond ID.'); assert(bondId, 'Invalid Bond ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.dissociateRecords({ bondId }, privateKey, fee); const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -24,13 +24,13 @@ export const handler = async (argv: Arguments) => {
assert(newBondId, 'Invalid New Bond ID.'); assert(newBondId, 'Invalid New Bond ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee); const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -27,13 +27,13 @@ export const handler = async (argv: Arguments) => {
assert(amount, 'Invalid Quantity.'); assert(amount, 'Invalid Quantity.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee); const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -27,13 +27,13 @@ export const handler = async (argv: Arguments) => {
assert(amount, 'Invalid Quantity.'); assert(amount, 'Invalid Quantity.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee); const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
const success = '{"success": true}'; const success = '{"success": true}';

View File

@ -13,13 +13,13 @@ export const handler = async (argv: Arguments) => {
assert(name, 'Invalid Name.'); assert(name, 'Invalid Name.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.deleteName({ lrn: name }, privateKey, fee); const result = await registry.deleteName({ lrn: name }, privateKey, fee);

View File

@ -19,12 +19,12 @@ export const handler = async (argv: Arguments) => {
assert(name, 'Invalid Name.'); assert(name, 'Invalid Name.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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); const result = await registry.lookupNames([name], argv.history as boolean);
queryOutput(result, argv.output); queryOutput(result, argv.output);

View File

@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => {
assert(name, 'Invalid Name.'); assert(name, 'Invalid Name.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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]); let result = await registry.resolveNames([name]);
result = result.filter((v: any) => v); result = result.filter((v: any) => v);

View File

@ -15,13 +15,13 @@ export const handler = async (argv: Arguments) => {
assert(id, 'Invalid Record ID.'); assert(id, 'Invalid Record ID.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.setName({ lrn: name, cid: id }, privateKey, fee); const result = await registry.setName({ lrn: name, cid: id }, privateKey, fee);

View File

@ -13,12 +13,12 @@ export const handler = async (argv: Arguments) => {
assert(id, 'Invalid Record ID.'); assert(id, 'Invalid Record ID.');
const { services: { registry: registryConfig } } = getConfig(config as string); const { services: { registry: registryConfig } } = getConfig(config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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]); const result = await registry.getRecordsByIds([id as string]);
queryOutput(result, argv.output); queryOutput(result, argv.output);

View File

@ -29,7 +29,7 @@ export const builder = {
export const handler = async (argv: Arguments) => { export const handler = async (argv: Arguments) => {
const { services: { registry: registryConfig } } = getConfig(argv.config as string); 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 { type, name, bondId, owner, all } = argv;
const filters: any = {}; const filters: any = {};
@ -38,11 +38,11 @@ export const handler = async (argv: Arguments) => {
filters[String(filterArgs[i]).replace(/^-+/, '')] = filterArgs[i + 1]; 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(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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); let result = await registry.queryRecords({ ...filters, type, name }, all as boolean);

View File

@ -19,9 +19,9 @@ export const builder = {
export const handler = async (argv: Arguments) => { export const handler = async (argv: Arguments) => {
const { txKey, filename, config } = argv; const { txKey, filename, config } = argv;
const { services: { registry: registryConfig } } = getConfig(config as string); 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(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(userKey, 'Invalid User Key.'); assert(userKey, 'Invalid User Key.');
assert(bondId, 'Invalid Bond ID.'); 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 fee = getGasAndFees(argv, registryConfig);
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey || userKey, fee); const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey || userKey, fee);

View File

@ -10,12 +10,12 @@ export const desc = 'Get registry status.';
export const handler = async (argv: Arguments) => { export const handler = async (argv: Arguments) => {
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(chainId, 'Invalid registry Chain ID.'); 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(); const result = await registry.getStatus();
console.log(JSON.stringify(result, undefined, 2)); console.log(JSON.stringify(result, undefined, 2));

View File

@ -27,8 +27,8 @@ export const handler = async (argv: Arguments) => {
assert(amount, 'Invalid Quantity.'); assert(amount, 'Invalid Quantity.');
const { services: { registry: registryConfig } } = getConfig(argv.config as string); const { services: { registry: registryConfig } } = getConfig(argv.config as string);
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig); const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
assert(restEndpoint, 'Invalid registry REST endpoint.'); assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
assert(gqlEndpoint, 'Invalid registry GQL endpoint.'); assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
assert(privateKey, 'Invalid Transaction Key.'); assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid registry Chain ID.'); assert(chainId, 'Invalid registry Chain ID.');
@ -37,7 +37,7 @@ export const handler = async (argv: Arguments) => {
await account.init(); await account.init();
const fromAddress = account.address; const fromAddress = account.address;
const registry = new Registry(gqlEndpoint, restEndpoint, chainId); const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
const fee = getGasAndFees(argv, registryConfig); const fee = getGasAndFees(argv, registryConfig);
await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee); await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee);
const result = await registry.getAccounts([fromAddress, destinationAddress]); const result = await registry.getAccounts([fromAddress, destinationAddress]);

View File

@ -16,7 +16,7 @@ config_file="config.yml"
config=$(cat <<EOL config=$(cat <<EOL
services: services:
registry: registry:
restEndpoint: $laconicd_rpc_endpoint rpcEndpoint: $laconicd_rpc_endpoint
gqlEndpoint: $laconicd_gql_endpoint gqlEndpoint: $laconicd_gql_endpoint
userKey: $laconicd_key userKey: $laconicd_key
bondId: bondId: