2

Initially, the regular sync would not download the last 200+/- blocks or so. I was told to switch to light sync where it finished. I then read that to start mining real ether on the main network, I need to use geth here:

I don't see "Start Mining" option?

mist geth

After typing the command abolve into the terminal, I got the following:

Terminal after typing mist geth

My issue is, how do I know if I am mining ether or not? Or is there another step I am missing?

Chris
  • 123
  • 4

2 Answers2

1

when I am connecting mist to a private network I don't have the mining option neither. However, when I start mining from the geth javascript console, mist does indicate that my node is currently mining

mist

here is how I set things up (given that setting up a private network is still not straightforward in my opinion).

create a workspace:

$ mkdir devnet
$ cd devnet
devnet$ mkdir node1

create account for your mining node

devnet$ geth --datadir node1/ account new

save your address and password. Append 0x to your address. Create a genesis file with puppeth (or just google for a simple genesis file)

devnet$ puppeth

now initialize your node

devnet$ geth --datadir node1/ init genesis.json

start your node. Use same networkId as defined in genesis file (using puppeth)

devnet$ geth --datadir node1/ --port 30303 --rpc --rpcport 8545 --rpcapi "personal,db,eth,net,web3" --networkid XXX

see geth Command line options for all commands.

connect a web3 javascript console to your geth node

devnet$ geth attach ipc:node1/geth.ipc
(or ~$ geth attach "http://localhost:8545")
> personal.unlockAccount(eth.coinbase, 'password', 0)
> miner.start()
> exit // to quit the javascript console

or everything in one signle command

devnet$ geth --datadir node1/ --port 30303 --rpc --rpcport 8545 --rpcapi "personal,db,eth,net,web3" --networkid XXX --unlock '0xaddress' --password passwords.txt --mine

connect mist to your node

devnet$ mist --rpc node1/geth.ipc
(or ~$ mist --rpc "http://localhost:8545")

here is the file structure for clarity:

devnet$ tree -L 2
.
├── genesis.json
├── node1
│   ├── geth
│   └── keystore
└── password.txt
salanfe
  • 611
  • 4
  • 9
  • Just to be clear, this is to mine real ether on the public network? – Chris Feb 03 '18 at 05:23
  • I am now also getting ReferenceError: 'miner' is not defined I have checked, my file structure is the same as yours except for geth.ipc in the node1 folder. I also could find a networkID in the genisis file so I used 0 as it is the first network I created. – Chris Feb 03 '18 at 06:31
  • networkId must be defined in your genesis file. Low values, are reserved to mainnet and public testnets: 1 is mainnet, 3 is rospten, 4 is rinkeby. Use something random like 3434.
  • pls spend some time on geth commands on options https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options
  • pls study the javascript JSON RPC API https://github.com/ethereum/wiki/wiki/JSON-RPC
  • if you're using networkId=1 then you're on the mainnet and mining real ether (but in that case you don't need a genesis file as those values are predefined in geth source code). you can do it ! :)
  • – salanfe Feb 04 '18 at 10:00