This CorDapp is an adapter for Tradle. It is used for sealing authenticated pieces of data in time, and sharing them with third parties.
Forked from the CorDapp Java template
Table of Contents
build.gradle is configured to launch 3 nodes (Party A, B, C)
the webservers for these nodes live at 10007, 10010, 10013 respectively
-
create "shared item" initiator flow: If the counterparty doesn't have a Corda node yet, saves a toTmpId (Tradle identity hash), to be resolved later. Otherwise creates state with two parties (see responder flow)
-
create "shared item" responder flow (if counterparty already has a corda node): checks if has data identified by "link", e.g. in some external database. If so, confirms state creation
-
resolve identity initiator flow: resolve toTmpId to Corda party in all shared items, i.e. updates state objects with
toTmpId == [given toTmpId]
withto = [given Corda Party]
(state change validation)
(RPC calls, used by REST API module)
@HeaderParam("Authorization")
@QueryParam("link")
@QueryParam("from")
@QueryParam("to")
@QueryParam("toTmpId")
@QueryParam("timestamp")
List shared items. Optionally filter by adding conditions via query parameters
examples:
curl -H "Authorization: abc" http://localhost:10007/api/share/items
curl -H "Authorization: abc" http://localhost:10007/api/share/items?link=link1
@HeaderParam("Authorization")
@QueryParam("partyTmpId")
List items with unresolved counterparties
examples:
curl -H "Authorization: abc" http://localhost:10007/api/share/unresolved
curl -H "Authorization: abc" "http://localhost:10007/api/share/unresolved?partyTmpId=joe"
@HeaderParam("Authorization")
@FormParam("link")
@FormParam("partyName")
@FormParam("partyTmpId")
Create a record for an item with an unresolved counterparty
For ease of testing, API keys currently reside in a text file in resources/certificates/apikeys.txt (and is "abc" per the examples)
examples:
curl -X POST -H 'Authorization: abc' --data "partyName=O%3DPartyA%2CL%3DLondon%2CC%3DGB&partyTmpId=b57ed7f459ea6d0438de3841802110dfd1ce881d78909c9f0f69e19614cf574f" http://localhost:10007/api/share/item
@HeaderParam("Authorization")
@FormParam("partyTmpId")
@FormParam("partyName")
Resolve a partyTmpId to a partyName
examples:
curl -X POST -H "Authorization: abc" --data "partyName=O%3DPartyB%2CL%3DNew%20York%2CC%3DUS&partyTmpId=b57ed7f459ea6d0438de3841802110dfd1ce881d78909c9f0f69e19614cf574f" http://localhost:10007/api/share/resolveparty