mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-06-02 23:42:30 +02:00
commit
f85d656a81
@ -11,7 +11,7 @@ start_hashboards()
|
|||||||
|
|
||||||
local boardType=$(./apollo-helper -s $1)
|
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
|
screen -dmS miner ./futurebit-miner -comport $1 -ao_mode 1 $settings -powermode $mode
|
||||||
elif [[ "$boardType" == *"Apollo-2"* ]]; then
|
elif [[ "$boardType" == *"Apollo-2"* ]]; then
|
||||||
screen -dmS miner ./futurebit-miner-v2 -comport $1 -ao_mode 1 $settings -powermode $mode
|
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)
|
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
|
screen -dmS miner ./futurebit-miner -comport /dev/ttyS1 -ao_mode 1 $settings -powermode $mode
|
||||||
elif [[ "$boardType" == *"Apollo-2"* ]]; then
|
elif [[ "$boardType" == *"Apollo-2"* ]]; then
|
||||||
screen -dmS miner ./futurebit-miner-v2 -comport /dev/ttyS1 -ao_mode 1 $settings -powermode $mode
|
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}"
|
echo -e "${YELLOW} ---> Reloading systemd${NC}"
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
echo -e "${YELLOW} ---> Restarting APP${NC}"
|
echo -e "${YELLOW} ---> Rebooting${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 "100" > $TMPFILE
|
echo "100" > $TMPFILE
|
||||||
|
|
||||||
rm $TMPFILE
|
rm $TMPFILE
|
||||||
|
|
||||||
|
reboot
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "apolloapi-v2",
|
"name": "apolloapi-v2",
|
||||||
"version": "2.0.3",
|
"version": "2.0.4",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "https://github.com/jstefanop/apolloapi-v2.git",
|
"repository": "https://github.com/jstefanop/apolloapi-v2.git",
|
||||||
"author": "FutureBit LLC",
|
"author": "FutureBit LLC",
|
||||||
|
@ -86,30 +86,30 @@ module.exports.typeDefs = `
|
|||||||
interval: Int
|
interval: Int
|
||||||
jobs: Int
|
jobs: Int
|
||||||
cleanFlags: Int
|
cleanFlags: Int
|
||||||
sharesSent: Int
|
sharesSent: Float
|
||||||
sharesAccepted: Int
|
sharesAccepted: Float
|
||||||
sharesRejected: Int
|
sharesRejected: Float
|
||||||
solutionsAccepted: Int
|
solutionsAccepted: Float
|
||||||
minRespTime: Float
|
minRespTime: Float
|
||||||
avgRespTime: Float
|
avgRespTime: Float
|
||||||
maxRespTime: Float
|
maxRespTime: Float
|
||||||
shareLoss: Float
|
shareLoss: Float
|
||||||
poolTotal: Int
|
poolTotal: Float
|
||||||
inService: Int
|
inService: Int
|
||||||
subscribeError: Int
|
subscribeError: Int
|
||||||
diffChanges: Int
|
diffChanges: Float
|
||||||
reconnections: Int
|
reconnections: Int
|
||||||
reconnectionsOnErrors: Int
|
reconnectionsOnErrors: Int
|
||||||
defaultJobShares: Int
|
defaultJobShares: Float
|
||||||
staleJobShares: Int
|
staleJobShares: Float
|
||||||
duplicateShares: Int
|
duplicateShares: Float
|
||||||
lowDifficultyShares: Int
|
lowDifficultyShares: Float
|
||||||
pwcSharesSent: Int
|
pwcSharesSent: Float
|
||||||
pwcSharesDropped: Int
|
pwcSharesDropped: Float
|
||||||
bigDiffShares: Int
|
bigDiffShares: Float
|
||||||
belowTargetShare: Int
|
belowTargetShare: Float
|
||||||
pwcRestart: Int
|
pwcRestart: Int
|
||||||
statOverflow: Int
|
statOverflow: Float
|
||||||
}
|
}
|
||||||
|
|
||||||
type MinerStatsFans {
|
type MinerStatsFans {
|
||||||
@ -170,7 +170,7 @@ module.exports.typeDefs = `
|
|||||||
type MinerStatsSlotAlert {
|
type MinerStatsSlotAlert {
|
||||||
alertLo: Int
|
alertLo: Int
|
||||||
alertHi: Int
|
alertHi: Int
|
||||||
numWrite: Int
|
numWrite: Float
|
||||||
}
|
}
|
||||||
|
|
||||||
type MinerStatsSlave {
|
type MinerStatsSlave {
|
||||||
@ -203,8 +203,8 @@ module.exports.typeDefs = `
|
|||||||
hashrate1d: String
|
hashrate1d: String
|
||||||
hashrate7d: String
|
hashrate7d: String
|
||||||
diff: Float
|
diff: Float
|
||||||
accepted: Int
|
accepted: Float
|
||||||
rejected: Int
|
rejected: Float
|
||||||
bestshare: Float
|
bestshare: Float
|
||||||
SPS1m: Float
|
SPS1m: Float
|
||||||
SPS5m: Float
|
SPS5m: Float
|
||||||
@ -220,7 +220,7 @@ module.exports.typeDefs = `
|
|||||||
hashrate7d: String
|
hashrate7d: String
|
||||||
lastshare: Int
|
lastshare: Int
|
||||||
workers: Int
|
workers: Int
|
||||||
shares: Int
|
shares: Float
|
||||||
bestshare: Float
|
bestshare: Float
|
||||||
bestever: Float
|
bestever: Float
|
||||||
authorised: Int
|
authorised: Int
|
||||||
@ -235,7 +235,7 @@ module.exports.typeDefs = `
|
|||||||
hashrate1d: String,
|
hashrate1d: String,
|
||||||
hashrate7d: String,
|
hashrate7d: String,
|
||||||
lastshare: Int,
|
lastshare: Int,
|
||||||
shares: Int,
|
shares: Float,
|
||||||
bestshare: Float,
|
bestshare: Float,
|
||||||
bestever: Float
|
bestever: Float
|
||||||
}
|
}
|
||||||
|
16
src/init.js
16
src/init.js
@ -31,9 +31,9 @@ const runMigrations = async () => {
|
|||||||
try {
|
try {
|
||||||
console.log('Run migrations');
|
console.log('Run migrations');
|
||||||
const resp = await knex.migrate.latest();
|
const resp = await knex.migrate.latest();
|
||||||
await createCkpoolConfigFile();
|
|
||||||
await createBitcoinConfigFile();
|
|
||||||
await runGenerateBitcoinPassword();
|
await runGenerateBitcoinPassword();
|
||||||
|
await createBitcoinConfigFile();
|
||||||
|
await createCkpoolConfigFile();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@ -130,6 +130,18 @@ uacomment=FutureBit-Apollo-Node`;
|
|||||||
`Error during the creation of the file bitcoin.conf: ${error.message}`
|
`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'
|
'../backend/ckpool/ckpool.conf'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await fs.access(configFilePath);
|
||||||
|
await fs.access(configCkpoolFilePath);
|
||||||
|
|
||||||
exec(
|
exec(
|
||||||
`sudo sed -i s/rpcpassword.*/rpcpassword=${password}/g ${configFilePath}`
|
`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}`
|
`sudo sed -i 's#"pass": ""#"pass": "${password}"#g' ${configCkpoolFilePath}`
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(password, configFilePath);
|
|
||||||
|
|
||||||
exec('sudo systemctl restart node');
|
exec('sudo systemctl restart node');
|
||||||
exec('sudo systemctl restart ckpool');
|
exec('sudo systemctl restart ckpool');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user