diff --git a/doc/scoreStore/README.md b/doc/scoreStore/README.md new file mode 100644 index 0000000..2208f89 --- /dev/null +++ b/doc/scoreStore/README.md @@ -0,0 +1,56 @@ +# scoreStore + +Available endpoints: +- GET '/:id' +- POST '/' + +Common return: +- 500 with response +```json +{ + "error": "Internal server error" +} +``` + +## GET `/:id` + +Used to get an score from the blockchain (the id is the one returned when a score is added) + +Inputs: +:id : the id of the score + +Returns: +- 200 +```json +{ + "score": { + "p1": "", + "p2": "", + "p1Score": "", + "p2Score": "" + }, + "tx": "" +} +``` + +## POST `/` + +Used to add a new score (note that those can't be removed after added) + +Inputs (this one need to be the same as the following otherwise you will have an error 500): +```json +{ + "p1": "", + "p2": "", + "p1Score": "", + "p2Score": "" +} +``` + +Returns: +- 200 +```json +{ + "id": "" +} +```