Rename laconic2d to laconicd and upgrade SDK #61
@ -35,21 +35,21 @@ jobs:
|
||||
- name: Install registry-cli
|
||||
run: yarn global add file:$PWD
|
||||
|
||||
- name: Checkout laconic2d
|
||||
- name: Checkout laconicd
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./laconic2d/"
|
||||
repository: cerc-io/laconic2d
|
||||
path: "./laconicd/"
|
||||
repository: cerc-io/laconic2d # TODO: Update to laconicd after renaming repo
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
|
||||
- name: Build laconic2d container
|
||||
working-directory: ./laconic2d/tests/sdk_tests
|
||||
run: ./build-laconic2d-container.sh
|
||||
- name: Start laconic2d container
|
||||
- name: Build laconicd container
|
||||
working-directory: ./laconicd/tests/sdk_tests
|
||||
run: ./build-laconicd-container.sh
|
||||
- name: Start laconicd container
|
||||
env:
|
||||
TEST_AUCTION_ENABLED: true
|
||||
run: docker compose up laconic2d -d
|
||||
run: docker compose up laconicd -d
|
||||
|
||||
- name: Run registry-cli tests
|
||||
run: ./test/run-tests.sh
|
||||
|
@ -51,7 +51,7 @@ Run the chain:
|
||||
Registering records in registry requires an account. To get account private key run:
|
||||
|
||||
```bash
|
||||
laconic2d keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
```
|
||||
|
||||
In `config.yml` file assign the account private key to `userKey`.
|
||||
|
@ -1,6 +1,6 @@
|
||||
services:
|
||||
registry:
|
||||
restEndpoint: 'http://localhost:26657'
|
||||
rpcEndpoint: 'http://localhost:26657'
|
||||
gqlEndpoint: 'http://localhost:9473/api'
|
||||
userKey:
|
||||
bondId:
|
||||
|
@ -1,14 +1,14 @@
|
||||
services:
|
||||
laconic2d:
|
||||
laconicd:
|
||||
restart: unless-stopped
|
||||
image: cerc/laconic2d:local
|
||||
image: cerc/laconicd:local
|
||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||
environment:
|
||||
- TEST_AUCTION_ENABLED
|
||||
- TEST_REGISTRY_EXPIRY
|
||||
- LOGLEVEL
|
||||
volumes:
|
||||
- ./laconic2d/scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||
- ./laconicd/scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
||||
interval: 1s
|
||||
@ -22,6 +22,6 @@ services:
|
||||
cli-test-runner:
|
||||
image: cerc/laconic-registry-cli:local
|
||||
depends_on:
|
||||
laconic2d:
|
||||
laconicd:
|
||||
condition: service_healthy
|
||||
command: tail -F /dev/null
|
||||
|
@ -28,7 +28,7 @@
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cerc-io/registry-sdk": "^0.2.0",
|
||||
"@cerc-io/registry-sdk": "^0.2.1",
|
||||
"fs-extra": "^10.1.0",
|
||||
"js-yaml": "^3.14.1",
|
||||
"lodash": "^4.17.21",
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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}';
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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}';
|
||||
|
@ -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}';
|
||||
|
@ -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);
|
||||
|
@ -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}';
|
||||
|
@ -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]);
|
||||
|
||||
|
@ -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 });
|
||||
|
@ -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}';
|
||||
|
@ -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}';
|
||||
|
@ -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}';
|
||||
|
@ -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}';
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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]);
|
||||
|
@ -17,7 +17,7 @@
|
||||
* Get account address of test account:
|
||||
|
||||
```bash
|
||||
laconic2d keys list --keyring-backend test
|
||||
laconicd keys list --keyring-backend test
|
||||
|
||||
# - address: laconic10er85pyd7ukw732e88fzv7k0jq205764hye2dx
|
||||
# name: alice
|
||||
|
@ -1,24 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get the key from laconic2d
|
||||
laconic2d_key=$(yes | docker compose exec laconic2d laconic2d keys export alice --keyring-backend test --unarmored-hex --unsafe)
|
||||
# Get the key from laconicd
|
||||
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe)
|
||||
|
||||
# Get the fixturenet account address
|
||||
laconic2d_account_address=$(docker compose exec laconic2d laconic2d keys list --keyring-backend test | awk '/- address:/ {print $3}')
|
||||
laconicd_account_address=$(docker compose exec laconicd laconicd keys list --keyring-backend test | awk '/- address:/ {print $3}')
|
||||
|
||||
# Set parameters for the test suite
|
||||
cosmos_chain_id=laconic_9000-1
|
||||
laconic2d_rpc_endpoint=http://127.0.0.1:26657
|
||||
laconic2d_gql_endpoint=http://127.0.0.1:9473/api
|
||||
laconicd_rpc_endpoint=http://127.0.0.1:26657
|
||||
laconicd_gql_endpoint=http://127.0.0.1:9473/api
|
||||
|
||||
# Create the required config
|
||||
config_file="config.yml"
|
||||
config=$(cat <<EOL
|
||||
services:
|
||||
registry:
|
||||
restEndpoint: $laconic2d_rpc_endpoint
|
||||
gqlEndpoint: $laconic2d_gql_endpoint
|
||||
userKey: $laconic2d_key
|
||||
rpcEndpoint: $laconicd_rpc_endpoint
|
||||
gqlEndpoint: $laconicd_gql_endpoint
|
||||
userKey: $laconicd_key
|
||||
bondId:
|
||||
chainId: $cosmos_chain_id
|
||||
gas: 200000
|
||||
@ -28,7 +28,7 @@ EOL
|
||||
echo "$config" > "$config_file"
|
||||
|
||||
# Wait for the laconid endpoint to come up
|
||||
docker compose exec laconic2d sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
||||
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
||||
|
||||
# Run tests
|
||||
TEST_ACCOUNT=$laconic2d_account_address yarn test
|
||||
TEST_ACCOUNT=$laconicd_account_address yarn test
|
||||
|
@ -302,10 +302,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@cerc-io/registry-sdk@^0.2.0":
|
||||
version "0.2.0"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.0/registry-sdk-0.2.0.tgz#c14d5efb16bfd7ce288f67a8f2c521f28e5737ba"
|
||||
integrity sha512-S7R/RfQwP6Im8s+k9kXA4PK8183ztypktYC/7vbYXpaKRkgEQ8J7rXL5trC2Rz1J4ghHsp/DYnyJNNqIILEDCw==
|
||||
"@cerc-io/registry-sdk@^0.2.1":
|
||||
version "0.2.1"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.1/registry-sdk-0.2.1.tgz#c25cbfc89e469197b18e960baa4204e9e5c5511c"
|
||||
integrity sha512-rshIFOaYVyKJu4MU0OATN0JLYrjue9xvQ4Eqnd2z03lS8WMh0gt1eJHzp8A8sxs1IP/jpb6mWXhmu0oQujO2Sg==
|
||||
dependencies:
|
||||
"@cosmjs/amino" "^0.28.1"
|
||||
"@cosmjs/crypto" "^0.28.1"
|
||||
|
Loading…
Reference in New Issue
Block a user