mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-28 13:02:35 +02:00
commit
f85d656a81
@ -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
|
||||
|
@ -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
|
||||
rm $TMPFILE
|
||||
|
||||
reboot
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
}
|
||||
|
16
src/init.js
16
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}`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user