Use default address for mining

This commit is contained in:
Łukasz Magiera 2019-07-26 18:14:01 +02:00 committed by whyrusleeping
parent c8478ddd3f
commit 2f5cdf1d15
3 changed files with 8 additions and 3 deletions

View File

@ -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 {

View File

@ -26,6 +26,7 @@ class Block extends React.Component {
<div>Height: {head.Height}</div>
<div>Parents: <BlockLinks cids={head.Parents} conn={this.props.conn} mountWindow={this.props.mountWindow}/></div>
<div>Weight: {head.ParentWeight}</div>
<div>Miner: {head.Miner}</div>
<div>Messages: {head.Messages['/']} {/*TODO: link to message explorer */}</div>
<div>Receipts: {head.MessageReceipts['/']}</div>
<div>State Root: {head.StateRoot['/']}</div>

View File

@ -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() {