1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style>
:root {
/* Primary theme color */
--primary-color: #F8D12F;
/* Primary theme text color */
--primary-text-color: #1E2329;
/* Primary theme link color */
--primary-link-color: #2F57F7;
/* Secondary color: the background body color */
--secondary-color: #FAFAFA;
--secondary-text-color: #303030;
/* Highlight text color of table of content */
--toc-highlight-text-color: #d46e13;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/normalize.css">
<link rel="stylesheet" href="http://localhost:8080/juice.css">
</head>
<body>
<header class="pos-absolute" style="background-color: transparent">
<a href="http://localhost:8080/">
<div class="logo">
<img src="http://localhost:8080/gradecoin.png" alt="logo">
Gradecoin
</div>
</a>
<nav>
<a class="nav-item subtitle-text" href="http://localhost:8080/block-docs/">Blocks</a>
<a class="nav-item subtitle-text" href="http://localhost:8080/transaction-docs/">Transactions</a>
<a class="nav-item subtitle-text" href="http://localhost:8080/register-docs/">Register</a>
<a class="nav-item subtitle-text" href="http://localhost:8080/jwt/">JWT</a>
<a class="nav-item subtitle-text" href="https://github.com/zhuowei/nft_ptr#why">why?</a>
</nav>
</header>
<div class="hero">
<section class="text-center">
<h1 class="heading-text" style="font-size: 50px">
Mine your own grades
</h1>
<h3 class="title-text">
<b style="color: deepskyblue">Gradecoin</b> is the latest cutting edge blockchain technology agile grading framework that drives organic engagement and other buzzwords, with big data mining search engine optimization
</h3>
<div>
<!-- <a class="github-button" href="https://github.com/huhu/juice" data-size="large" data-show-count="true" -->
<!-- aria-label="Star huhu/juice on GitHub">Star</a> -->
<!-- <a class="github-button" href="https://github.com/huhu/juice/fork" data-size="large" -->
<!-- data-show-count="true" aria-label="Fork huhu/juice on GitHub">Fork</a> -->
</div>
</section>
<img class="hero-image" style="width: 50%" src="http://localhost:8080/gradecoin.png">
<div class="explore-more text"
onclick="document.getElementById('features').scrollIntoView({behavior: 'smooth'})">
⇩ Learn How ⇩
</div>
<style>
.hero section {
padding: 0 5rem;
}
@media screen and (max-width: 768px) {
.hero section {
padding: 0 2rem;
}
.hero-image {
display: none
}
}
</style>
</div>
<main>
<div class="toc">
<div class="toc-sticky">
<div class="toc-item">
<a class="subtext" href="http://localhost:8080/#services">Services</a>
</div>
<div class="toc-item-child">
<a class="subtext" href="http://localhost:8080/#register"><small>- /register</small></a>
</div>
<div class="toc-item-child">
<a class="subtext" href="http://localhost:8080/#transaction"><small>- /transaction</small></a>
</div>
<div class="toc-item-child">
<a class="subtext" href="http://localhost:8080/#block"><small>- /block</small></a>
</div>
</div>
</div>
<div class="content text">
<div id="features" class="heading-text">Overview</div>
<ul>
<li>Don't know where to start? Gradecoin uses RESTful API, simple <code>curl</code> commands or even your browser will work! <a href="https://curl.trillworks.com/">This website can help as well</a>.</li>
<li><a href="https://jwt.io">JWT Debugger</a> and the corresponding <a href="https://tools.ietf.org/html/rfc7519">RFC</a></li>
</ul>
<h1 id="services">Services</h1>
<h2 id="register">/register</h2>
<ul>
<li>Student creates their own 2048 bit RSA <code>keypair</code></li>
<li>Downloads <code>Gradecoin</code>'s Public Key from <a href="https://odtuclass.metu.edu.tr/my/">Moodle</a></li>
<li>Encrypts their JSON wrapped <code>Public Key</code>, <code>Student ID</code> and one time <code>passwd</code> using Gradecoin's Public Key</li>
<li>Their public key is now in our database and can be used to sign their JWT's during requests</li>
</ul>
<h2 id="transaction">/transaction</h2>
<ul>
<li>You can offer a <a href="/transaction">Transaction</a> - POST request
<ul>
<li>The request should have <code>Authorization</code></li>
<li>The request header should be signed by the Public Key of the <code>by</code> field in the transaction</li>
</ul>
</li>
<li>fetch the list of <code>Transaction</code>s - GET request</li>
</ul>
<h2 id="block">/block</h2>
<ul>
<li>offer a [<code>schema::Block</code>] - POST request
<ul>
<li>The request should have <code>Authorization</code></li>
<li>The [<code>schema::Block::transaction_list</code>] of the block should be a subset of [<code>schema::Db::pending_transactions</code>]</li>
</ul>
</li>
<li>fetch the last accepted [<code>schema::Block</code>] - GET request</li>
</ul>
<p><code>Authorization</code>: The request header should have Bearer JWT.Token signed with Student Public Key</p>
</div>
</main>
<footer>
⁂
</footer>
</body>
<script>
function highlightNav(heading) {
let pathname = location.pathname;
document.querySelectorAll(".toc a").forEach((item) => {
item.classList.remove("active");
});
document.querySelector(".toc a[href$='" + pathname + "#" + heading + "']").classList.add("active");
}
let currentHeading = "";
window.onscroll = function () {
let h = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
let elementArr = [];
h.forEach(item => {
if (item.id !== "") {
elementArr[item.id] = item.getBoundingClientRect().top;
}
});
elementArr.sort();
for (let key in elementArr) {
if (!elementArr.hasOwnProperty(key)) {
continue;
}
if (elementArr[key] > 0 && elementArr[key] < 300) {
if (currentHeading !== key) {
highlightNav(key);
currentHeading = key;
}
break;
}
}
}
</script>
</html>
|