5.4.3.14 Block event registration API
Block event in a DApp can trigger the off-BSN system to process further transactions. This interface is used to register the block event to be monitored.
1. Interface address: https://PCNGatewayAddress/api/fabric/v1/chainCode/event/blockRegister
2. Call method: POST
3. Signature algorithm: required and refer to Section 5.4.3.1
4. Call parameters
No. | Field name | Field | Type | Required | Remarks |
---|---|---|---|---|---|
1 | Header | header | Map | Y | |
2 | Body | body | Map | Y | |
3 | Signature Value | mac | String | Y | |
Header | |||||
1 | user unique ID | userCode | String | Y | |
2 | DApp unique ID | appCode | String | Y | |
Body | |||||
1 | Chaincode event notification URL | notifyUrl | String | Y | URL to receive the monitored block event |
2 | Attached additional parameters | attachArgs | String | N |
Example:
{"header":{"userCode":"USER0001202007101641243516163","appCode":"app0001202101191411238426266","tId":""},"mac":"MEUCIQClsjKy/ee1qaYrItzCO1bMfjs0g0kPu8+YOCjbk3rPRAIgSfeyYvfeoh8QciZPG4fZQepaiyh7PmmWjYzFSqylT/c=","body":{"chainCode":"","eventKey":"","notifyUrl":"http://192.168.6.78:58011/v1/fabric/test","attachArgs":"a=1"}}
5. Response parameters
No. | Field name | Field | Type | Required | Remarks |
---|---|---|---|---|---|
1 | Header | header | Map | Y | |
2 | Body | body | Map | Y | |
3 | Signature Value | mac | String | Y | |
header | |||||
1 | Response ID | code | int | Y | 0: successful-1: failed |
2 | Response message | msg | String | Y | |
Body | |||||
1 | Event ID | eventId | String | Y |
Example:
{
"header": {
"code": 0,
"msg": "success"
},
"mac": "MEUCIQC6PKsSqfkQGLrqi2vMpZzBP5beLhyP+fXVr8S5aqhaagIgaEtAnsuiubibYoYZzQ/8aGYErzm5rtU8Oj952OuHgCo=",
"body": {
"eventId": "002f0e1f0b0f4331ab541461547a38d6"
}
}