-
Notifications
You must be signed in to change notification settings - Fork 1
DemoScenaries_BasicDeal_PrivEth
The basic deal shows the siplest case of a transaction among nodes. The participant called Sender initiates deal at the first node. The second participant called Reciever detects deal initiating at the other node.
Sender: node PrivEth-1
Reciever: node PrivEth-2
- At Sender node create a Deal with the the parallel setting the Created state
- Make sure at Reciever node the Deal exists and status is equal to Created
Attention!
In the call case the ID is replaced with (UID) word - you need to replace it with your obtained ID when creating the Deal at Step 1.
Attention!
In queries in the headers CHANNEL, AUHORIZATION you must use the personal identifier you received during registration. This will allow not to interfere with the simultaneous work of several users, as well as facilitate the work of the Technical Support service if you have any questions. The query examples use the personal identifier Demo.
For more information about authorization, visit API: Authorization Page
If you run into any error, visit API: Errors Page
You can to use Postman script or make requests above step by step
Use POST-method call /api/deals/. The json specification of the transaction is indicated as the request data. In our case:
{
"dealUid": null,
"kind": "FirstDeal",
"parties": [
{
"key": "CLIENT1",
"role": "Sender"
},
{
"key": "CLIENT2",
"role": "Reciever"
}
],
"status": "Created"
}curl
-X POST "http://democlient1.kekker.com/api/deals"
-H "Accept: application/json"
-H "Channel: {CHANNEL}"
-H "Content-Type: application/json"
-H "Authorization: {AUTHORIZATION}"
-d "
{
\"dealUid\": null,
\"kind\": "FirstDeal",
\"parties\": [
{
\"key\": \"CLIENT1\",
\"role\": \"Sender\"
},
{
\"key\": \"CLIENT2\",
\"role\": \"Reciever\"
}
],
\"status\": \"Created\"
}"If everything is fine you'll receive response code 200. The Deal identifier is in the response body [UID]. Save it and add to further requests.
Use GET-method call /api/deals/{UID} where {UID} is the Deal identifier
Attention!
Wait for 5 minutes after step [2] before executing these queries
curl
-X GET "http://democlient2.kekker.com/api/deals/{UID}"
-H "Accept: application/json"
-H "Channel: {CHANNEL}"
-H "Authorization: {AUTHORIZATION}"{
"uid": "6e4c83cc-874a-41c5-b416-a796ba7b95fb",
"kind": "FirstDeal",
"status": "Created",
"remark": "",
"parameters": [],
"parties": [
{
"key": "CLIENT1",
"role": "Sender"
},
{
"key": "CLIENT2",
"role": "Reciever"
}
],
"files": [],
"history": [
{
"status": "Created",
"party": {
"key": "CLIENT1",
"role": "Sender"
},
"remark": "",
"version": 2
}
],
"statusMap": []
}