1

I created a testnet to allow faster smart contract testing (I don't want to use Truffle for now). My genesis file is

{
    "config": {
        "chainId": 15,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "difficulty": "200000000",
    "gasLimit": "2100000",
    "alloc": {
        "7ca3a0da3345506f15c603eba011c8f354155ee9": { "balance": "400000000000000000000000000" }
    }
}

It is based on this tutorial. I am starting geth with

geth --identity "test" --rpc --rpcport "8545" --rpccorsdomain "*" --datadir ~/Desktop/private/datadir --port "30303" --nodiscover --rpcapi "db,eth,net,web3,personal" --networkid 1999 --mine --minerthreads=1 --etherbase=0x7ca3a0da3345506f15c603eba011c8f354155ee9 --unlock="0x7ca3a0da3345506f15c603eba011c8f354155ee9" console

I then created a new account and sent 1 ETH from 0x7ca3a0da3345506f15c603eba011c8f354155ee9 to my new account getting the following message as confirmation.

> INFO [07-31|22:46:56] New wallet appeared                      url=keystore:///Users/mcansado… status=Locked
INFO [07-31|22:46:56] Submitted transaction                    fullhash=0x46b9c5c2a739a0e314d74b53158475b1686a196670d58a948332d3cdacf92d4b recipient=0x1918ced27804f6b83acf0587a81e9f56020620d1
INFO [07-31|22:47:29] Successfully sealed new block            number=2 hash=698a9b…8acfe8
INFO [07-31|22:47:29] 🔨 mined potential block                  number=2 hash=698a9b…8acfe8
INFO [07-31|22:47:30] Commit new mining work                   number=3 txs=1 uncles=0 elapsed=47.741ms

But the balance in the new account does not change. What am I doing wrong?

3
  • Hey I dont exactly know the reason but i think the account is locked. When I use testnet and I create a new account the accounts are locked
    – 11t
    Aug 1, 2017 at 5:20
  • It is not because I pass it the --unlock flag when I'm starting geth
    – mcansado
    Aug 1, 2017 at 7:30
  • when you create that account with geth new account it asks you for a password. You put that password in a txt file and that, like Richard said below you need to pass it with --password "your_password_file.txt"
    – OWADVL
    Nov 1, 2018 at 7:59

1 Answer 1

1

Your account is still locked.

It is not because I pass it the --unlock flag when I'm starting geth

In the command you've used to start geth, you pass the --unlock flag with the account address you want to unlock. You don't, however, pass the --password option. This isn't a problem in itself, because not passing the --password flag just means you'll be prompted for the password. However, you also start in console mode, which seems to cause the password prompt to be lost.

The result is shown in the first line of you second snippit: the account is still locked.

INFO [07-31|22:46:56] New wallet...  url=keystore:///Users/mcansado… status=Locked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.