Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
Dashboard (#29)
Browse files Browse the repository at this point in the history
* - first dasboard commit
- upgraded correctly BitcoinD to dotnetcore 1.1
- wired Dashboard in BitcoinD (actually listen on port 5000)

* removed typescript references and files

* removed wwwroot/app folder

* NodeSettings page
  • Loading branch information
MithrilMan authored and dangershony committed Mar 3, 2017
1 parent 442e3ef commit 60b6e67
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 277 deletions.
47 changes: 15 additions & 32 deletions Stratis.Dashboard/Controllers/DebugController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,33 @@
using Stratis.Dashboard.Infrastructure;

namespace Stratis.Dashboard.Controllers {
[Route("/api/debug/[action]")]
public class DebugController : Controller {
public IFullNodeGetter FullNodeGetter { get; private set; }

public DebugController(IFullNodeGetter nodeGetter) {
this.FullNodeGetter = nodeGetter;
}

public void Mine(int? blockNumbers) {
var node = FullNodeGetter.GetFullNode();

if (node != null) {
// generate 1 block
node.Miner.GenerateBlocks(new Stratis.Bitcoin.Miner.ReserveScript() {
reserveSfullNodecript = new NBitcoin.Key().ScriptPubKey
}, 1, 100000000, false);
}
}


public IActionResult NodeSettings() {
var nodeSettings = FullNodeGetter.GetFullNode()?.Args;

return View("NodeSettings", nodeSettings);
}


public IActionResult Error() {
return View();
}
public IActionResult Mine() {
var node = FullNodeGetter.GetFullNode();

List<NBitcoin.uint256> result = null;

if (node != null) {
// generate 1 block
result = node.Miner.GenerateBlocks(
new Stratis.Bitcoin.Miner.ReserveScript() { reserveSfullNodecript = new NBitcoin.Key().ScriptPubKey },
1,
100000000,
false
);
}

/// <summary>
/// returns top peers
/// </summary>
/// <returns></returns>
public IActionResult TopPeers(int? howMany) {
return ViewComponent(typeof(ViewComponents.PeerListViewComponent), new {
limit = howMany
return Json(new {
result = result
});
}

public IActionResult BandStatistics() {
return ViewComponent(typeof(ViewComponents.BandStatisticsViewComponent));
}
}
}
Loading

0 comments on commit 60b6e67

Please sign in to comment.