Merge pull request #20 from confio/binary-name

Fix faucet binary name
This commit is contained in:
Ethan Frey 2020-01-30 12:02:46 +01:00 committed by GitHub
commit 669c5886cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 7 deletions

View File

@ -19,5 +19,5 @@ WORKDIR /run_repo_root
RUN yarn install --frozen-lockfile --production
EXPOSE 8000
ENTRYPOINT ["/run_repo_root/packages/faucet/bin/cosm-faucet"]
ENTRYPOINT ["/run_repo_root/packages/faucet/bin/cosmwasm-faucet"]
CMD [""]

View File

@ -21,13 +21,13 @@ FAUCET_CREDIT_AMOUNT_COSM=10 \
FAUCET_CREDIT_AMOUNT_STAKE=5 \
FAUCET_CONCURRENCY=3 \
FAUCET_MNEMONIC="economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone" \
./bin/cosm-faucet start cosmwasm "http://localhost:1317"
./bin/cosmwasm-faucet start cosmwasm "http://localhost:1317"
```
## Usage
```
sage: cosmwasm-faucet action [arguments...]
Usage: cosmwasm-faucet action [arguments...]
Positional arguments per action are listed below. Arguments in parentheses are optional.

View File

@ -21,7 +21,7 @@
"access": "public"
},
"scripts": {
"dev-start": "FAUCET_CREDIT_AMOUNT_COSM=10 FAUCET_CREDIT_AMOUNT_STAKE=5 FAUCET_CONCURRENCY=3 FAUCET_MNEMONIC=\"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone\" ./bin/cosm-faucet start cosmwasm \"http://localhost:1317\"",
"dev-start": "FAUCET_CREDIT_AMOUNT_COSM=10 FAUCET_CREDIT_AMOUNT_STAKE=5 FAUCET_CONCURRENCY=3 FAUCET_MNEMONIC=\"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone\" ./bin/cosmwasm-faucet start cosmwasm \"http://localhost:1317\"",
"docs": "shx rm -rf docs && typedoc --options typedoc.js",
"format": "prettier --write --loglevel warn \"./src/**/*.ts\"",
"lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && tslint -t verbose --project .",

View File

@ -3,11 +3,14 @@ import { Bip39, Random } from "@iov/crypto";
import { UserProfile } from "@iov/keycontrol";
import { codecFromString } from "../codec";
import * as constants from "../constants";
import { setSecretAndCreateIdentities } from "../profile";
export async function generate(args: ReadonlyArray<string>): Promise<void> {
if (args.length < 2) {
throw Error(`Not enough arguments for action 'generate'. See 'iov-faucet help' or README for arguments.`);
throw Error(
`Not enough arguments for action 'generate'. See '${constants.binaryName} help' or README for arguments.`,
);
}
const codecName = codecFromString(args[0]);
const chainId = args[1] as ChainId;

View File

@ -1,4 +1,4 @@
const binaryName = "cosmwasm-faucet";
import { binaryName } from "../constants";
export function help(): void {
const out = `

View File

@ -36,7 +36,9 @@ function getCount(): number {
export async function start(args: ReadonlyArray<string>): Promise<void> {
if (args.length < 2) {
throw Error(`Not enough arguments for action 'start'. See 'iov-faucet help' or README for arguments.`);
throw Error(
`Not enough arguments for action 'start'. See '${constants.binaryName} help' or README for arguments.`,
);
}
const codec = codecFromString(args[0]);
const blockchainBaseUrl: string = args[1];

View File

@ -1,3 +1,4 @@
export const binaryName = "cosmwasm-faucet";
export const concurrency: number = Number.parseInt(process.env.FAUCET_CONCURRENCY || "", 10) || 5;
export const port: number = Number.parseInt(process.env.FAUCET_PORT || "", 10) || 8000;
export const mnemonic: string | undefined = process.env.FAUCET_MNEMONIC;