Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
cf7c3cb910 | |||
b8eb82de12 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/bobcat",
|
"name": "@mojoio/bobcat",
|
||||||
"version": "1.0.10",
|
"version": "1.0.11",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@mojoio/bobcat",
|
"name": "@mojoio/bobcat",
|
||||||
"version": "1.0.10",
|
"version": "1.0.11",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartnetwork": "^2.0.14",
|
"@pushrocks/smartnetwork": "^2.0.14",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/bobcat",
|
"name": "@mojoio/bobcat",
|
||||||
"version": "1.0.10",
|
"version": "1.0.11",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a module to talk to bobcat miners",
|
"description": "a module to talk to bobcat miners",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -50,6 +50,17 @@ export class Bobcat {
|
|||||||
await this.gatherMinerDetails();
|
await this.gatherMinerDetails();
|
||||||
if (this.latestStatus.status !== 'Synced') {
|
if (this.latestStatus.status !== 'Synced') {
|
||||||
console.log(`Miner ${this.latestMinerDetails.animal} is not synced. Restarting now!`);
|
console.log(`Miner ${this.latestMinerDetails.animal} is not synced. Restarting now!`);
|
||||||
|
await this.restart().catch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async restart() {
|
||||||
|
const response = await plugins.smartrequest.request(`http://${this.networkAddress}/admin/reboot`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Basic ' + Buffer.from('bobcat:miner').toString('base64')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(response.statusCode);
|
||||||
|
}
|
||||||
}
|
}
|
@ -21,4 +21,8 @@ export class BobcatManager {
|
|||||||
await bobcat.runMaintenance();
|
await bobcat.runMaintenance();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public async restart() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user