Merge pull request #178 from CosmWasm/update-cli

Update CLI for 0.8 demo net
This commit is contained in:
Ethan Frey 2020-05-26 16:24:13 +02:00 committed by GitHub
commit 9d4fdbc514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -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:

View File

@ -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<string> => {
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
return mnemonicToAddress(prefix, mnemonic);
}
const mnemonicToAddress = async (prefix: string, mnemonic: string): Promise<string> => {
const pen = await Secp256k1Pen.fromMnemonic(mnemonic);
const pubkey = encodeSecp256k1Pubkey(pen.pubkey);
return pubkeyToAddress(pubkey, prefix);