-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into aaronmgdr/thesplintering
* master: Integration deploy, don't overwrite genesis block if upgrading testnet (#1315) Fix broken Discord link (#1317) [Wallet] Add check for $ENVFILE to pre-dev script (#1324) Add GRADLE_OPTS note to SETUP.md (#1311) Allow validators to specify an attestationKey with which they sign attestations (#1313) Add step to install typescript and other minor edits (#1256) [Wallet] Add script to build sdk for env before running yarn dev (#1312) [Wallet] Fix ListView deprecation warning (#1293) Set IN_MEMORY_DISCOVERY_TABLE=true for integration (#1296) Add ability to generate addresses directly from env file in celotool (#1294)
- Loading branch information
Showing
27 changed files
with
423 additions
and
76 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
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,46 @@ | ||
/* tslint:disable no-console */ | ||
import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' | ||
import { | ||
coerceMnemonicAccountType, | ||
getAddressFromEnv, | ||
MNEMONIC_ACCOUNT_TYPE_CHOICES, | ||
} from 'src/lib/generate_utils' | ||
import * as yargs from 'yargs' | ||
|
||
export const command = 'address-from-env' | ||
|
||
export const describe = | ||
'command for fetching addresses (validator, load_testing, tx_node, bootnode and faucet) as specified by the current environment' | ||
|
||
interface AccountAddressArgv { | ||
index: number | ||
accountType: string | ||
} | ||
|
||
export const builder = (argv: yargs.Argv) => { | ||
return addCeloEnvMiddleware( | ||
argv | ||
.option('index', { | ||
alias: 'i', | ||
type: 'number', | ||
description: 'account index', | ||
demand: 'Please specifiy account index', | ||
}) | ||
.option('accountType', { | ||
alias: 'a', | ||
type: 'string', | ||
choices: MNEMONIC_ACCOUNT_TYPE_CHOICES, | ||
description: 'account type', | ||
demand: 'Please specifiy account type', | ||
required: true, | ||
}) | ||
) | ||
} | ||
|
||
export const handler = async (argv: CeloEnvArgv & AccountAddressArgv) => { | ||
const validatorAddress = getAddressFromEnv( | ||
coerceMnemonicAccountType(argv.accountType), | ||
argv.index | ||
) | ||
console.info(validatorAddress) | ||
} |
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
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,13 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# ==================================== | ||
# Tasks to run before running yarn dev | ||
# ==================================== | ||
|
||
# Detect network from .env and build the sdk for it | ||
ENV_FILENAME="${ENVFILE:-.env}" | ||
export $(grep -v '^#' $ENV_FILENAME | xargs) | ||
echo "Building sdk for testnet $DEFAULT_TESTNET" | ||
yarn build:sdk $DEFAULT_TESTNET | ||
echo "Done building sdk" |
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
Oops, something went wrong.