Difference between revisions of "Cloakcoin API/vi"

From CloakCoin Wiki
Jump to: navigation, search
(Created page with " Cloakcoin API")
 
(Updating to match new version of source page)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''CloakCoin provides a remote procedure call (RPC) interface for various administrative tasks, wallet operations, and queries about network and block chain data.'''
+
'''CloakCoin cung cấp giao diện gọi thủ tục từ xa (RPC) cho nhiều tác vụ quản trị khác nhau, hoạt động ví và truy vấn về dữ liệu blockchain và mạng.'''
  
If you start CloakCoin using cloakcoind, the RPC interface is enabled by default.
+
Nếu bạn khởi tạo CloakCoin bằng cloakcoind, giao diện RPC được thiết lập theo mặc định.
  
You can control cloakcoind by JSON-RPC commands.
+
Bạn có thể kiểm soát cloakcoind bằng lệnh JSON-RPC.
  
The program gets is settings from cloakcoin.conf in the CloakCoin application directory:
+
Chương trình được cài đặt từ cloakcoin.conf trong thư mục ứng dụng CloakCoin:
  
 
<code>$HOME/.bitcoin/</code>
 
<code>$HOME/.bitcoin/</code>
  
The interface requires the user to provide a password for authenticating RPC requests.
+
Giao diện yêu cầu người dùng cung cấp mật khẩu để xác thực các yêu cầu RPC.
  
This password can be set in cloakcoin.conf, create the cloakcoin.conf configuration file and set an rpcuser and rpcpassword to secure the JSON-RPC API.
+
Mật khẩu này có thể được thiết lập trong cloakcoin.conf, tạo tệp cấu hình cloakcoin.conf và cài đặt rpcuser rpcpassword để bảo mật API JSON-RPC.
  
cloakcoin.conf example:
+
Ví dụ cloakcoin.conf:
  
 
<code>
 
<code>
Line 22: Line 22:
 
</code>
 
</code>
  
By default the service is bound to port 29662 you can change it in cloakcoin.conf with the:
+
Theo mặc định, dịch vụ được kết nối với cổng 29662, bạn có thể thay đổi nó trong cloakcoin.conf bằng:
  
 
<code>rpcport=new_port_here</code>
 
<code>rpcport=new_port_here</code>
  
To start run:
+
Để khởi động:
  
 
<code>$./cloakcoind -daemon</code>
 
<code>$./cloakcoind -daemon</code>
  
If you are learning the API, it is a very good idea to use the test network.
+
Nếu bạn biết API, bạn nên sử dụng mạng thử nghiệm.
  
 
<code>cloakcoind -testnet</code>
 
<code>cloakcoind -testnet</code>
  
=== CloakCoin - RPC Commands ===
+
=== CloakCoin - Lệnh RPC ===
 
<br>
 
<br>
 
::<code>help [command]</code>
 
::<code>help [command]</code>
List commands, or get help for a command.
+
Danh sách lệnh, hoặc trợ giúp lệnh.
  
  
Line 65: Line 65:
  
 
::<code>setgenerate <generate> [genproclimit]</code>
 
::<code>setgenerate <generate> [genproclimit]</code>
<generate> is true or false to turn mining on or off.
+
<generate>is true or false to turn mining on or off.
  
 
Generation is limited to [genproclimit] processors, -1 for unlimited.
 
Generation is limited to [genproclimit] processors, -1 for unlimited.
Line 96: Line 96:
 
::<code>setaccount <CloakCoinaddress> <account></code>
 
::<code>setaccount <CloakCoinaddress> <account></code>
 
Sets the account associated with the given address.
 
Sets the account associated with the given address.
 
  
 
::<code>getaccount <CloakCoinaddress></code>
 
::<code>getaccount <CloakCoinaddress></code>
Line 145: Line 144:
  
 
::<code>listreceivedbyaccount [minconf=1] [includeempty=false]</code>
 
::<code>listreceivedbyaccount [minconf=1] [includeempty=false]</code>
[minconf] is the minimum number of confirmations before payments are included.
+
[minconf]is the minimum number of confirmations before payments are included.
  
 
[includeempty] whether to include accounts that haven't received any payments.
 
[includeempty] whether to include accounts that haven't received any payments.
Line 207: Line 206:
 
<amount> is a real and is rounded to the nearest 0.000001
 
<amount> is a real and is rounded to the nearest 0.000001
  
coins can be anonymized via Enigma by appending :posa to the account name, which will cloak the address you sent them from.
+
Coins can be anonymized via Enigma by appending :posa to the account name, which will cloak the address you sent them from.
  
 
requires wallet passphrase to be set with walletpassphrase first
 
requires wallet passphrase to be set with walletpassphrase first
 +
 +
 +
 +
[[File:C0.png|center]]
 +
<div style="text-align: center;">Không Hạn chế Bản quyền</div>

Latest revision as of 23:49, 5 December 2018

CloakCoin cung cấp giao diện gọi thủ tục từ xa (RPC) cho nhiều tác vụ quản trị khác nhau, hoạt động ví và truy vấn về dữ liệu blockchain và mạng.

Nếu bạn khởi tạo CloakCoin bằng cloakcoind, giao diện RPC được thiết lập theo mặc định.

Bạn có thể kiểm soát cloakcoind bằng lệnh JSON-RPC.

Chương trình được cài đặt từ cloakcoin.conf trong thư mục ứng dụng CloakCoin:

$HOME/.bitcoin/

Giao diện yêu cầu người dùng cung cấp mật khẩu để xác thực các yêu cầu RPC.

Mật khẩu này có thể được thiết lập trong cloakcoin.conf, tạo tệp cấu hình cloakcoin.conf và cài đặt rpcuser và rpcpassword để bảo mật API JSON-RPC.

Ví dụ cloakcoin.conf:

rpcuser=bitcoind

rpcpassword=change_this_to_a_long_random_password

Theo mặc định, dịch vụ được kết nối với cổng 29662, bạn có thể thay đổi nó trong cloakcoin.conf bằng:

rpcport=new_port_here

Để khởi động:

$./cloakcoind -daemon

Nếu bạn biết API, bạn nên sử dụng mạng thử nghiệm.

cloakcoind -testnet

CloakCoin - Lệnh RPC


help [command]

Danh sách lệnh, hoặc trợ giúp lệnh.


stop <detach>

<detach> is [true] to detach the database, [false] to stop only Stop CloakCoin server (and possibly override the detachdb config value).


getblockcount

Returns the number of blocks in the longest block chain.


getconnectioncount

Returns the number of connections to other nodes.


getpeerinfo

Returns data about each connected network node.


getdifficulty

Returns the difficulty as a multiple of the minimum difficulty.


getgenerate

Returns true or false to indicate if currently mining.


setgenerate <generate> [genproclimit]

<generate>is true or false to turn mining on or off.

Generation is limited to [genproclimit] processors, -1 for unlimited.


gethashespersec

Returns a recent hashes per second performance measurement while generating.


getinfo

Returns an object containing various state info.


getmininginfo

Returns an object containing mining-related information.


getnewaddress [account]

Returns a new CloakCoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].


getnewpubkey [account]

Returns new public key for coinbase generation.


getaccountaddress <account>

Returns the current CloakCoin address for receiving payments to this account.


setaccount <CloakCoinaddress> <account>

Sets the account associated with the given address.

getaccount <CloakCoinaddress>

Returns the account associated with the given address.


getaddressesbyaccount <account>

Returns the list of addresses for the given account.


sendtoaddress <CloakCoinaddress> <amount> [comment] [comment-to] [narration]

<amount> is a real and is rounded to the nearest 0.000001

coins can be anonymized via Enigma by appending :posa to the destination address, which will cloak the address you sent them from.

requires wallet passphrase to be set with walletpassphrase first


sendcloakedtoaddress <CloakCoinaddress> <amount> [numCloakers] [timeoutMins] [comment] [comment-to]

<amount> is a real and is rounded to the nearest 0.000001

requires wallet passphrase to be set with walletpassphrase first.


getreceivedbyaddress <CloakCoinaddress> [minconf=1]

Returns the total amount received by <CloakCoinaddress> in transactions with at least [minconf] confirmations.


getreceivedbyaccount <account> [minconf=1]

Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.


listreceivedbyaddress [minconf=1] [includeempty=false]

[minconf] is the minimum number of confirmations before payments are included.

[includeempty] whether to include addresses that haven't received any payments.

Returns an array of objects containing:

"address" : receiving address

"account" : the account of the receiving address

"amount" : total amount received by the address

"confirmations" : number of confirmations of the most recent transaction included


listreceivedbyaccount [minconf=1] [includeempty=false]

[minconf]is the minimum number of confirmations before payments are included.

[includeempty] whether to include accounts that haven't received any payments.

Returns an array of objects containing:

"account" : the account of the receiving addresses

"amount" : total amount received by addresses with this account

"confirmations" : number of confirmations of the most recent transaction included


backupwallet <destination>

Safely copies wallet.dat to destination, which can be a directory or a path with filename.


keypoolrefill

Fills the keypool.

requires wallet passphrase to be set with walletpassphrase first


walletpassphrase <passphrase> <timeout> [mintonly]

Stores the wallet decryption key in memory for <timeout> seconds.

mintonly is optional true/false allowing only block minting.


walletpassphrasechange <oldpassphrase> <newpassphrase>

Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.


walletlock

Removes the wallet encryption key from memory, locking the wallet.

After calling this method, you will need to call walletpassphrase again

before being able to call any methods which require the wallet to be unlocked.


validateaddress <CloakCoinaddress>

Return information about <CloakCoinaddress>.


validatepubkey <CloakCoinpubkey>

Return information about <CloakCoinpubkey>.


getbalance [account] [minconf=1]

If [account] is not specified, returns the server's total available balance.

If [account] is specified, returns the balance in the account.


move <fromaccount> <toaccount> <amount> [minconf=1] [comment]

Move from one account in your wallet to another.


sendfrom <fromaccount>[:posa] <toCloakCoinaddress> <amount> [minconf=1] [comment] [comment-to] [narration]

<amount> is a real and is rounded to the nearest 0.000001

Coins can be anonymized via Enigma by appending :posa to the account name, which will cloak the address you sent them from.

requires wallet passphrase to be set with walletpassphrase first


C0.png
Không Hạn chế Bản quyền