Wallet

noob - 用 centos 7 設置錢包

  • December 14, 2021

嗨所以我使用以下 bash 腳本在我的 centos 伺服器上設置比特幣<https://gist.github.com/cdodd/f485b72aed8c2a6440a6141cd1ba8273?signup=true>

但是我不知道如何獲取錢包或創建錢包,每次我嘗試都會收到以下錯誤,它們不是配置文件,我不確定應該放在哪裡。有人可以幫我指出正確的方向來正確安裝比特幣並創建我自己的錢包。

謝謝

./bitcoin-cli -testnet getwalletinfo                                                        
error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not se
t.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/root/.bitcoin/bitcoin.conf)  

查看bitcoin.conf文件並查看創建 rpc 憑據的說明。模板在這裡:https ://github.com/bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf

具體來說,這裡

# If no rpcpassword is set, rpc cookie auth is sought. The default `-rpccookiefile` name
# is .cookie and found in the `-datadir` being used for bitcoind. This option is typically used
# when the server and client are run as the same user.
#
# If not, you must set rpcuser and rpcpassword to secure the JSON-RPC api. The first
# method(DEPRECATED) is to set this pair for the server and client:
#rpcuser=Ulysseys
#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
#
# The second method `rpcauth` can be added to server startup argument. It is set at initialization time
# using the output from the script in share/rpcauth/rpcauth.py after providing a username:
#
# ./share/rpcauth/rpcauth.py alice
# String to be appended to bitcoin.conf:
# rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae
# Your password:
# DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
#
# On client-side, you add the normal user/password pair to send commands:
#rpcuser=alice
#rpcpassword=DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
#
# You can even add multiple entries of these to the server conf file, and client can use any of them:
# rpcauth=bob:b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99

我沒有 CentOS,但是執行在 SuSE Linux 上,這很相似。

首先,讓我說,不建議以 root 權限執行比特幣守護程序。你可能想創建一個使用者來執行比特幣。

使用腳本安裝後,/usr/bin 中應該有三個文件(嗯,符號連結),一個是 bitcoin-cli,另一個是我們需要的 bitcoind。對於新使用者,您將打開一個終端視窗,並查看您是否可以啟動守護程序(bitcoind)。它通常會在使用者主目錄的“.bitcoin”目錄中創建一個 bitcoin.conf 文件。在此文件中,您可以設置 rpcuser 和 rpcpassword,然後將其與 bitcoin-cli 一起使用。

如果守護程序沒有啟動,系統或使用者的 ~/.bitcoin 目錄中是否有任何日誌文件?

引用自:https://bitcoin.stackexchange.com/questions/72507