See https://docs.corda.net/getting-set-up.html.
See https://docs.corda.net/tutorial-cordapp.html#running-the-example-cordapp.
There's essentially five processes you'll need to be aware of.
- Three Corda nodes, a notary, santa, and an elf
- The backend webserver that runs the REST endpoints for the corda nodes
- The frontend webserver, a react app that sends requests to the backend.
If you've never built a cordapp before you may need to configure gradle and java in order for this code example to run. See our setup guide.
To run the corda nodes you just need to run the deployNodes
gradle task and the nodes will be available for you to run directly.
./gradlew deployNodes
./build/nodes/runnodes
The frontend will be visible on localhost:10056
clients/src/main/java/com/secretsanta/webserver/
defines a simple Spring webserver that connects to a node via RPC and allows you to interact with the node over HTTP.
The API endpoints are defined in clients/src/main/java/com/secretsanta/webserver/Controller.java
The react server can be started by going to clients/src/main/webapp
, running npm install
and then npm start
.
cd clients/src/main/webapp
npm install
npm run serve
The frontend will be visible on localhost:3000
There are unit tests for the corda state, contract, and tests for both flows used here. You'll find them inside of the various test folders.