Skip to content

miner.start() ,return "NULL" #15112

@kaminono

Description

@kaminono

System information

Geth version: geth version
Geth
Version: 1.6.7-stable
Git Commit: ab5646c
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.1
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.8

OS & Version:
xiaoyu@xiaoyu-VirtualBox:~$ uname -a
Linux xiaoyu-VirtualBox 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Commit hash : (if develop)

Expected behaviour

when i run miner.start() , it wil return true or false , BUT it return null

Actual behaviour

> miner.start()
null

Steps to reproduce the behaviour

xiaoyu@xiaoyu-VirtualBox:~/eth$ vim CustomGenesis.json 
xiaoyu@xiaoyu-VirtualBox:~/eth$ geth --datadir "/home/xiaoyu/eth" init CustomGenesis.json
WARN [09-07|17:24:27] No etherbase set and no accounts found as default 
INFO [09-07|17:24:27] Allocated cache and file handles         database=/home/xiaoyu/eth/geth/chaindata cache=16 handles=16
Fatal: Failed to write genesis block: genesis has no chain configuration
xiaoyu@xiaoyu-VirtualBox:~/eth$ ls
CustomGenesis.json  geth  keystore
xiaoyu@xiaoyu-VirtualBox:~/eth$ geth --datadir "/home/xiaoyu/eth" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 console 2>>geth.log
Welcome to the Geth JavaScript console!

instance: Geth/v1.6.7-stable-ab5646c5/linux-amd64/go1.8.1
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> personal.newAccount("xiaoyu")
"0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7"
> personal.newAccount("xiaoyu2")
"0xf8047f8063fdc7df778aa8b4379c158536ad8a25"
> personal
{
  listAccounts: ["0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7", "0xf8047f8063fdc7df778aa8b4379c158536ad8a25"],
  listWallets: [{
      accounts: [{...}],
      status: "Locked",
      url: "keystore:///home/xiaoyu/eth/keystore/UTC--2017-09-07T09-29-43.278548578Z--20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7"
  }, {
      accounts: [{...}],
      status: "Locked",
      url: "keystore:///home/xiaoyu/eth/keystore/UTC--2017-09-07T09-29-57.512583773Z--f8047f8063fdc7df778aa8b4379c158536ad8a25"
  }],
  deriveAccount: function(),
  ecRecover: function(),
  getListAccounts: function(callback),
  getListWallets: function(callback),
  importRawKey: function(),
  lockAccount: function(),
  newAccount: function github.com/ethereum/go-ethereum/console.(*bridge).NewAccount-fm(),
  sendTransaction: function(),
  sign: function github.com/ethereum/go-ethereum/console.(*bridge).Sign-fm(),
  unlockAccount: function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()
}
> miner
{
  getHashrate: function(),
  setEtherbase: function(),
  setExtra: function(),
  setGasPrice: function(),
  start: function(),
  stop: function()
}
> miner.start()
null
> miner.stop()
true
> miner.setEtherbase(personal.listAccounts[0])
true
> miner.start()
null
> personal.unlockAccount
function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()
> personal.unlockAccount(0)
first argument must be the account to unlock
> personal.unlockAccount(personal.listAccounts[0])
Unlock account 0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7
Passphrase: 
Error: could not decrypt key with given passphrase
> personal.unlockAccount(personal.listAccounts[0])
Unlock account 0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7
Passphrase: 
true
> miner.setEtherbase(personal.listAccounts[0])
true
> miner.stop()
true
> miner.start()
null
> acc0 = eth.accounts[0]
"0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7"
> eth
{
  accounts: ["0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7", "0xf8047f8063fdc7df778aa8b4379c158536ad8a25"],
  blockNumber: 0,
  coinbase: "0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7",
  compile: {
    lll: function(),
    serpent: function(),
    solidity: function()
  },
  defaultAccount: undefined,
  defaultBlock: "latest",
  gasPrice: 18000000000,
  hashrate: 0,
  mining: true,
  pendingTransactions: [],
  protocolVersion: "0x3f",
  syncing: false,
  call: function(),
  contract: function(abi),
  estimateGas: function(),
  filter: function(fil, callback),
  getAccounts: function(callback),
  getBalance: function(),
  getBlock: function(),
  getBlockNumber: function(callback),
  getBlockTransactionCount: function(),
  getBlockUncleCount: function(),
  getCode: function(),
  getCoinbase: function(callback),
  getCompilers: function(),
  getGasPrice: function(callback),
  getHashrate: function(callback),
  getMining: function(callback),
  getPendingTransactions: function(callback),
  getProtocolVersion: function(callback),
  getRawTransaction: function(),
  getRawTransactionFromBlock: function(),
  getStorageAt: function(),
  getSyncing: function(callback),
  getTransaction: function(),
  getTransactionCount: function(),
  getTransactionFromBlock: function(),
  getTransactionReceipt: function(),
  getUncle: function(),
  getWork: function(),
  iban: function(iban),
  icapNamereg: function(),
  isSyncing: function(callback),
  namereg: function(),
  resend: function(),
  sendIBANTransaction: function(),
  sendRawTransaction: function(),
  sendTransaction: function(),
  sign: function(),
  signTransaction: function(),
  submitTransaction: function(),
  submitWork: function()
}
> eth.getBalance(acc0)
0
> eth.getBalance(acc0)
0
> ehh
ReferenceError: 'ehh' is not defined
    at <anonymous>:1:1

> eth
{
  accounts: ["0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7", "0xf8047f8063fdc7df778aa8b4379c158536ad8a25"],
  blockNumber: 0,
  coinbase: "0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7",
  compile: {
    lll: function(),
    serpent: function(),
    solidity: function()
  },
  defaultAccount: undefined,
  defaultBlock: "latest",
  gasPrice: 18000000000,
  hashrate: 0,
  mining: true,
  pendingTransactions: [],
  protocolVersion: "0x3f",
  syncing: false,
  call: function(),
  contract: function(abi),
  estimateGas: function(),
  filter: function(fil, callback),
  getAccounts: function(callback),
  getBalance: function(),
  getBlock: function(),
  getBlockNumber: function(callback),
  getBlockTransactionCount: function(),
  getBlockUncleCount: function(),
  getCode: function(),
  getCoinbase: function(callback),
  getCompilers: function(),
  getGasPrice: function(callback),
  getHashrate: function(callback),
  getMining: function(callback),
  getPendingTransactions: function(callback),
  getProtocolVersion: function(callback),
  getRawTransaction: function(),
  getRawTransactionFromBlock: function(),
  getStorageAt: function(),
  getSyncing: function(callback),
  getTransaction: function(),
  getTransactionCount: function(),
  getTransactionFromBlock: function(),
  getTransactionReceipt: function(),
  getUncle: function(),
  getWork: function(),
  iban: function(iban),
  icapNamereg: function(),
  isSyncing: function(callback),
  namereg: function(),
  resend: function(),
  sendIBANTransaction: function(),
  sendRawTransaction: function(),
  sendTransaction: function(),
  sign: function(),
  signTransaction: function(),
  submitTransaction: function(),
  submitWork: function()
}
> eth.getBalance(acc0)
0
> eth
{
  accounts: ["0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7", "0xf8047f8063fdc7df778aa8b4379c158536ad8a25"],
  blockNumber: 0,
  coinbase: "0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7",
  compile: {
    lll: function(),
    serpent: function(),
    solidity: function()
  },
  defaultAccount: undefined,
  defaultBlock: "latest",
  gasPrice: 18000000000,
  hashrate: 5743,
  mining: true,
  pendingTransactions: [],
  protocolVersion: "0x3f",
  syncing: false,
  call: function(),
  contract: function(abi),
  estimateGas: function(),
  filter: function(fil, callback),
  getAccounts: function(callback),
  getBalance: function(),
  getBlock: function(),
  getBlockNumber: function(callback),
  getBlockTransactionCount: function(),
  getBlockUncleCount: function(),
  getCode: function(),
  getCoinbase: function(callback),
  getCompilers: function(),
  getGasPrice: function(callback),
  getHashrate: function(callback),
  getMining: function(callback),
  getPendingTransactions: function(callback),
  getProtocolVersion: function(callback),
  getRawTransaction: function(),
  getRawTransactionFromBlock: function(),
  getStorageAt: function(),
  getSyncing: function(callback),
  getTransaction: function(),
  getTransactionCount: function(),
  getTransactionFromBlock: function(),
  getTransactionReceipt: function(),
  getUncle: function(),
  getWork: function(),
  iban: function(iban),
  icapNamereg: function(),
  isSyncing: function(callback),
  namereg: function(),
  resend: function(),
  sendIBANTransaction: function(),
  sendRawTransaction: function(),
  sendTransaction: function(),
  sign: function(),
  signTransaction: function(),
  submitTransaction: function(),
  submitWork: function()
}
> eth.getWork()
["0x5633f236122a8300c5d597e992f18611b079bdeca6fc8069b1f949fcbbb048b6", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000040080100200400801002004008010020040080100200400801002004"]
> eth.getBlockNumber()
undefined
> eth.getMining
function(callback)
> eth.getMining()
undefined
> eth
{
  accounts: ["0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7", "0xf8047f8063fdc7df778aa8b4379c158536ad8a25"],
  blockNumber: 0,
  coinbase: "0x20becac25bc3ab00dbd6ac511c3cd4e5e54abfd7",
  compile: {
    lll: function(),
    serpent: function(),
    solidity: function()
  },
  defaultAccount: undefined,
  defaultBlock: "latest",
  gasPrice: 18000000000,
  hashrate: 7975,
  mining: true,
  pendingTransactions: [],
  protocolVersion: "0x3f",
  syncing: false,
  call: function(),
  contract: function(abi),
  estimateGas: function(),
  filter: function(fil, callback),
  getAccounts: function(callback),
  getBalance: function(),
  getBlock: function(),
  getBlockNumber: function(callback),
  getBlockTransactionCount: function(),
  getBlockUncleCount: function(),
  getCode: function(),
  getCoinbase: function(callback),
  getCompilers: function(),
  getGasPrice: function(callback),
  getHashrate: function(callback),
  getMining: function(callback),
  getPendingTransactions: function(callback),
  getProtocolVersion: function(callback),
  getRawTransaction: function(),
  getRawTransactionFromBlock: function(),
  getStorageAt: function(),
  getSyncing: function(callback),
  getTransaction: function(),
  getTransactionCount: function(),
  getTransactionFromBlock: function(),
  getTransactionReceipt: function(),
  getUncle: function(),
  getWork: function(),
  iban: function(iban),
  icapNamereg: function(),
  isSyncing: function(callback),
  namereg: function(),
  resend: function(),
  sendIBANTransaction: function(),
  sendRawTransaction: function(),
  sendTransaction: function(),
  sign: function(),
  signTransaction: function(),
  submitTransaction: function(),
  submitWork: function()
}

CustomGenesis.json

{
    "nonce": "0x0000000000000042",     "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "",     "gasLimit": "0x8000000",     "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3333333333333333333333333333333333333333",     "alloc": {     }
}

Backtrace

[backtrace]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions