-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a command to list authorities (#74)
Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8) Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Reviewed-on: https://git.vdb.to/cerc-io/laconic-registry-cli/pulls/74 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
- Loading branch information
1 parent
70e63c7
commit 30654bb
Showing
5 changed files
with
88 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Arguments } from 'yargs'; | ||
import assert from 'assert'; | ||
|
||
import { Registry } from '@cerc-io/registry-sdk'; | ||
|
||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util'; | ||
|
||
export const command = 'list'; | ||
|
||
export const desc = 'List authorities (optionally by owner).'; | ||
|
||
export const builder = { | ||
owner: { | ||
type: 'string' | ||
} | ||
}; | ||
|
||
export const handler = async (argv: Arguments) => { | ||
const { services: { registry: registryConfig } } = getConfig(argv.config as string); | ||
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, rpcEndpoint, chainId); | ||
const result = await registry.getAuthorities(argv.owner as string); | ||
|
||
queryOutput(result, argv.output); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters