5.4.3.14 Chaincode event notification message API
This interface is implemented on the off-BSN system side. When the PCN gateway receives the notification of a triggered event, it uses this interface to notify the off-BSN system about the execution result.
After receiving the notification successfully, the off-BSN system returns a string containing “success”, otherwise, the gateway will send the notification again at 3, 12, 27, and 48 seconds respectively, for a total of five times.
1. Call method: POST
2. Signature algorithm: required and refer to Section 5.4.3.1
3. Call parameters
No. | Field name | Field | Type | Required | Remarks |
---|---|---|---|---|---|
1 | Header | header | Map | Y | |
2 | Body | body | Map | N | |
3 | Signature Value | mac | String | Y | |
header | |||||
1 | user unique ID | userCode | String | Y | |
2 | DApp unique ID | appCode | String | Y | |
body | |||||
1 | Chaincode ID | chainCode | String | Y | |
2 | PCN ID | orgCode | String | Y | |
3 | Registered Event key | eventKey | String | Y | |
4 | Registered Event ID | eventId | String | Y | |
5 | Registered Event parameters | attachArgs | String | N | Additional parameters entered during registration |
6 | Monitored event key | eventName | String | Y | The event name in the chaincode |
7 | Current Chaincode transaction Id | txId | String | Y | |
8 | Monitored event value | payload | String | N | |
9 | Current Block Height | blockNumber | Long | Y | |
10 | Response random string | nonceStr | String | Y | Off-BSN system uses this value to judge if the notification is already received. This string remains the same at the repeated notifications. |
Example:
{"header":{"userCode":"lessing","appCode":"CL20191107112252"},"body":{"chainCode":"cc_bsn_test_00","orgCode":"ORG1571365934172","eventKey":"test:\\S{32}","eventId":"2964a0f60b3e460f834618b3664af2da","attachArgs":"abc=123211","eventName":"test:12345678123456781234567812345678","txId":"32fc105681820fa556b8a460efc1e43a47daa864b959ea1753abb4640f2dce49","payload":"","blockNumber":74,"nonceStr":"522c8061b5e84837bad72ca08c6a353f"},"mac":"MEQCIDU4tROyjLtvD1b8TTbWWAlCPuUbmdPAEUXwRRgVn7kIAiA58je5u/7xDuRPcgeUWL3nB9mouUGQ6dGKJMmD7Jm08g=="}