2 Commits

Author SHA1 Message Date
cf7c3cb910 1.0.11 2022-02-25 21:45:22 +01:00
b8eb82de12 fix(core): update 2022-02-25 21:45:21 +01:00
4 changed files with 18 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@mojoio/bobcat",
"version": "1.0.10",
"version": "1.0.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@mojoio/bobcat",
"version": "1.0.10",
"version": "1.0.11",
"license": "MIT",
"dependencies": {
"@pushrocks/smartnetwork": "^2.0.14",

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/bobcat",
"version": "1.0.10",
"version": "1.0.11",
"private": false,
"description": "a module to talk to bobcat miners",
"main": "dist_ts/index.js",

View File

@ -50,6 +50,17 @@ export class Bobcat {
await this.gatherMinerDetails();
if (this.latestStatus.status !== 'Synced') {
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);
}
}

View File

@ -21,4 +21,8 @@ export class BobcatManager {
await bobcat.runMaintenance();
}
};
public async restart() {
}
}