mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Previously transactions were only retried after being successfully endorsed, and always with the same transaction ID Transactions will now be added to a queue for processing and will also be retried if endorsement fails (with a different transaction id for invalid transactions) Signed-off-by: James Taylor <jamest@uk.ibm.com>
89 lines
1.6 KiB
HTTP
89 lines
1.6 KiB
HTTP
// Demo file for use with REST Client for Visual Studio Code
|
|
// See https://github.com/Huachao/vscode-restclient
|
|
//
|
|
// Edit the values below to match your environment if required
|
|
@hostname = localhost
|
|
@port = {{$dotenv PORT}}
|
|
@baseUrl = http://{{hostname}}:{{port}}
|
|
@apiUrl = {{baseUrl}}/api
|
|
@api-key = {{$dotenv ORG1_APIKEY}}
|
|
|
|
### Check the server is ready
|
|
|
|
GET {{baseUrl}}/ready HTTP/1.1
|
|
|
|
### Check the server is still live
|
|
|
|
GET {{baseUrl}}/live HTTP/1.1
|
|
|
|
### Get all assets
|
|
|
|
GET {{apiUrl}}/assets HTTP/1.1
|
|
X-Api-Key: {{api-key}}
|
|
|
|
### Check if asset exists
|
|
|
|
OPTIONS {{apiUrl}}/assets/asset7 HTTP/1.1
|
|
X-Api-Key: {{api-key}}
|
|
|
|
### Create asset
|
|
|
|
POST {{apiUrl}}/assets HTTP/1.1
|
|
content-type: application/json
|
|
X-Api-Key: {{api-key}}
|
|
|
|
{
|
|
"id": "asset7",
|
|
"color": "red",
|
|
"size": 42,
|
|
"owner": "Jean",
|
|
"appraisedValue": 101
|
|
}
|
|
|
|
### Read job status
|
|
|
|
GET {{apiUrl}}/jobs/__job_id__ HTTP/1.1
|
|
X-Api-Key: {{api-key}}
|
|
|
|
### Read transaction status
|
|
|
|
GET {{apiUrl}}/transactions/__transaction_id__ HTTP/1.1
|
|
X-Api-Key: {{api-key}}
|
|
|
|
### Read asset
|
|
|
|
GET {{apiUrl}}/assets/asset7 HTTP/1.1
|
|
X-Api-Key: {{api-key}}
|
|
|
|
### Update asset
|
|
|
|
PUT {{apiUrl}}/assets/asset7 HTTP/1.1
|
|
content-type: application/json
|
|
X-Api-Key: {{api-key}}
|
|
|
|
{
|
|
"id": "asset7",
|
|
"color": "red",
|
|
"size": 11,
|
|
"owner": "Jean",
|
|
"appraisedValue": 101
|
|
}
|
|
|
|
### Transfer asset
|
|
|
|
PATCH {{apiUrl}}/assets/asset7 HTTP/1.1
|
|
content-type: application/json
|
|
X-Api-Key: {{api-key}}
|
|
|
|
[
|
|
{
|
|
"op": "replace",
|
|
"path": "/owner",
|
|
"value": "Ashleigh"
|
|
}
|
|
]
|
|
|
|
### Delete asset
|
|
|
|
DELETE {{apiUrl}}/assets/asset7 HTTP/1.1
|
|
X-Api-Key: {{api-key}}
|