-
-
Notifications
You must be signed in to change notification settings - Fork 11
Available Commands
Table of contents:
These commands refer to CLI way of interaction. You can use an alternative way, JSON RPC.
To understand how commands work in general, see Running commands in Adamant-console.
Interacting with ADAMANT accounts.
Command can be executed as account new
, it doesn't require any options.
It creates new ADAMANT account and provide account data in JSON format.
Account is created locally, and passPhrase/ privateKey created locally. It is safe.
account new
No options or parameters are available.
adm account new
Answer example:
{
"success": true,
"account": {
"address": "U17503614588421099901",
"passPhrase": "shift credit run sea order flower tribe invest march govern blanket absorb",
"publicKey": "d4934ceb46d7325c29df3723d3d7191387d417f43ecd3d235e7cda002161e98b",
"privateKey": "414006a9af3cc4d97c3cb329c0abaabc70a6c234f6c1145b92f924987d2dbd17d4934ceb46d7325c29df3723d3d7191387d417f43ecd3d235e7cda002161e98b"
}
}
Client (ADAMANT-console) related commands.
To get current client version, you can use client version
command. Return data is in JSON format.
client version
adm client version
Answer example:
{
"success": true,
"version": "1.4.0"
}
Delegates related commands.
To register user account as delegate, you can use delegate new
command.
It registers new ADAMANT delegate, if user has enough tokens (the registration fee) on account. Return data is in JSON format.
delegate new <name>
Name is delegate name you want to register with. It must be unique in ADAMANT blockchain. It should not be similar to ADAMANT address. Delegate name can only contain alphanumeric characters and symbols !@$&_.
Current fee for registering as delegate is 3000 ADM.
adm delegate new "tkf"
Answer example:
{
"success": true,
"nodeTimestamp": 37489091,
"transaction": {
"type": 2,
"amount": 0,
"timestamp": 37489091,
"asset": {
"delegate": {
"username": "tkf",
"publicKey": "ae1cf99ade40ba4b94c8408ad440754e037b1837da256549d9b878629af23150"
}
},
"senderPublicKey": "ae1cf99ade40ba4b94c8408ad440754e037b1837da256549d9b878629af23150",
"senderId": "U2509016256839651561",
"signature": "fe0b4747c698f9c01abd1680bb5087b8247719c20ec48522b16bc88ab54bf1f7871f2dc21cc5d8060fb10cc0ce520f43fa9e92bfc356449dbe9a9c7ca69ca604",
"id": "6132068325824063462",
"fee": 300000000000,
"relays": 1,
"receivedAt": "2018-11-10T14:38:11.224Z"
}
}
To vote for delegate in ADAMANT blockcahin, you can use vote for
command.
Vote for delegates:
vote for <publickeys...>
Remove votes from delegates:
vote for -<publickeys...>
To vote (or remove vote) for delegate, you must provide their public keys separated by spaces, you can vote for 32 delegates in one command.
Current fee for voting is .., it does not depend on parameters (delegetes) count, and paid for running one command. Removing votes should be paid as well.
Vote for delegates:
vote for d2885bc8d4aa68f0f4c919077c1edcb9c9020a715f20cb6db7578cd6f68055bb b0b4d346382aa07b23c0b733d040424532201b9eb22004b66a79d4b44e9d1449
Remove votes from delegates:
vote for -d2885bc8d4aa68f0f4c919077c1edcb9c9020a715f20cb6db7578cd6f68055bb -b0b4d346382aa07b23c0b733d040424532201b9eb22004b66a79d4b44e9d1449
Get command provides easy ability to fetch data from the network, they has following subcommands, that target the type of content to receive:
This command returns information about ADAMANT network address (account), information returned consists of balance and publicKey. Return data is in JSON format.
get address <address>
Address must be registered in network, it means it should have at least one income transaction.
Public key will be null
if adress has no outcome transations, such accounts are not initilized. It is impossible to send messages to uninitilized accounts.
adm get address U15531909278942872097
Answer example:
{
"success": true,
"nodeTimestamp": 37656647,
"account": {
"address": "U15531909278942872097",
"unconfirmedBalance": "29869323848614",
"balance": "29869323848614",
"publicKey": "fb736e72b4df38d973f0f8dfccbece763ab0d9603897dfa8f1167fa50018a8e0",
"unconfirmedSignature": 0,
"secondSignature": 0,
"secondPublicKey": null,
"multisignatures": [],
"u_multisignatures": []
}
}
Returns block information, which contains information about forger (generatorId
), timestamp, signatures, and other fields. See JSON format description.
get block <block Id>
Block id
is block number in ADAMANT network.
adm get block 7917597195203393333
Answer example:
{
"success": true,
"nodeTimestamp": 37657689,
"block": {
"id": "7917597195203393333",
"version": 0,
"timestamp": 37656350,
"height": 6091604,
"previousBlock": "10984697155127900754",
"numberOfTransactions": 1,
"totalAmount": 10000000,
"totalFee": 50000000,
"reward": 50000000,
"payloadLength": 117,
"payloadHash": "9d83644fb374c7b1b4b9ae9f8a6ad59ed9b86241052698719a7aea6438783acc",
"generatorPublicKey": "d01cd1fe3e013fe669120ec0b00cac07e4c4b2fdb6153dbd56b38732b2e427fc",
"generatorId": "U5142625607650218363",
"blockSignature": "c227a41097d5d224e762299e26b88ca387d98dff73ebc3d0ef416958ef7edadccb472319d430fc1184d3a1b8c11a879763d07274ae3bedae9f8fd8beab6de008",
"confirmations": 268,
"totalForged": "100000000"
}
}
Returns information about delegate and it's productivity. Return data is in JSON format.
get delegate <delegate name>
Where delegate name
is registered delegate name in ADAMANT network.
adm get delegate bash
Answer example:
{
"success": true,
"nodeTimestamp": 37657752,
"delegate": {
"username": "bash",
"address": "U5142625607650218363",
"publicKey": "d01cd1fe3e013fe669120ec0b00cac07e4c4b2fdb6153dbd56b38732b2e427fc",
"vote": "20552540707898",
"votesWeight": "2565213987104",
"producedblocks": 10154,
"missedblocks": 15,
"rate": 68,
"rank": 68,
"approval": 0.03,
"productivity": 99.85
}
}
Returns information about message, decoding it. Return data is in JSON format.
get message <transaction id>
Where transaction id
is unique number, identifying transaction in ADAMANT network.
adm get message 8478242028679662520
Answer example:
{
"success": true,
"nodeTimestamp": 56149592,
"transaction": {
"id": "84782420286796422521",
"height": 5435334,
"blockId": "1232363614186036243",
"type": 8,
"timestamp": 0149531,
"senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
"senderId": "U15423595369615486571",
"recipientId": "U18322695495053155871",
"recipientPublicKey": "51a0ade2c0184d0049130c06911bbf30dc79de715ba29b7496ab443cf49ea5d7",
"amount": 0,
"fee": 100000,
"signature": "6aa73a67d30ae31638254752d7f4314bda3c0959072034bd598e34e7c6d171256dfc7b3c94346e65eaaedab1c1f398be53bbe102a87d53103e9090cadd9bb405",
"signatures": [],
"confirmations": 2,
"asset": {
"chat": {
"message": "test\ntest\ntest",
"type": 1
}
}
}
}
Provides information about specific transaction. Return data is in JSON format.
get transaction <transaction id>
Where transaction id
is unique number, identifying transaction in ADAMANT network.
adm get transaction 12810335978558620573
Answer example:
{
"success": true,
"nodeTimestamp": 37658456,
"transaction": {
"id": "12810335978558620573",
"height": 6091604,
"blockId": "7917597195203393333",
"type": 0,
"timestamp": 37656340,
"senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
"senderId": "U15423595369615486571",
"recipientId": "U18322695495053155871",
"recipientPublicKey": "51a0ade2c0184d0049130c06911bbf30dc79de715ba29b7496ab443cf49ea5d7",
"amount": 10000000,
"fee": 50000000,
"signature": "1f615528f133cfaeb865b50954b5dcaaaf66d6a2746c0945d506dedb4e9b7de01317c205f832002efe5b50a7e6d5503c5b83b0eb5279caa90aea4c0cd499a00f",
"signatures": [],
"confirmations": 422,
"asset": {}
}
}
Gives you ability to perform complex queries to transactions store. Returns transaction array in JSON format.
get transactions <query>
Query must be set of conditions and operators to choose transactions you need. They must follow rules.
get transactions "inId=U3496974446819433410,and:type=0"
Answer example:
{
"success": true,
"nodeTimestamp": 37658691,
"transactions": [
{
"id": "12211195993237103215",
"height": 119100,
"blockId": "9881997101713554805",
"type": 0,
"timestamp": 7418761,
"senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
"senderId": "U15423595369615486571",
"recipientId": "U3496974446819433410",
"recipientPublicKey": "7927b50d730eceba0b3d9cd2e19497bd738ac4db7f93e1a154362750cb47bf86",
"amount": 49000000,
"fee": 50000000,
"signature": "9744ba01933d068d5a6f6ff37694ee9a67a0d9ef8e047fa856c02e49ab5a4c69405138dfde0a86eb2f01d82f79c36aba2f89663af0cdccdc721494abf397dc02",
"signatures": [],
"confirmations": 5972972,
"asset": {}
}
],
"count": "1"
}
Commands to get Height and Version info from connected to Adamant-console node.
Returns current node height. Data returned in JSON format.
node height
node height
Answer example:
{
"success": true,
"nodeTimestamp": 39727487,
"height": 6502691
}
Returns current node version. Data returned in JSON format.
node version
node version
Answer example:
{
"success": true,
"nodeTimestamp": 39727482,
"build": "",
"commit": "3b02193d470640ba841ea941f93a042095f6fc60",
"version": "0.4.0"
}
JSON RPC is an alternative way to interact with ADAMANT blockchain. To use JSON-RPC, you need to start RPC daemon on Adamant-console.
To run JSON RPC server, you can user rpc server
command. It starts JSON-RPC server on port defined in configuration file.
When you start RPC server, machine will turn into listening mode and bash will be unavailable. To run JSON RPC commands from the same machine, you should use run new instance/ terminal window.
To stop RPC server, press Ctrl + C
.
rpc server
adm rpc server
Answer example:
JSON-RPC server listening on port 5080
To send message from account, you can use send message
command.
send message <address> <text>
To set sender account, you can do it in two ways.
address
must be an initialized address in ADAMANT network. It is a recipient of message. If address is not initialized, recipient's public key can't be fetched and node will return {"success":false, "error":"Unknown Address"}
.
text
text message to send. Text will be encrypted as specified in AIP-4: Basic Encrypted Messages. Node accepts maximum encrypted text length of 20480 hex symbols, so approximate maximum unencrypted text length is about 13000 utf-8 symbols. Transaction fee depends on text length, and approximately 0.001 ADM per 255 unencrypted symbols.
To insert in text
a Newline (\n, line ending or line break), insert \line
.
adm send message U15531909278942872097 "π
Όπ
°π
Ίπ
΄ π
° ππ
Όπ
Έπ
»π
΄, ππ
Ύπ'ππ
΄ π
Ύπ
½ π
²π
°π
½π
³π
Έπ
³ π
²π
°π
Όπ
΄ππ
°!" --passPhrase "shift credit run sea order flower tribe invest march govern blanket absorb"
Answer example:
{
"success": true,
"nodeTimestamp": 37486967,
"transactionId": "18412470054836757895"
}
Then, with transactionId
you can get transaction's details.
adm send message U15531909278942872097 "First line\lineSecond line" --passPhrase "shift credit run sea order flower tribe invest march govern blanket absorb"
This command sends a message:
First line
Second line
To send tokens from account, you can use send tokens
command.
send tokens <address> <amount>
To set sender account, you can do it in two ways.
address
must be an address in ADAMANT network. It is a recipient of tokens.
amount
can be written in two ways. If you add ADM to amount, it will transfer amount of ADM tokens (simple to understand). If you omit it, integer amount of 1/10^8 tokens will be transfered (1 ADM = 100000000).
adm send tokens U15531909278942872097 1ADM --passPhrase "shift credit run sea order flower tribe invest march govern blanket absorb"
Answer example:
{
"success": true,
"nodeTimestamp": 37486967,
"transactionId": "18412470054836757895"
}
Then, with transactionId
you can get transaction's details.