aboutsummaryrefslogtreecommitdiffstats
path: root/site/public/block-docs/index.html
diff options
context:
space:
mode:
authoralpaylan2021-04-16 01:03:21 +0300
committeralpaylan2021-04-16 01:03:21 +0300
commitd248309f8595701a0fddd2462b963bcad55f18c8 (patch)
tree109d4e2809f9f3392612e86ab3d5a47df5830b11 /site/public/block-docs/index.html
parent711d987b8e060682cf2215f25392415e206b3e8d (diff)
parenta1af17aad7c1308fc714a60595bae07cc8bb8a9a (diff)
downloadgradecoin-d248309f8595701a0fddd2462b963bcad55f18c8.tar.gz
gradecoin-d248309f8595701a0fddd2462b963bcad55f18c8.tar.bz2
gradecoin-d248309f8595701a0fddd2462b963bcad55f18c8.zip
Merge remote-tracking branch 'origin/main'
# Conflicts: # src/schema.rs
Diffstat (limited to 'site/public/block-docs/index.html')
-rw-r--r--site/public/block-docs/index.html168
1 files changed, 168 insertions, 0 deletions
diff --git a/site/public/block-docs/index.html b/site/public/block-docs/index.html
new file mode 100644
index 0000000..de4d4e2
--- /dev/null
+++ b/site/public/block-docs/index.html
@@ -0,0 +1,168 @@
1<!DOCTYPE html>
2<html lang="en">
3
4<head>
5 <meta charset="UTF-8">
6 <title>Blocks | Gradecoin </title>
7 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8 <style>
9 :root {
10 /* Primary theme color */
11 --primary-color: #F8D12F;
12 /* Primary theme text color */
13 --primary-text-color: #1E2329;
14 /* Primary theme link color */
15 --primary-link-color: #2F57F7;
16 /* Secondary color: the background body color */
17 --secondary-color: #FAFAFA;
18 --secondary-text-color: #303030;
19 /* Highlight text color of table of content */
20 --toc-highlight-text-color: #d46e13;
21 }
22</style>
23
24 <link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One&display=swap" rel="stylesheet">
25 <link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600&display=swap" rel="stylesheet">
26 <link rel="stylesheet" href="/normalize.css">
27 <link rel="stylesheet" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;juice.css">
28
29<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
30
31</head>
32
33<body>
34
35<header class="box-shadow">
36
37
38<a href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;">
39 <div class="logo">
40 <img src="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;gradecoin.png" alt="logo">
41 Gradecoin
42 </div>
43</a>
44
45<nav>
46
47 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;register-docs&#x2F;">Register</a>
48
49 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;jwt&#x2F;">JWT</a>
50
51 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;transaction-docs&#x2F;">Transactions</a>
52
53 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;block-docs&#x2F;">Blocks</a>
54
55
56
57 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;github.com&#x2F;zhuowei&#x2F;nft_ptr#why">why?</a>
58
59
60</nav>
61
62</header>
63
64
65 <main>
66
67
68
69
70
71 <div class="toc">
72 <div class="toc-sticky">
73
74 <div class="toc-item">
75 <a class="subtext" href="https://gradecoin.xyz/block-docs/#requests">Requests</a>
76 </div>
77
78
79 <div class="toc-item-child">
80 <a class="subtext" href="https://gradecoin.xyz/block-docs/#get"><small>- GET</small></a>
81 </div>
82
83 <div class="toc-item-child">
84 <a class="subtext" href="https://gradecoin.xyz/block-docs/#post"><small>- POST</small></a>
85 </div>
86
87
88
89 <div class="toc-item">
90 <a class="subtext" href="https://gradecoin.xyz/block-docs/#fields">Fields</a>
91 </div>
92
93
94 </div>
95 </div>
96
97
98
99 <div class="content text">
100
101<div class="heading-text">Block Documentation</div>
102<p>A block that was proposed to commit Transactions in <code>transaction_list</code> to the
103ledger with a nonce that made <code>hash</code> valid; 6 zeroes at the left hand side of the
104hash (24 bytes).</p>
105<p>We are <em>mining</em> using <a href="https://www.blake2.net/">blake2s</a> 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.</p>
106<h1 id="requests">Requests</h1>
107<h2 id="get">GET</h2>
108<p>A HTTP <code>GET</code> request to <a href="/block">/block</a> endpoint will return the latest mined block.</p>
109<h2 id="post">POST</h2>
110<p>A HTTP <code>POST</code> request with Authorization using JWT will allow you to propose your own blocks.</p>
111<h1 id="fields">Fields</h1>
112<pre style="background-color:#ffffff;">
113<code><span style="color:#545052;">transaction_list: [array of Fingerprints]
114nonce: unsigned 32-bit integer
115timestamp: ISO 8601 &lt;date&gt;T&lt;time&gt;
116hash: String
117</span></code></pre>
118<p><a href="https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations">ISO 8601 Reference</a></p>
119
120
121 </div>
122
123
124
125 </main>
126
127
128<footer>
129Built For ⁂ CENG489 ⁂ Introduction to Computer Security
130</footer>
131
132</body>
133<script>
134 function highlightNav(heading) {
135 let pathname = location.pathname;
136 document.querySelectorAll(".toc a").forEach((item) => {
137 item.classList.remove("active");
138 });
139 document.querySelector(".toc a[href$='" + pathname + "#" + heading + "']").classList.add("active");
140 }
141
142 let currentHeading = "";
143 window.onscroll = function () {
144 let h = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
145 let elementArr = [];
146
147 h.forEach(item => {
148 if (item.id !== "") {
149 elementArr[item.id] = item.getBoundingClientRect().top;
150 }
151 });
152 elementArr.sort();
153 for (let key in elementArr) {
154 if (!elementArr.hasOwnProperty(key)) {
155 continue;
156 }
157 if (elementArr[key] > 0 && elementArr[key] < 300) {
158 if (currentHeading !== key) {
159 highlightNav(key);
160 currentHeading = key;
161 }
162 break;
163 }
164 }
165 }
166</script>
167
168</html>