diff --git a/backend/apollo-miner/miner_start.sh b/backend/apollo-miner/miner_start.sh index 1591cd3..8943c36 100755 --- a/backend/apollo-miner/miner_start.sh +++ b/backend/apollo-miner/miner_start.sh @@ -11,7 +11,7 @@ start_hashboards() local boardType=$(./apollo-helper -s $1) - if [[ "$boardType" == *"Apollo-BTC"* ]]; then + if [[ "$boardType" == *"Apollo-BTC"* || "$boardType" == *"RD6"* ]]; then screen -dmS miner ./futurebit-miner -comport $1 -ao_mode 1 $settings -powermode $mode elif [[ "$boardType" == *"Apollo-2"* ]]; then screen -dmS miner ./futurebit-miner-v2 -comport $1 -ao_mode 1 $settings -powermode $mode @@ -37,7 +37,7 @@ sleep 35 boardType=$(./apollo-helper -s /dev/ttyS1) -if [[ "$boardType" == *"Apollo-BTC"* ]]; then +if [[ "$boardType" == *"Apollo-BTC"* || "$boardType" == *"RD6"* ]]; then screen -dmS miner ./futurebit-miner -comport /dev/ttyS1 -ao_mode 1 $settings -powermode $mode elif [[ "$boardType" == *"Apollo-2"* ]]; then screen -dmS miner ./futurebit-miner-v2 -comport /dev/ttyS1 -ao_mode 1 $settings -powermode $mode diff --git a/backend/update_system b/backend/update_system index 270a975..e823a8a 100755 --- a/backend/update_system +++ b/backend/update_system @@ -45,19 +45,10 @@ cp $APOLLO_DIR/backend/systemd/ckpool.service /etc/systemd/system/ echo -e "${YELLOW} ---> Reloading systemd${NC}" systemctl daemon-reload -echo -e "${YELLOW} ---> Restarting APP${NC}" -systemctl restart node -systemctl restart ckpool -systemctl restart apollo-api -systemctl restart apollo-miner - -#Restart UI after old version of UI finishes update progress -sleep 1 - -systemctl restart apollo-ui-v2 - -sleep 3 +echo -e "${YELLOW} ---> Rebooting${NC}" echo "100" > $TMPFILE -rm $TMPFILE \ No newline at end of file +rm $TMPFILE + +reboot diff --git a/package.json b/package.json index bdf9ca3..debdb9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apolloapi-v2", - "version": "2.0.3", + "version": "2.0.4", "main": "index.js", "repository": "https://github.com/jstefanop/apolloapi-v2.git", "author": "FutureBit LLC", diff --git a/src/graphql/graphqlModules/Miner/MinerStats.js b/src/graphql/graphqlModules/Miner/MinerStats.js index b0d7c08..a66e3d5 100644 --- a/src/graphql/graphqlModules/Miner/MinerStats.js +++ b/src/graphql/graphqlModules/Miner/MinerStats.js @@ -86,30 +86,30 @@ module.exports.typeDefs = ` interval: Int jobs: Int cleanFlags: Int - sharesSent: Int - sharesAccepted: Int - sharesRejected: Int - solutionsAccepted: Int + sharesSent: Float + sharesAccepted: Float + sharesRejected: Float + solutionsAccepted: Float minRespTime: Float avgRespTime: Float maxRespTime: Float shareLoss: Float - poolTotal: Int + poolTotal: Float inService: Int subscribeError: Int - diffChanges: Int + diffChanges: Float reconnections: Int reconnectionsOnErrors: Int - defaultJobShares: Int - staleJobShares: Int - duplicateShares: Int - lowDifficultyShares: Int - pwcSharesSent: Int - pwcSharesDropped: Int - bigDiffShares: Int - belowTargetShare: Int + defaultJobShares: Float + staleJobShares: Float + duplicateShares: Float + lowDifficultyShares: Float + pwcSharesSent: Float + pwcSharesDropped: Float + bigDiffShares: Float + belowTargetShare: Float pwcRestart: Int - statOverflow: Int + statOverflow: Float } type MinerStatsFans { @@ -170,7 +170,7 @@ module.exports.typeDefs = ` type MinerStatsSlotAlert { alertLo: Int alertHi: Int - numWrite: Int + numWrite: Float } type MinerStatsSlave { @@ -203,8 +203,8 @@ module.exports.typeDefs = ` hashrate1d: String hashrate7d: String diff: Float - accepted: Int - rejected: Int + accepted: Float + rejected: Float bestshare: Float SPS1m: Float SPS5m: Float @@ -220,7 +220,7 @@ module.exports.typeDefs = ` hashrate7d: String lastshare: Int workers: Int - shares: Int + shares: Float bestshare: Float bestever: Float authorised: Int @@ -235,7 +235,7 @@ module.exports.typeDefs = ` hashrate1d: String, hashrate7d: String, lastshare: Int, - shares: Int, + shares: Float, bestshare: Float, bestever: Float } diff --git a/src/init.js b/src/init.js index b2c35f2..2fe76a8 100644 --- a/src/init.js +++ b/src/init.js @@ -31,9 +31,9 @@ const runMigrations = async () => { try { console.log('Run migrations'); const resp = await knex.migrate.latest(); - await createCkpoolConfigFile(); - await createBitcoinConfigFile(); await runGenerateBitcoinPassword(); + await createBitcoinConfigFile(); + await createCkpoolConfigFile(); } catch (err) { console.log(err); } @@ -130,6 +130,18 @@ uacomment=FutureBit-Apollo-Node`; `Error during the creation of the file bitcoin.conf: ${error.message}` ); } + } finally { + const [settings] = await knex('settings') + .select(['node_rpc_password as nodeRpcPassword']) + .orderBy('created_at', 'desc') + .orderBy('id', 'desc') + .limit(1); + + if (settings && settings.nodeRpcPassword) { + exec( + `sudo sed -i s/rpcpassword.*/rpcpassword=${settings.nodeRpcPassword}/g ${configFilePath}` + ); + } } }; diff --git a/src/utils.js b/src/utils.js index 85ed9cd..a775c72 100644 --- a/src/utils.js +++ b/src/utils.js @@ -46,6 +46,9 @@ module.exports.auth = { '../backend/ckpool/ckpool.conf' ); + await fs.access(configFilePath); + await fs.access(configCkpoolFilePath); + exec( `sudo sed -i s/rpcpassword.*/rpcpassword=${password}/g ${configFilePath}` ); @@ -54,8 +57,6 @@ module.exports.auth = { `sudo sed -i 's#"pass": ""#"pass": "${password}"#g' ${configCkpoolFilePath}` ); - console.log(password, configFilePath); - exec('sudo systemctl restart node'); exec('sudo systemctl restart ckpool'); } catch (err) {