Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clydedacruz/obligation-webapp-springboot
Web app that uses a Spring Boot API for the Obligation CorDapp, that talks to a Corda node over Corda RPC
https://github.com/clydedacruz/obligation-webapp-springboot
corda corda-rpc kotlin spring-boot
Last synced: 10 days ago
JSON representation
Web app that uses a Spring Boot API for the Obligation CorDapp, that talks to a Corda node over Corda RPC
- Host: GitHub
- URL: https://github.com/clydedacruz/obligation-webapp-springboot
- Owner: clydedacruz
- Created: 2018-07-12T11:51:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-20T16:06:45.000Z (about 6 years ago)
- Last Synced: 2024-10-30T04:55:53.792Z (about 2 months ago)
- Topics: corda, corda-rpc, kotlin, spring-boot
- Language: HTML
- Homepage:
- Size: 804 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# obligation-webapp-springboot
Web app that uses a Spring Boot API for the [Obligation CorDapp](https://github.com/corda/obligation-cordapp), that talks to a Corda node over Corda RPC.## Pre-requisites
Follow the [Instructions for setting up](https://github.com/corda/obligation-cordapp#instructions-for-setting-up) which sets up a Notary and 3 Corda Nodes with the Obligation CorDapp installed on each node.## Starting the web app
Make sure you have cloned the Obligation Cordapp example and started the nodes (as described in pre-requisites)
```
git clone [email protected]:clydedacruz/obligation-webapp-springboot.git./gradlew runPartyAServer
```The UI for Party A will be accessible at
`:8080/obligation`
The API for Party A will be accessible at
`:8080/obligation/api/`
We can similarly start up the web apps for *Party B* and *Party C* using the gradle tasks `runPartyBServer` (port 8081) and `runPartyCServer` (port 8082) respectively, which are defined in `build.gradle`
## API Endpoints
### Get names of peers in the network
`curl http://127.0.0.1:8080/obligation/api/peers`### Get name of current node
`curl http://127.0.0.1:8080/obligation/api/me`### Issue cash to yourself
`curl http://127.0.0.1:8080/obligation/api/self-issue-cash?amount=2000¤cy=USD`### Get cash balances
`curl http://127.0.0.1:8080/obligation/api/cash-balances`### Issue obligation
`curl http://127.0.0.1:8080/obligation/api/issue-obligation?amount=100¤cy=USD&party=PartyB`### Get list of obligations
`curl http://127.0.0.1:8080/obligation/api/obligations`
### Transfer obligation
`curl http://127.0.0.1:8080/obligation/api/transfer-obligation?id=4ecee9db-2d37-48f3-b10a-a1dd3cf272da&party=PartyB`### Settle obligation
`curl http://127.0.0.1:8080/obligation/api/settle-obligation?id=918f8ca0-4785-4abb-8e17-5f2f8cdf0a7e&amount=100¤cy=USD`## Note
The obligation-cordapp-0.1.jar is included in the `jars` directory to make the Corda flows and contracts accessible to api controller code.It can be built by simply running `./gradlew jar` in the root directory of the `obligation-cordapp`