Difference between revisions of "Blockchain API"

From BlockChainTeleCom wiki
Jump to: navigation, search
(Wallet access)
Line 13: Line 13:
 
params:
 
params:
 
{| class="wikitable" style="color:black; background-color:#FFFFFF; width:500px; cellpadding="10"
 
{| class="wikitable" style="color:black; background-color:#FFFFFF; width:500px; cellpadding="10"
|'''password'''
+
|''password''
 
|local password to unlock wallet and get access to the encrypted private keys needed for signing transaction
 
|local password to unlock wallet and get access to the encrypted private keys needed for signing transaction
 
|}
 
|}
Line 44: Line 44:
 
* Create witness – other participants will be able to vote for your account; after successful voting account will be able to validate blockchain blocks
 
* Create witness – other participants will be able to vote for your account; after successful voting account will be able to validate blockchain blocks
 
* Create committee member - - other participants will be able to vote for your account; after successful voting you will be able to propose changes to blockchain parameters and vote for proposals of other committee members.
 
* Create committee member - - other participants will be able to vote for your account; after successful voting you will be able to propose changes to blockchain parameters and vote for proposals of other committee members.
 +
 +
'''upgrade_account''' ''(string name, bool broadcast)''
 +
 +
params:
 +
{| class="wikitable" style="color:black; background-color:#FFFFFF; width:500px; cellpadding="10"
 +
|''name''
 +
|the name or id of the account to upgrade
 +
|-
 +
|''broadcast''
 +
|true to broadcast the transaction on the network
 +
|}
 +
 +
==== Example ====
 +
 +
''curl --data '{"jsonrpc": "2.0", "method": "upgrade_account", "params": ["supertelecom", "true"], "id": 1}' http://127.0.0.1:1227/rpc''

Revision as of 10:05, 28 March 2018

Examples of calls with recommended parameters.

Commands must be sent to cli_wallet port if not specified otherwise.


Wallet access

is_locked
no params

unlock (string password)

params:

password local password to unlock wallet and get access to the encrypted private keys needed for signing transaction

lock
no params

Examples

curl --data '{"jsonrpc": "2.0", "method": "is_locked", "params": [], "id": 1}' http://127.0.0.1:1227/rpc

curl --data '{"jsonrpc": "2.0", "method": "unlock", "params": ["MySuperSecretPassword"], "id": 1}' http://127.0.0.1:1227/rpc

curl --data '{"jsonrpc": "2.0", "method": "lock", "params": [], "id": 1}' http://127.0.0.1:1227/rpc

Account creation and initial configuration

To create a new account, one need to ask an owner of another account (registrar) with appropriate permissions (account must be upgraded) to register new account in the blockchain.

The following steps must be performed:

  1. Upgrade account of registrar if necessary (done by registrar account owner)
  2. Generate new public and private keys. Backup generated keys and keep them securely. There are no ways to restore access to your accounts and your funds if your private key is lost or leaked.
  3. Send public key (never send private key!) and desired account name to registrar
  4. Register new account and notify owner of new account that registration was successfully completed (done by registrar account owner)
  5. Import private key into your wallet. After that you will get a full control over your newly created account.

Account upgrading

Upgrading must be done once per account. After upgrading the following additional functions are available:

  • Register other accounts
  • Create witness – other participants will be able to vote for your account; after successful voting account will be able to validate blockchain blocks
  • Create committee member - - other participants will be able to vote for your account; after successful voting you will be able to propose changes to blockchain parameters and vote for proposals of other committee members.

upgrade_account (string name, bool broadcast)

params:

name the name or id of the account to upgrade
broadcast true to broadcast the transaction on the network

Example

curl --data '{"jsonrpc": "2.0", "method": "upgrade_account", "params": ["supertelecom", "true"], "id": 1}' http://127.0.0.1:1227/rpc