From 4dcffb44ad4ed4b60903e2fabf2abfb433a715d0 Mon Sep 17 00:00:00 2001 From: fluency03 Date: Fri, 4 May 2018 17:43:17 +0200 Subject: [PATCH] add api summary in readme --- README.md | 43 +++++++++++++------ .../api/actors/BlockchainActor.scala | 2 +- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0bf281e..85aaf55 100644 --- a/README.md +++ b/README.md @@ -35,48 +35,65 @@ Summary: ### blockchain - ``` - +GET /blockchain +POST /blockchain +DEL /blockchain +GET /blockchain/validity +GET /blockchain/last-block +DEL /blockchain/last-block +POST /blockchain/new-block +POST /blockchain/next-block +GET /blockchain/block/:hash +GET /blockchain/block/:hash/transaction/:id ``` ### block ``` - +GET /blocks +GET /block/:hash +POST /block +DEL /block/:hash +GET /block/:hash/transaction/:id ``` - ### transaction ``` - +GET /transactions +GET /transaction/:id +POST /transaction +PUT /transaction/:id +DEL /transaction/:id ``` - - ### network ``` - +GET /network +POST /peer +GET /peers +GET /peers?names=name1,name2 +GET /peer/:name ``` - ### generic ``` - +POST /generic/to-sha256 +POST /generic/to-base64 +POST /generic/from-base64 +POST /generic/to-epoch-time +POST /generic/time-from-epoch ``` - - - ## Todos - Complete APIs' Todos diff --git a/src/main/scala/com/fluency03/blockchain/api/actors/BlockchainActor.scala b/src/main/scala/com/fluency03/blockchain/api/actors/BlockchainActor.scala index b0dbbae..4dbad1e 100644 --- a/src/main/scala/com/fluency03/blockchain/api/actors/BlockchainActor.scala +++ b/src/main/scala/com/fluency03/blockchain/api/actors/BlockchainActor.scala @@ -91,7 +91,7 @@ class BlockchainActor extends ActorSupport { case None => log.error("Blockchain does not exist! Clear the hash-to-index mapping!") hashIndexMapping.clear() - None + sender() ! None } private def onGetTxOfBlock(id: String, hash: String): Unit = getBlockFromChain(hash) match {