diff --git a/.gitignore b/.gitignore
index ed1ab99..cc0e735 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@
node_modules
yarn.lock
.cache
+.parcel-cache
+*.lock
+dist
\ No newline at end of file
diff --git a/client/explorer.html b/client/explorer.html
new file mode 100644
index 0000000..7094bc1
--- /dev/null
+++ b/client/explorer.html
@@ -0,0 +1,29 @@
+
+
+
+ Block Explorer
+
+
+ Block Number:
+
+
+
+
+
+ Timestamp:
+
+
+ Nonce:
+
+
+ Transactions:
+
+
+
+
+
+
+
+
diff --git a/client/explorer.js b/client/explorer.js
new file mode 100644
index 0000000..86eb8cf
--- /dev/null
+++ b/client/explorer.js
@@ -0,0 +1,49 @@
+import "./explorer.scss";
+
+document.getElementById("get-block").addEventListener('click', () => {
+ const params = {
+ method: "getBlock",
+ params: [document.getElementById("blockNumber").value],
+ jsonrpc: "2.0",
+ id: 1
+ }
+ const request = new Request('http://localhost:3032/', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(params)
+ });
+
+ fetch(request)
+ .then(response => {
+ return response.json();
+ }).then(({result}) => {
+ console.log(result)
+ block = JSON.parse(result);
+ let date = new Date(block.timestamp);
+ let formattedTime = date.toLocaleDateString("en-US") + " " + date.toLocaleTimeString("en-US");
+ document.getElementById("timestamp").innerHTML = formattedTime;
+ document.getElementById("nonce").innerHTML = block.nonce;
+
+ let txList = "";
+ let txn = 0;
+ for (let tx of block.transactions) {
+ let inputList = "";
+ for (let input of tx.inputs) {
+ inputList += `${input.owner}: ${input.amount}\n`
+ }
+ let inputHtml = ``
+
+ let outputList = "";
+ for (let output of tx.outputs) {
+ outputList += `${output.owner}: ${output.amount}\n`
+ }
+ let outputHtml = ``
+
+ txList += `Transaction ${txn}
Inputs${inputHtml}
Outputs${outputHtml}
\n`;
+ txn++;
+ }
+ let txHtml = ``
+ document.getElementById("transactions").innerHTML = txHtml;
+ console.log(txHtml)
+ });
+});
diff --git a/client/explorer.scss b/client/explorer.scss
new file mode 100644
index 0000000..d89b528
--- /dev/null
+++ b/client/explorer.scss
@@ -0,0 +1,21 @@
+html {
+ background-color: white;
+ }
+
+ body {
+ margin: 10px;
+ padding: 20px;
+ background-color: #eee;
+ border-radius: 20px;
+ }
+
+ .button {
+ margin: 10px;
+ padding: 10px;
+ border: 1px solid #ddd;
+ border-radius: 10px;
+ background-color: white;
+ cursor: pointer;
+ text-transform: uppercase;
+ }
+
\ No newline at end of file
diff --git a/client/index.html b/client/index.html
index 4f97550..d80b973 100644
--- a/client/index.html
+++ b/client/index.html
@@ -16,6 +16,6 @@
0
-
+