Skip to content

Latest commit

 

History

History

tokentofriend

Token To Friend

In this Cordapp, you will be able to create a token and attached a few message strings. You can later retrieve the token and the strings via query.

Concept

We have built a front end interface to make the interaction easier. Clone the app and give a try!

Corda

Pre-Requisites

Set up for CorDapp development

Running the application

./gradlew clean build deployNodes
./build/nodes/runnodes

Running in terminal:

Go to the operator node:

flow start CreateMyToken myEmail: [email protected], recipients: [email protected], msg: Corda Number 1! 

then record the returned uuid

flow start IssueToken uuid: xxx-xxxx-xxxx-xxxx-xx

record the message returned, TokenId and storage node.

Go to that storage node terminal:

flow start QueryToken uuid: xxx-xxxx-xxxx-xxxx-xx, recipientEmail: [email protected]

You should discover the message that was attached in the token.

Running in webapp

Open a new window and run the blow code for token issuance

./gradlew runOperatoreServer

To retrieve the token, because most people will run the app locally, by default I have the gradle task to start only one storage node's web server.

./gradlew runUSWest1Server

After both servers started, go to localhost:10050 to issue a token and localhost:10053 to experience the retrieve. (The reason it is two different site is that communicating among multiple local server is prohibited by CORS policy. In production environment, we do not need to go to a different site for retrieve.)