๐ฏMining API
Notes
For more details visit BCH APIs page.
//imports
using Cash.NetCore.Contracts;
using Cash.NetCore.Models.Response.Mining;
//inject
private readonly IMiningService _miningService;
๐ฐGet Estimated network hashes per second.โ
Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.โ
- Request
- Response
- ...
//Sample Request ๐
var networkHash = await _miningService!.GetNetworkHashpsAsync(120, -1);
//will return networkHash: ๐
var networkHash = 9273.324192503671
๐ For more information Check out Get Estimated network hashes per second.
๐ฐGet Mining Info.โ
Returns a json object containing mining-related information.โ
- Request
- Response
- ...
//Sample Request ๐
var miningInfo = await _miningService!.GetMiningInfoAsync();
//will return MiningInfo: ๐
var miningInfo = new MiningInfo
{
Blocks = 734236,
CurrentBlockSize = 0,
CurrentBlockTx = 0,
Difficulty = 227336239671.5679,
Networkhashps = 1579123811663756000,
Pooledtx = 2,
Chain = "main",
Warnings=""
};
๐ For more information Check out Get Mining Info.