> personal.newAccount("1234")
"0xc9228294cc6bc3e3fcdba0f5d393d68f920c7789"
> personal.newAccount("1234")
"0x5f0880e6c3507f609548732151a99f6ddc71cb95"
{
"alloc": {
"0xc9228294cc6bc3e3fcdba0f5d393d68f920c7789": {
"balance": "999000000000000000000"
}
},
"config":{
"chainId":10,
"homesteadBlock":0,
"eip155Block":0,
"eip158Block":0
},
"nonce":"0x0000000000000042",
"mixhash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x2000",
"alloc": {},
"coinbase":"0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "",
"gasLimit":"0xffffffff"
}
注意:你需要修改上述alloc中的帐户地址,要用你自己机器上第一步骤中实际创建的帐户地址。
别看balance值有很多0,其实只有999个以太币。
> eth.accounts
["0xc9228294cc6bc3e3fcdba0f5d393d68f920c7789", "0x5f0880e6c3507f609548732151a99f6ddc71cb95"]
> eth.getBalance(eth.accounts[0])
999000000000000000000
> web3.fromWei(eth.getBalance(eth.accounts[0]))
999
> a0=eth.accounts[0]
"0xc9228294cc6bc3e3fcdba0f5d393d68f920c7789"
> a1=eth.accounts[1]
"0x5f0880e6c3507f609548732151a99f6ddc71cb95"
> personal.unlockAccount(a0,"1234")
true
> eth.sendTransaction({from:a0, to:a1, value:web3.toWei(10,"ether")})
INFO [03-25|23:30:40] Submitted transaction fullhash=0x701113bdeaa9b14d424babf8d
x5f0880E6c3507F609548732151a99F6dDc71Cb95
"0x701113bdeaa9b14d424babf8df19852d26e9f23198aa5d7cd2c092581f666468"
> eth.getBalance(a0)
999000000000000000000
> eth.getBalance(a1)
0
> INFO [03-25|23:36:30] Successfully sealed new block number=1 hash=232457…18534b
INFO [03-25|23:36:30]