日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

使用geth發(fā)送交易

  1. 啟動一個連接到節(jié)點的交互控制臺,您可以參考文檔開啟geth交互控制臺來建立一個交互控制臺

  2. 創(chuàng)建一個以太坊賬戶,如果您已經(jīng)在節(jié)點上創(chuàng)建了以太坊賬戶,可以使用已有賬戶完成后續(xù)操作

    1. // create a account that use empty password
    2. var account = personal.newAccount("");
    3. // using an existing account in node
    4. // var account = eth.accounts[0]
    5. // unlock account for 300 seconds with empty password
    6. personal.unlockAccount(account, "", 300);
    7. // set it as default account
    8. web3.eth.defaultAccount = account;
  3. 指定智能合約的地址和ABI,并發(fā)起調(diào)用。您可以參考部署智能合約中的步驟來部署智能合約,并獲取智能合約的地址和ABI。

    1. // your contract address that you want to call
    2. var address = "0x0000000";
    3. // your contarct ABI that address corresponds to
    4. var abi = [{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initVal","type":"uint256"}],"payable":false,"type":"constructor"}];
    5. var contract = eth.contract(abi).at(address)
    6. // call get method of demo contract
    7. contract.get()
    8. // call set method of demo contract, and create a new transaction
    9. contract.set(999)