fix(core): update
This commit is contained in:
@@ -4,5 +4,41 @@ import * as plugins from './bobcat.plugins';
|
||||
* maps to an individual bobcat miner
|
||||
*/
|
||||
export class Bobcat {
|
||||
|
||||
// STATIC
|
||||
public static async createFromNetworkAddress(networkAddressArg: string) {
|
||||
const newBobcat = new Bobcat(networkAddressArg);
|
||||
await newBobcat.gatherMinerDetails();
|
||||
return newBobcat;
|
||||
}
|
||||
|
||||
// INSTANCE
|
||||
public networkAddress: string;
|
||||
constructor(networkAddress: string) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* checks the status of the miner
|
||||
*/
|
||||
public async checkMinerStatus() {
|
||||
const response = await plugins.smartrequest.getJson(`http://${this.networkAddress}/status.json`);
|
||||
const body: {
|
||||
"status": string,
|
||||
"gap": string,
|
||||
"miner_height": string,
|
||||
"blockchain_height": string,
|
||||
"epoch": "rpc"
|
||||
} = response.body;
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* gathers the miner details
|
||||
*/
|
||||
public async gatherMinerDetails() {
|
||||
const response: {
|
||||
|
||||
} = plugins.smartrequest.getJson(`http://${this.networkAddress}/miner.json`);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user