Minor cleanup of attachment demo

This commit is contained in:
Shams Asari 2016-11-22 14:13:45 +00:00
parent 45d54bec39
commit d8e09f7174
3 changed files with 5 additions and 3 deletions

2
.gitignore vendored
View File

@ -78,3 +78,5 @@ crashlytics-build.properties
# docs related
docs/virtualenv/
/logs/
samples/*/logs/

View File

@ -87,7 +87,7 @@ Attachment demo
This demo brings up three nodes, and sends a transaction containing an attachment from one to the other. To run
it from the command line (recommended for Mac/UNIX users!):
1. Run ``./gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples/trader-demo/build/nodes``
1. Run ``./gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples/attachment-demo/build/nodes``
2. Run ``./samples/attachment-demo/build/nodes/runnodes`` to open up three new terminal tabs/windows with the three nodes.
3. Run ``./gradlew samples:attachment-demo:runRecipient``, which will block waiting for something to happen.
4. Run ``./gradlew samples:attachment-demo:runSender`` in another terminal window to trigger the transaction.

View File

@ -49,10 +49,10 @@ class AttachmentDemoApi(val services: ServiceHub) {
// Send the transaction to the other recipient
val tx = ptx.toSignedTransaction()
services.invokeProtocolAsync<Unit>(FinalityProtocol::class.java, tx, setOf(it)).resultFuture.success {
services.invokeProtocolAsync(FinalityProtocol::class.java, tx, setOf(it)).resultFuture.success {
println("Successfully sent attachment with the FinalityProtocol")
}.failure {
logger.error("Failed to send attachment with the FinalityProtocol")
logger.error("Failed to send attachment with the FinalityProtocol", it)
}
Response.accepted().build()