2016-07-24 87 views
3

只是櫃面你不確定我說的是圖書館的.. Click Here如何使用BitcoinLib創建新地址?

基本上我試圖創建一個在線錢包服務,但是我在努力瞭解新地址我的錢包內使用產生的。

我想爲我的錢包在命令上創建新的地址,這怎麼可能使用這個庫?沒有任何功能似乎返回任何類型的地址供使用。

+0

提防,該庫不再開源:HTTPS ://github.com/GeorgeKimionis/BitcoinLib/commit/577d91b98c23180955b4b719144c43c921abc1b0#diff-9879d6db96fd29134fc802214163b95a – knocte

回答

1

對於這個特定的庫,假設你的設立工作,你可以使用GetNewAddress

IBitcoinService BitcoinService = new BitcoinService(); 
    String address = BitcoinService.GetNewAddress(); 
0

鏈接到的庫/包裝需要您運行完整節點並通過內置的JSON RPC調用進行通信。你在系統上運行完整的同步版本的比特幣嗎?

如果你已經有一個運行,你應該只需要設置你的bitcoin.conf文件設置一個RPC用戶和PW。

rpcuser=someusername 
rpcpassword=somepassword 
daemon=1 
keypool=10000 
prune=600 //pruning is optional but will take up a lot less disk space 
maxuploadtarget=20 //optional limits total upload bandwidth 
maxconnections=16 //optional limits total amount of peers that can connect 

我不知道C#,但我認爲有在包裝,讓您發送JSON RPC命令的地方。

喜歡的東西:(再說一遍,我不知道C#這只是一個猜測它可能是什麼樣子)

BitcoinRPC b = new BitcoinRPC(new Uri("http://127.0.0.1:8332"), new NetworkCredential("rpcuser", "rpcpass")); 

一旦連接你只需發送JSON-RPC的命令。比特幣的RPC命令開發者參考(https://bitcoin.org/en/developer-reference#wallet-rpcs

var newAddy = b.getNewAddress("label");