Avatar
0
monkey Enlightened
monkey Enlightened
Tạo tài khoản ethereum cho dev
  1. Để tạo tài khoản ethereum qua HTTP bạn có thể dùng câu lệnh này:
    curl --location --request POST 'http://localhost:8545/' 
    --header 'Content-Type: application/json' 
    --data-raw '{
        "jsonrpc":"2.0",
        "method":"personal_newAccount",
        "params":["password"],
        "id":1
    }'
    
tại đây
.
  1. Sau khi tạo tài khoản xong thì thông tin tài khoản sẽ nằm tại thư mục:
    ~/.ethereum
trên Linux
~/Library/Ethereum
trên MacOS X
~/AppData/Roaming/Ethereum
trên Windows
tại đây
Nếu bạn không muốn dùng curl, bạn có thể sử dụng geth console:
  1. khởi động geth console, chạy lệnh: <code>geth attach http://127.0.0.1:8543</code>
  2. chạy lệnh tạo tài khoản trên geth console: <code>personal.newAccount('mật khẩu của bạn')</code>
  3. chạy lệnh unlock tài khoản (tuỳ chọn): <code>personal.unlockAccount('tài khoản vừa tạo', "mật khẩu")</code>
  • Answer
blockchain ethereum
Remain: 5
1 Answer
Avatar
monkey Enlightened
monkey Enlightened
Sharing
  • 0
  • Reply