web3j通過命令列工具新建錢包、更新錢包密碼及轉賬
阿新 • • 發佈:2019-02-10
生成一個新的以太坊錢包:
$ web3j wallet create
更新現有錢包的密碼:
$ web3j wallet update <walletfile>
將以太幣傳送到另一個地址:
$ web3j wallet send <walletfile> 0x<address>|<ensName>
當把以太幣Ether傳送到另一個地址時,在交易發生之前,你會被問到一系列問題。見下面的完整示例:
下面的例子演示如何使用web3j傳送以太幣Ether到另一個錢包。
$ ./web3j-<version>/bin/web3j wallet send <walletfile> 0x<address>|<ensName>
_ _____ _ _
| | |____ (_) (_)
__ _____| |__ / /_ _ ___
\ \ /\ / / _ \ '_ \ \ \ | | | / _ \
\ V V / __/ |_) |.___/ / | _ | || (_) |
\_/\_/ \___|_.__/ \____/| |(_)|_| \___/
_/ |
|__/
Please enter your existing wallet file password:
Wallet for address 0x19e03255f667bdfd50a32722df860b1eeaf4d635 loaded
Please confirm address of running Ethereum client you wish to send the transfer request to [ http://localhost:8545/]:
Connected successfully to client: Geth/v1.4.18-stable-c72f5459/darwin/go1.7.3
What amound would you like to transfer (please enter a numeric value): 0.000001
Please specify the unit (ether, wei, ...) [ether]:
Please confim that you wish to transfer 0.000001 ether (1000000000000 wei) to address 0x9c98e381edc5fe1ac514935f3cc3edaa764cf004
Please type 'yes' to proceed: yes
Commencing transfer (this may take a few minutes)...................................................................................................................$
Funds have been successfully transferred from 0x19e03255f667bdfd50a32722df860b1eeaf4d635 to 0x9c98e381edc5fe1ac514935f3cc3edaa764cf004
Transaction hash: 0xb00afc5c2bb92a76d03e17bd3a0175b80609e877cb124c02d19000d529390530
Mined block number: 1849039
另外推薦幾個很受歡迎全網稀缺的互動教程: