chore: server code formatting

This commit is contained in:
Rafael Taranto 2025-05-12 15:35:00 +01:00
parent aedabcbdee
commit 68517170e2
234 changed files with 9824 additions and 6195 deletions

View file

@ -4,11 +4,16 @@ const common = require('./common')
module.exports = { setup, updateCore }
function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating the Geth Ethereum wallet. This may take a minute...')
function updateCore(coinRec, isCurrentlyRunning) {
common.logger.info(
'Updating the Geth Ethereum wallet. This may take a minute...',
)
common.es(`sudo supervisorctl stop ethereum`)
common.es(`curl -#o /tmp/ethereum.tar.gz ${coinRec.url}`)
if (common.es(`sha256sum /tmp/ethereum.tar.gz | awk '{print $1}'`).trim() !== coinRec.urlHash) {
if (
common.es(`sha256sum /tmp/ethereum.tar.gz | awk '{print $1}'`).trim() !==
coinRec.urlHash
) {
common.logger.info('Failed to update Geth: Package signature do not match!')
return
}
@ -27,7 +32,7 @@ function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Geth is updated!')
}
function setup (dataDir) {
function setup(dataDir) {
const coinRec = coinUtils.getCryptoCurrency('ETH')
common.firewall([coinRec.defaultPort])
const cmd = `/usr/local/bin/${coinRec.daemon} --datadir "${dataDir}" --syncmode="light" --cache 2048 --maxpeers 40 --http`