Skip to content

Commit

Permalink
fix(w3gw): make sure that either W3GW_SEED_PHRASE or W3GW_PRIVATE_KEY…
Browse files Browse the repository at this point in the history
…S vars are set
  • Loading branch information
guidiaz committed Jun 14, 2023
1 parent fd38f87 commit 48459d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .env_example
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# W3GW: mandatory
# W3GW : mandatory
W3GW_PRIVATE_KEYS=[]
W3GW_SEED_PHRASE=""
W3GW_NUM_WALLETS=3

# W3GW: accesory
W3GW_LOG_LEVEL=debug
W3GW_NUM_WALLETS=
W3GW_PROVIDER_URL=
W3GW_PROVIDER_KEY=
W3GW_PORT
20 changes: 4 additions & 16 deletions src/bin/w3gw.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config()
const execSync = require('child_process').execSync
const scripts = require('../../package.json').scripts

if (process.argv.length >= 3) {
if (process.argv.length >= 3 && (process.env.W3GW_SEED_PHRASE || process.env.W3GW_PRIVATE_KEYS)) {
for (var key in scripts) {
if (key === process.argv[2]) {
if (process.argv.length >= 4) {
Expand Down Expand Up @@ -87,27 +87,15 @@ console.info(
'\t=>',
'Secret phrase from which wallet addresses will be derived.'
)
console.info(
' ',
'W3GW_NUM_WALLETS',
'\t=>',
'Number of wallet addresses to derive from given seed phrase (default: 3).'
)
console.info()
console.info(
'To connect to some specific ETH/JSONRPC endpoint different from the default one, you can also set:'
'Optionally, you can specify an ETH/JSONRPC endpoint different from the default one by setting:'
)
console.info()
console.info(
' ',
'W3GW_PROVIDER_URL',
'\t=>',
'ETH/RPC endpoint where to connect to.'
'ETH/JSONRPC endpoint where to connect to.'
)
console.info()
console.info(
'To run the local gateway on a port different from the default one, please set:'
)
console.info()
console.info(' ', 'W3GW_PORT', '\t=>', 'ETH/RPC endpoint where to connect to.')
console.info()
console.info()

0 comments on commit 48459d9

Please sign in to comment.