Reporting a new accident
Now that the demo assets are set up and we have verified that at least one of the assets is stored in the chaincode state database, we can execute the first functional operation. Let's imagine that an accident just happened and that the vehicle with the registration number JN6ND01S3GX194659 automatically reports the accident by calling the REST proxy of the lease company to which the car belongs, for example, AutoLease. The HTTP request calls the {{AutoLeaseProxyHost}}/bcsgw/rest/v1/transaction/invocation endpoint and invokes the reportAccident transaction/function.
The function expects a minimum of two arguments, namely the longitude and latitude, but it can also receive the date and time when the accident occurred ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access