Skip to content
This repository was archived by the owner on Mar 5, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- A new npm dependency `dotenv` has been added. When updating from a previous
version it is necessary to install it by executing `sudo npm install -g dotenv`
followed by `npm link dotenv` inside the commander directory.
- When using `bip38` the password is no longer exposed in the process monitor.
- Starting the relay/forger/explorer manually is now easier:
Relay:
`pm2 start --only ark-core-relay`
Forger without bip38 encryption:
`pm2 start --only ark-core-forger`
Forger with bip38 encryption:
`pm2 start --only ark-core-forger -- --password ark`
Explorer:
`pm2 start --only ark-core-explorer`

### Removed
- Redis
Expand Down
5 changes: 1 addition & 4 deletions actions/apps/forger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,8 @@ __forger_configure_bip38 ()

__forger_start_with_bip38 ()
{
local bip38=$(jq -r '.bip38' "$CORE_CONFIG/delegates.json")

read -sp "Please enter your bip38 password: " password

pm2 start $commander_ecosystem --only ark-core-forger -- --bip38 "$bip38" --password "$password" >> "$commander_log" 2>&1
pm2 start $commander_ecosystem --only ark-core-forger -- --password "$password" >> "$commander_log" 2>&1
}

__forger_start_without_bip38 ()
Expand Down
20 changes: 12 additions & 8 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require('dotenv').config({ path: `${process.env.HOME}/.commander` })

const parseArg = (key) => {
const index = process.argv.indexOf(key)
const delegates = require(`${process.env.CORE_CONFIG}/delegates.json`)

const getPasswordFromArgs = () => {
const index = process.argv.indexOf('--password')
if (index !== -1) {
return `${key} ${process.argv[index + 1]}`
return process.argv[index + 1]
}

return ''
return undefined
}

module.exports = {
Expand All @@ -25,11 +27,13 @@ module.exports = {
args: `forger --data ${process.env.CORE_DATA}
--config ${process.env.CORE_CONFIG}
--token ${process.env.CORE_TOKEN}
--network ${process.env.CORE_NETWORK}
${parseArg('--bip38')}
${parseArg('--password')}`,
--network ${process.env.CORE_NETWORK}`,
max_restarts: 5,
min_uptime: '5m'
min_uptime: '5m',
env: {
ARK_FORGER_BIP38: delegates.bip38,
ARK_FORGER_PASSWORD: getPasswordFromArgs()
}
}, {
name: 'ark-explorer',
script: `${process.env.EXPLORER_DIR}/express-server.js`,
Expand Down