ethereumwalletmetamask

Ethereum : Am I mining to my correct wallet address?


I'm trying to start Ethereum, so I created my wallet first using metamask and I added to geth using private key with this command.

geth account import private_key.txt

After that I run the mining command using geth --mine, so my question is : am I really mining to my correct wallet ?


Solution

  • OPTION 1: You can set the account your Ethereum miner mines to by running the following in the geth console:

    miner.setEtherbase('yourethaddress')
    

    You can also set a local address to mine to using:

    miner.setEtherbase(eth.accounts[2])
    

    Replace '2' with the number of your account.

    OPTION 2: When starting your geth node you can use the --etherbase flag.

    geth --rpc --etherbase 0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10
    

    Using your ETH public address.

    More information here: https://geth.ethereum.org/docs/interface/mining