-
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.
Adapt backend and contract to use unix timestamp instead of index acc…
…essors
- Loading branch information
Showing
9 changed files
with
43 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
NETWORK_URL=http://63.33.55.29/?apikey=API_KEY | ||
NETWORK_WALLET_PRIV_KEY=0x5b3244868464b97618e1545555f5ce5e443ad09dafb72c560a3d8018e1c2b2b3 | ||
|
||
CONTRACT_ADDRESS=0xBba1177A5aa4c1590173ee3E7034916752E66F45 | ||
CONTRACT_ADDRESS=0x4a661bE808177bBBc142934bCF70020fAD1Ca5e7 |
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 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
[Create new hashes for a set of tenants](#create-new-hashes-for-a-set-of-tenants) | ||
[Get the latest hash stored for a tenant](#get-the-latest-hash-stored-for-a-tenant) | ||
[Get the stored hash count for a tenant](#get-the-stored-hash-count-for-a-tenant) | ||
[Get a specific hash by index for a tenant](#get-a-specific-hash-by-index-for-a-tenant) | ||
[Get a specific hash by unix timestamp for a tenant](#get-a-specific-hash-by-unix-timestamp-for-a-tenant) | ||
|
||
## Create new hashes for a set of tenants | ||
Creates new hashes for all the tenants passed on the request body so they can be stored in blockchain. | ||
|
@@ -70,36 +70,16 @@ None | |
} | ||
``` | ||
|
||
## Get the stored hash count for a tenant | ||
Retrieves the number of stored hashes for a specific tenant | ||
## Get a specific hash by unix timestamp for a tenant | ||
Retrieves a specific hash by the unix timestamp in all the stored hashes for a specific tenant | ||
### Request Endpoint | ||
GET `/countHashes/:tenantId` | ||
GET `/getHash/:tenantId/:unixTimestamp` | ||
### Request Body | ||
None | ||
### Success Result Example | ||
```json | ||
{ | ||
"message": "Retrieved the hash count for the tenant [email protected].", // A message explaining execution result | ||
"result": "1" // The count of hashes stored for this tenant | ||
} | ||
``` | ||
### Error Example | ||
```json | ||
{ | ||
"message": "Tenant exampleTenant@exampleTable does not have a registered contract." | ||
} | ||
``` | ||
|
||
## Get a specific hash by index for a tenant | ||
Retrieves a specific hash by the index in all the stored hashes for a specific tenant | ||
### Request Endpoint | ||
GET `/getHash/:tenantId/:index` | ||
### Request Body | ||
None | ||
### Success Result Example | ||
```json | ||
{ | ||
"message": "Retrieved the hash at index 0 for the tenant [email protected].", // A message explaining execution result | ||
"message": "Retrieved the hash with timestamp 1720648799999 for the tenant [email protected].", // A message explaining execution result | ||
"result": { | ||
"unixTimestamp": "1720648799999", // The unix timestamp for the stored hash | ||
"storedHash": "2d57b6ad076fbc35d04e25e5493fc1f5559f75e05af3f712abe22948c9307281" // The stored hash | ||
|
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 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 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 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
{"HashStorageFactory":"0xBba1177A5aa4c1590173ee3E7034916752E66F45"} | ||
{"HashStorageFactory":"0x4a661bE808177bBBc142934bCF70020fAD1Ca5e7"} |
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