Monero 核心 (CLI 命令列介面) 教學
Monero 錢包管理程式 (monero-wallet-cli) 是包含在 Monero 核心內的一個指令介面應用程式。比特幣錢包同時管理錢包帳戶及區(qū)塊鏈同步資料,而在Monero 則是將這兩個工作分為兩支程式:區(qū)塊鏈同步程式(monerod)負責處理區(qū)塊鏈,錢包管理程式(monero- wallet-cli)負責處理錢包帳戶。
此份教學將會示范數(shù)種monero-wallet-cli的操作,此份教學是基于版本 0.10.1的 Monero 核心制作。
創(chuàng)建錢包
必須先執(zhí)行區(qū)塊鏈同步程式(monerod)建立節(jié)點后讓它繼續(xù)在一旁執(zhí)行
monerd尚未完成同步前,錢包無法看到正確的余額
找到 Monero 核心的 monero-wallet-cli 程式并執(zhí)行它,會看到以下畫面:
C:\monero>monero-wallet-cli.exe
Monero 'Wolfram Warptangent' (v0.10.1.0-release)
Logging at log level 0 to C:\monero\monero-wallet-cli.log
Specify wallet file name (e.g., MyWallet). If the wallet doesn't exist, it will be created.
Wallet file name (or Ctrl-C to quit):
輸入錢包的帳戶名稱(以 lafudoci 舉例),即會顯示是否新增錢包帳戶
No wallet found with that name. Confirm creation of new wallet named: lafudoci
(Y/Yes/N/No): Y
輸入 Y 表示確認后,需要為錢包帳戶設定密碼,重復一次確認 接著會列出種子碼的語言選擇
Enter a password for your new wallet: **********
Confirm Password: **********
List of available languages for your wallet's seed:
0 : English
1 : Spanish
2 : German
3 : Italian
4 : Portuguese
5 : Russian
6 : Japanese
Enter the number corresponding to the language of your choice:
通常選擇英語,于是輸入0,程式開始產生錢包,然后顯示錢包位址,唯讀金鑰
Generated new wallet: 41hWvBz1BkcKojvdrnjvfUCpFkTLfGiqoPjbL49YwdhMQSNPM97ZRvP48r79TuLSWSf8Q6LyKXWtc8M8ogZkF1DpK58sCau
View key:
還有最重要的:由 25 個英文單字組成的種子碼(seed)
Your wallet has been generated!
To start synchronizing with the daemon, use "refresh" command.
Use "help" command to see the list of available commands.
Always use "exit" command when closing monero-wallet-cli to save your
current session's state. Otherwise, you might need to synchronize
your wallet again (your wallet keys are NOT at risk in any case).
PLEASE NOTE: the following 25 words can be used to recover access to your wallet
. Please write them down and store them somewhere safe and secure. Please do not
store them in your email or on file storage services outside of your immediate
control.
visited fidget irritate kernels oval trendy tirade orchid
anvil oaks calamity damp nasty comb criminal cause
luxury gymnast uncle arises uncle remedy dusted each luxury
重要步驟!
visited fidget irritate kernels oval trendy tirade orchid
anvil oaks calamity damp nasty comb criminal cause
luxury gymnast uncle arises uncle remedy dusted each luxury
請抄寫上面剛剛在您的畫面產生的25字種子碼組成的種子碼(seed)。
千萬不可泄漏此份種子碼且請確保這組文字被??安全的備份
萬一遺失了這份種子碼,您將無法回復您的帳戶
若這份種子碼泄漏或被盜取,獲得此份種子碼的人將可以取得這份的錢包完整的控制權
錢包的種子碼無法改變,若您的種子碼資訊被竊取或其他原因而泄漏,您將需要另外創(chuàng)建新的錢包帳戶
把種子碼泄漏的錢包資金轉移至新的錢包,并繼續(xù)妥善保管新的種子碼資訊
接著錢包會從區(qū)塊鏈里掃描更新您的資金余額
Starting refresh...
Height 269922 / 1209934
過一段時間更新完成后您將可看見您的錢包余額(balance)
Refresh done, blocks received: 1
Balance: 0.000000000000, unlocked balance: 0.000000000000
Background refresh thread started
收款操作
在上一個步驟產生的錢包位址將會存放在 Monero 核心的資料夾內,附檔名為.address,以記事本開啟后即可獲得錢包的位址
以此份范例產生的位址為以下的格式字串
41hWvBz1BkcKojvdrnjvfUCpFkTLfGiqoPjbL49YwdhMQSNPM97ZRvP48r79TuLSWSf8Q6LyKXWtc8M8ogZkF1DpK58sCau
將錢包位址提供給支付方即可開始等待對方付款至錢包內。
對方付款后在錢包畫面中輸入 refresh 會更新錢包的余額,交易確認等待時間通常只會需要數(shù)分鐘的時間。
付款操作
使用 transfer 指令如下格式
transfer (混幣數(shù)量) 收款方錢包位址 金額 (付款ID)
混幣數(shù)量(mixin):可不填,預設為4,數(shù)字指定得越高能使得此次交易的資訊越難被追蹤,相對的手續(xù)費也會高一些。
付款ID(Payment ID):若為轉帳至交易所則此項必填,否則交易所會無法辨識而讓您損失這筆資金!
金額 (amount):金額單位為XMR。
以下為簡易的發(fā)送1XMR至另一個錢包的范例,在錢包中輸入:
transfer 45RByKZ4n3qHecCcTLH9poJyPAQLuYGEDVtBEEnyhwPYBHquxPZ1kNCGMiee8iHm6yQM6u8pDZRQfDYnTz9Cdf6fCLmJSV8 1
程式會提示是否需要付款ID888開獎網及計算手續(xù)費,輸入Y確認。
No payment id is included with this transaction. Is this okay? (Y/Yes/N/No): Y
Sending 1.000000000000. The transaction fee is 0.006000000000.
Is this okay? (Y/Yes/N/No): Y
如此交易就成功發(fā)送出去了,交易確認等待時間通常只會需要數(shù)分鐘的時間。
Money successfully sent, transaction <61b48eb889285172ba1062fd726f393d6b1aa7d6d916a4a0420e0cc5379a8783>
很好,剛剛的范例地址就是本篇教學作者的贊助位址,謝謝您的贊助!我會繼續(xù)努力的!
什么?你說你剛剛沒有真的送出交易?這...無論如何我還是會繼續(xù)努力的 (淚)
再次登入
確保您的monerod有在正在執(zhí)行
只需要在執(zhí)行monero-wallet-cli后輸入您的使用者名稱及密碼即可登入錢包。
其他功能
在錢包畫面中輸入help,即可參閱其他功能的說明。
Commands:
address Show current wallet public address
balance Show current wallet balance
bc_height Show blockchain height
check_tx_key Check amount going to <address> in <txid>
export_key_images Export a signed set of key images
export_outputs Export a set of outputs owned by this wallet
get_tx_key Get transaction key (r) for a given <txid>
get_tx_note Get a string note for a txid
help Show this help
import_key_images Import signed key images list and verify their spent status
import_outputs Import set of outputs owned by this wallet
incoming_transfers incoming_transfers [available|unavailable] - Show incoming transfers, all or filtered by availability