Delegates public key from the specified certificate or the Locked Token Delegated Key Order (LTDKO) in the network. Payment is made with a specified amount of delegated tokens (m-tokens).

CLI Example

Command syntax:

srv_stake delegate 
{[-cert <pub_cert_name> | -pkey <pkey> -sign_type <sign_type>] -value <datoshi> | -order <order_hash> {[-tax_addr <wallet_addr_for_tax_collecting>] | -cert <priv_cert_name> [-node_addr <for_validator_node>]}} 
-net <net_name> 
-w <wallet_name> 
-fee <value>

Options:

Common parameters:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-w - name of the wallet
-fee - validator's commission

Case 1: if you want to delegate m-tokens using your public certificate or public key

-cert - name of the public certificate 
-value - m-tokens sum (in datoshi) which is used for key delegation
or
-pkey - hash of the certificate
-sign_type - type of signature (for example "sig_dil")
-value - m-tokens sum (in datoshi) which is used for key delegation

Case 2: you have a hash of the validator or staker order to delegate m-tokens

-order - hash of the order (validator or staker)
validator order:
-tax_addr - wallet address for tax collecting (optional)
staker order:
-cert - name of the staker's private certificate for delegation
-node_addr - address of the node which will be participated in consensus (optional)

Example:

Command:

cellframe-node-cli srv_stake delegate 
-cert mastercert 
-net foobar 
-w foobar_root_0 
-value 10.0e+18 
-node_addr ABCD::0000::0000::0000 
-fee 5.0e+18

Response:

SAVE TO TAKE ===>>> Stake transaction 0xC026FF57F4CCD376B6E00C1DE842988B9DD3F1366B61DBBE28ADFE272391C7C4 has done

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"srv_stake", "params":["srv_stake;delegate;-cert;mastercert;-net;foobar;-w;foobar_root_0;-value;10.0e+18;-node_addr;ABCD::0000::0000::0000;-fee;5.0e+18"], "id":"1"}'

Response:


"type": 0,
"result": "SAVE TO TAKE ===>>> Stake transaction 0x6253453196BB5CEEA7CAF1E7C4D5B45608442881555850A741FB831E413DC84A has done",
"errors": null,
"id": 1
}