Blockchain API

From BlockChainTeleCom wiki
Revision as of 09:53, 28 March 2018 by Smaltsev (talk | contribs) (Examples:)
Jump to: navigation, search

Examples of calls with recommended parameters.

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


I. Wallet access

is_locked
no params

unlock

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

II. 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.

II.1 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.