From 005a216d46f9b198b37360069253e963d273da95 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 26 May 2020 15:26:46 +0200 Subject: [PATCH] Update CLI for 0.8 demo net --- packages/cli/README.md | 2 +- packages/cli/examples/helpers.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/cli/README.md b/packages/cli/README.md index 7130b7eb..e9d512f8 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -83,7 +83,7 @@ quick queries on a chain, you can use an extended set of helpers: Start with `./bin/cosmwasm-cli --init examples/helpers.ts` -(This points to the Demonet at https://lcd.demo-071.cosmwasm.com for ease of use. Other networks, look below) +(This points to the Demonet at https://lcd.demo-08.cosmwasm.com for ease of use. Other networks, look below) Setup Account: diff --git a/packages/cli/examples/helpers.ts b/packages/cli/examples/helpers.ts index 8b15fde4..31899932 100644 --- a/packages/cli/examples/helpers.ts +++ b/packages/cli/examples/helpers.ts @@ -7,14 +7,14 @@ interface Options { }; const defaultOptions: Options = { - httpUrl: "https://lcd.demo-071.cosmwasm.com", + httpUrl: "https://lcd.demo-08.cosmwasm.com", networkId: "testing", feeToken: "ucosm", gasPrice: 0.025, bech32prefix: "cosmos", } -const defaultFaucetUrl = "https://faucet.demo-071.cosmwasm.com/credit"; +const defaultFaucetUrl = "https://faucet.demo-08.cosmwasm.com/credit"; const buildFeeTable = (feeToken: string, gasPrice: number): FeeTable => { const stdFee = (gas: number, denom: string, price: number) => { @@ -88,6 +88,10 @@ const hitFaucet = async (faucetUrl: string, address: string, ticker: string): Pr const randomAddress = async (prefix: string): Promise => { const mnemonic = Bip39.encode(Random.getBytes(16)).toString(); + return mnemonicToAddress(prefix, mnemonic); +} + +const mnemonicToAddress = async (prefix: string, mnemonic: string): Promise => { const pen = await Secp256k1Pen.fromMnemonic(mnemonic); const pubkey = encodeSecp256k1Pubkey(pen.pubkey); return pubkeyToAddress(pubkey, prefix);