From 2f5cdf1d151b910a5795401af93c6fa400617c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 26 Jul 2019 18:14:01 +0200 Subject: [PATCH] Use default address for mining --- cli/miner.go | 3 +-- lotuspond/front/src/Block.js | 1 + lotuspond/front/src/FullNode.js | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cli/miner.go b/cli/miner.go index d4ed66b9c..a18bc9d50 100644 --- a/cli/miner.go +++ b/cli/miner.go @@ -3,7 +3,6 @@ package cli import ( "fmt" - "github.com/pkg/errors" "gopkg.in/urfave/cli.v2" ) @@ -29,7 +28,7 @@ var minerStart = &cli.Command{ // TODO: this address needs to be the address of an actual miner maddr, err := api.WalletDefaultAddress(ctx) if err != nil { - return errors.Wrap(err, "failed to create miner address") + return err } if err := api.MinerStart(ctx, maddr); err != nil { diff --git a/lotuspond/front/src/Block.js b/lotuspond/front/src/Block.js index 8cc2e9dd1..a97493bbd 100644 --- a/lotuspond/front/src/Block.js +++ b/lotuspond/front/src/Block.js @@ -26,6 +26,7 @@ class Block extends React.Component {
Height: {head.Height}
Parents:
Weight: {head.ParentWeight}
+
Miner: {head.Miner}
Messages: {head.Messages['/']} {/*TODO: link to message explorer */}
Receipts: {head.MessageReceipts['/']}
State Root: {head.StateRoot['/']}
diff --git a/lotuspond/front/src/FullNode.js b/lotuspond/front/src/FullNode.js index d0f12d881..43da62bd2 100644 --- a/lotuspond/front/src/FullNode.js +++ b/lotuspond/front/src/FullNode.js @@ -101,8 +101,13 @@ class FullNode extends React.Component { async startMining() { // TODO: Use actual miner address // see cli/miner.go + let addr = "t0523423423" // in case we have no wallets + if (this.state.defaultAddr) { + addr = this.state.defaultAddr + } + this.setState({mining: true}) - await this.state.client.call("Filecoin.MinerStart", ["t0523423423"]) + await this.state.client.call("Filecoin.MinerStart", [addr]) } render() {