-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from olisystems/publish-repo
Publish repo
- Loading branch information
Showing
6 changed files
with
123 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# ALF Transparency REST API | ||
ALF Transparency REST API is designed to create offers, retrieve offer information and perform verification. | ||
|
||
**Table of Contents** | ||
<!-- MDTOC maxdepth:6 firsth1:0 numbering:1 flatten:0 bullets:0 updateOnSave:1 --> | ||
|
||
1. [API Endpoints](#api-endpoints) | ||
 1.1. [Create Offer](#create-offer) | ||
 1.2. [Get Offer by Usrname and Date](#get-offer-by-usrname-and-date) | ||
 1.3. [Send Root Hash](#send-root-hash) | ||
 1.4. [Get Proof](#get-proof) | ||
|
||
<!-- /MDTOC --> | ||
## API Endpoints | ||
The root path for the API is `https://verify.flexibilitaetsmarkt.de:3000/`. | ||
|
||
### Create Offer | ||
Create a new offer. | ||
``` | ||
/api/offers/ | ||
``` | ||
|
||
- HTTP-Method: POST | ||
- Connected function: `create()` | ||
- Parameter: JSON-Object with following form: | ||
```javascript | ||
{ | ||
username: 'string', | ||
date: 'string', | ||
hash: 'string' | ||
} | ||
``` | ||
### Get Offer by Usrname and Date | ||
Find an offer by a given username and date. | ||
``` | ||
/api/offers/byUsernameDate | ||
``` | ||
|
||
- HTTP-Methode: GET | ||
- Connected function: `findByUsernameDate()` | ||
- Parameter: Query with following form: | ||
``` | ||
?username=<USERNAME>&date=<DATE> | ||
``` | ||
### Send Root Hash | ||
Create a Merkle tree for all offers of a given date and store the resulting root hash on the Volta Blockchain. | ||
``` | ||
/api/offers/rootHashTrigger | ||
``` | ||
|
||
- HTTP-Methode: GET | ||
- Connected function: `storeRootHash()` | ||
- Parameter: Query with following form: | ||
``` | ||
?date=<DATE> | ||
``` | ||
### Get Proof | ||
Fetch a MerkleTree.js-Proof for an offer with a given username and date. The proof can be used to reconstruct/verify a root hash. | ||
``` | ||
/api/offers/proof | ||
``` | ||
- HTTP-Methode: GET | ||
- Connected function: `getProof()` | ||
- Parameter: Query with following form: | ||
``` | ||
?username=<USERNAME>&date=<DATE> | ||
``` |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.