diff options
| author | alpaylan | 2021-04-16 01:03:21 +0300 |
|---|---|---|
| committer | alpaylan | 2021-04-16 01:03:21 +0300 |
| commit | b4212a90caa899785402c06d57216e75de0f1c88 (patch) | |
| tree | 8adbe6eb6b451eee20d181f26ab771e0c5a920ee /site/content/block_docs.md | |
| parent | 82864341afc78b23b358cd775c70ffbfa0d0303f (diff) | |
| parent | 72f8ae422eeb03ed87c7819af5d5e25758267b03 (diff) | |
| download | gradecoin-b4212a90caa899785402c06d57216e75de0f1c88.tar.gz gradecoin-b4212a90caa899785402c06d57216e75de0f1c88.tar.bz2 gradecoin-b4212a90caa899785402c06d57216e75de0f1c88.zip | |
Merge remote-tracking branch 'origin/main'
# Conflicts:
# src/schema.rs
Diffstat (limited to 'site/content/block_docs.md')
| -rw-r--r-- | site/content/block_docs.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/site/content/block_docs.md b/site/content/block_docs.md new file mode 100644 index 0000000..c1d61e9 --- /dev/null +++ b/site/content/block_docs.md | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | +++ | ||
| 2 | title = "Blocks" | ||
| 3 | description = "Block Documentation" | ||
| 4 | weight = 10 | ||
| 5 | +++ | ||
| 6 | |||
| 7 | A block that was proposed to commit Transactions in `transaction_list` to the | ||
| 8 | ledger with a nonce that made `hash` valid; 6 zeroes at the left hand side of the | ||
| 9 | hash (24 bytes). | ||
| 10 | |||
| 11 | We are _mining_ using [blake2s](https://www.blake2.net/) algorithm, which produces 256 bit hashes. Hash/second is roughly 20x10^3 on my machine, a new block can be mined in around 4-6 minutes. | ||
| 12 | |||
| 13 | # Requests | ||
| 14 | |||
| 15 | ## GET | ||
| 16 | A HTTP `GET` request to [/block](/block) endpoint will return the latest mined block. | ||
| 17 | |||
| 18 | ## POST | ||
| 19 | |||
| 20 | A HTTP `POST` request with Authorization using JWT will allow you to propose your own blocks. | ||
| 21 | |||
| 22 | # Fields | ||
| 23 | ``` | ||
| 24 | transaction_list: [array of Fingerprints] | ||
| 25 | nonce: unsigned 32-bit integer | ||
| 26 | timestamp: ISO 8601 <date>T<time> | ||
| 27 | hash: String | ||
| 28 | ``` | ||
| 29 | |||
| 30 | [ISO 8601 Reference](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) | ||
