geth账户管理转账

参考http://blog.csdn.net/CHENYUFENG1991/article/details/53458175?locationNum=7&fps=1

进入geth
geth –identity “newEth” –rpc –rpccorsdomain “*” –datadir “./cdata” –port 30303 –rpcapi “db,
eth,net,web3” –networkid 999 –dev console 2>> geth.log



创建账号

eth.accounts
[“0x9a647332df73cf582fce51ac2b2551d110218040”]
personal.newAccount(‘123456’)
“0xa0e8cf6b1b9b3e2638e823ff4c56ccbb2daf1dc7”
eth.accounts
[“0x9a647332df73cf582fce51ac2b2551d110218040”, “0xa0e8cf6b1b9b3e2638e823ff4c56ccbb2daf1dc7”]
user1=eth.accounts[0]
“0x9a647332df73cf582fce51ac2b2551d110218040”
user2=eth.accounts[1]
“0xa0e8cf6b1b9b3e2638e823ff4c56ccbb2daf1dc7”
geth.start()

对账户命名```
 usr1=eth.accounts[0]
"0x414d9703aa1c26115dc2cdabe225db3bedc7a91f"
> usr2=eth.accounts[1]
"0x2b08b524d7b8e6190f07d30c0e45dd1971437264"
查账户余额

> eth.getBalance(usr1)
0
> eth.getBalance(usr2)
0

`解锁``
personal.unlockAccount('0x414d9703aa1c26115dc2cdabe225db3bedc7a91f','123456',99999)
true
personal.unlockAccount('0x414d9703aa1c26115dc2cdabe225db3bedc7a91f','123456',9999
personal.unlockAccount('0x2b08b524d7b8e6190f07d30c0e45dd1971437264','123456',99999)
true

转账

> {a91f', to:'0x2b08b524d7b8e6190f07d30c0e45dd1971437264', gas:31000, 'gasPrice': web3.toWei(300, 'gwei'), "value": "0106112"})
"0xab91efde983182ebf6f19d595c67a47297c0af2f875a520679609744771f2d51"

查看状态,有没有没有放在区块的交易

txpool.status

给test赋值ABI
> test = eth.contract(abi).at('0xe366a3ff1c087362ed8f91733b0acf7705dcac76')
{
  abi: [{
      constant: false,
      inputs: [{...}],
      name: "multiply",
      outputs: [{...}],
      payable: false,
      type: "function"
  }],
  address: "0xe366a3ff1c087362ed8f91733b0acf7705dcac76",
  transactionHash: null,
  allEvents: function(),
  multiply: function()户
0x414d9703aa1c26115dc2cdabe225db3bedc7a91f", "0x2b08b524d7b8e6190f07d30c0e45dd1971437264"]

你可能感兴趣的:(以太坊)