To run the flow, you must first start a local combined worker version of Corda. The CorDapp template includes helper Gradle tasks to do this.startCorda task
The startCorda task runs in an Intellij ‘Run’ window. After about one minute, it shows the following output:startCorda task running
The startCorda task continues to run whilst the Corda cluster is running. It stops when the cluster is shut down.
Currently, we do not have a liveness detector for Corda in the CorDapp template so we check liveness by manually hitting an endpoint. You can use the listVNodes helper to do this.
If Corda has started, the Swagger UI displays:Swagger UI showing Corda liveness
If Corda has not started yet, the page will not load.
If the Swagger UI is already open whilst starting Corda, you must hit an endpoint to test liveness of Corda.
To access the Corda cluster, you must authorize Swagger:
Click the green Authorize button.Swagger Authorize buttonThe Available authorizations window is displayed.
If necessary, click Logout.
Enter the username and password. For the purposes of experimental development, the username for the combined worker is set to admin and the password is admin.Swagger Authorize authorizations window
Once authorized, you can start hitting endpoints. The easiest one to try is /cpi because it is the first one on the Swagger page and requires no arguments:
Expand the GET /cpi row and click Try it out.Try it out button for GET /cpi
Click the Execute button to hit the endpoint.
If Corda has started you should see a response like this:Swagger showing a successful response to GET /cpiAs we have not uploaded any CPIs yet, the returned list of CPIs is empty.
If Corda has not started yet, Swagger will return an error:Swagger showing an error response to GET /cpiIf this occurs, you either have not started Corda, Corda has not finished starting, or something has gone wrong. If something has gone wrong, you should try again or reset the environment and start again.
Each time you start Corda for the specific combined worker development environment, it is a fresh instance. There is no persistence of state between restarts.
Expand the POST /flow/{holdingidentityshorthash} endpoint in the Flow Management API section in Swagger and click Try it out.Try it out button for POST /flow/{holdingidentityshorthash}
Enter the hash and the requestBody and click Execute.Arguments for POST /flow/{holdingidentityshorthash}
ClientRequestId is a unique identifier for the request to start a flow.
flowClassName is the fully qualified path to the flow class you want to run.
requestBody is the set of arguments you pass to the flow.
Swagger should display the following response:Successful response for POST /flow/{holdingidentityshorthash}
Note, if you forget to change the ClientRequestId on subsequent attempts to run the flow, the following error message is displayed:Error response for POST /flow/{holdingidentityshorthash
Because the API is asynchronous, at this stage you only receive the confirmation START_REQUESTED. There is no indication if the flow has been successful. To find out the status of the flow, you must check the flow status.
Expand the GET /flow/{holdingidentityshorthash}/{clientrequestid} endpoint in Swagger and click Try it out.
Enter the hash and the requestid used when starting the flow and click Execute.Arguments for GET /flow/{holdingidentityshorthash}/{clientrequestid}If the flow is successful, you will see the following response:Successful response for GET /flow/{holdingidentityshorthash}/{clientrequestid}You will learn more about the flowResult of “Hello Alice best wishes from Bob” in Your first flow.
If you receive a response with a status of “RUNNING”, wait a short time and retry the status check.
Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.
Propose documentation improvements directly
Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.
We're sorry this page wasn't helpful. Let us know how we can make it better!
Chat with us
Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.
Create an issue
Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.
Propose documentation improvements directly
Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.