Skip to content

sktston/vcx-demo-java

Repository files navigation

Running the VCX Java Demo

Alice/Faber demo

The alice/faber demo is widely used in the indy-sdk demo. The description of the VCX node demo explains it well, including the operation of the cloud agent. Description here.

Pre-requirements

Libraries

Before you'll be able to run demo, you need to make sure you've compiled

Library binaries must be located /usr/local/lib on OSX, /usr/lib on Linux.

Java wrapper for VCX library

You can skip this step because this code gets the pre-built LibVCX wrapper from skt-develop maven repository.

Or you can build and use the LibVCX wrapper. Instructions here.

See dependencies section in build.gradle.

Indy pool

You can skip this step because this code uses the skt testnet.

Or you can run pool of Indy nodes on your machine. You can achieve by simply running a docker container which encapsulates multiple interconnected Indy nodes. Instructions here.

See genesis_path of vcxConfig variable.

Dummy Cloud Agent

You can skip this step because this code uses the skt test dummy cloud agent.

Or you can run dummy cloud agent on your machine. Instructions here.

See agency_url of provisionConfig variable.

Steps to run demo

  • Run Faber agent, representing an institution
./gradlew faber
  • Give it a few seconds, then run Alice's agent which will connect with Faber's agent
./gradlew alice

Demo with Posgres wallet

You can also run demo in mode where both Faber and Alice are using Postgres wallets. Follow instructions to compile postgres wallet plugin and startup local postgres docker container.

Once you have that ready, use these commands to start demo in postgres mode.

./gradlew faber_pg
./gradlew alice_pg

Demo with webhook notifications

Another feature are webhook notifications. The above demo works based on polling, but when using webhook feature, it works based on notification.

./gradlew webhook_faber
./gradlew webhook_alice

Faber receives messages of dummy cloud agent at localhost:7201/notifications. Similarly, Alice receives at localhost:7202/notifications. The action is performed based on the message received, which is briefly described below.

Phase Faber Alice
connection STEP.1 - create invitation(connection) & send invitation STEP.2 - receive invitation & request connection
STEP.3 - accept connection request STEP.4 - connection created
STEP.5 - receive connection ACK
credential STEP.6 - send credential offer STEP.7 - check credential offer & request credential
STEP.8 - send credential STEP.9 - accept credential
STEP.10 - receive credential ACK
proof STEP.11 - request proof STEP.12 - send proof
STEP.13 - receive & verify proof STEP.14 - receive proof ACK

When Alice starts, it automatically gets an invitation from Faber's localhost:7201/invitations. So, in a situation where Faber is running normally, run Alice.

Demo with credential revocation

Faber can revoke the issued credential. With below command, faber will revoke the issued credential before sending proof request. You can see Proof verification failed log at faber side.

./gradlew faber_revoke
./gradlew webhook_faber_revoke

About

VCX Java demo for Faber and Alice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages