From cc33bf771e819b818722ea99eb1dbea647e28112 Mon Sep 17 00:00:00 2001 From: Yashi Verma Date: Sun, 5 Apr 2026 01:23:20 +0530 Subject: [PATCH 1/2] Adding a public dashboard with blockchain visualization using Streamlit --- dashboard.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 dashboard.py diff --git a/dashboard.py b/dashboard.py new file mode 100644 index 0000000..7a4f2f6 --- /dev/null +++ b/dashboard.py @@ -0,0 +1,13 @@ +import streamlit as st +import requests +import plotly.express as px +NODE_URL = "http://localhost:5000" + +# Fetching Blockchain data..... +def get_chain(): + return requests.get(f"{NODE_URL}/chain").json() + +# Fetch pending transactions.... + + + From 45f247c06f85eebfbff3cd5ca53a4332aaa912c7 Mon Sep 17 00:00:00 2001 From: Yashi Verma Date: Mon, 6 Apr 2026 23:01:33 +0530 Subject: [PATCH 2/2] Successfully Added a Dashboard on kryptika --- dashboard.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/dashboard.py b/dashboard.py index 7a4f2f6..812b2ca 100644 --- a/dashboard.py +++ b/dashboard.py @@ -3,11 +3,71 @@ import plotly.express as px NODE_URL = "http://localhost:5000" +# Title....................... +st.title(" KRYPTIKA DASHBOARD ") + # Fetching Blockchain data..... + def get_chain(): return requests.get(f"{NODE_URL}/chain").json() # Fetch pending transactions.... +def get_pending(): + return requests.get(f"{NODE_URL}/transactions/pending").json() + +# Blockchain.................... +st.subheader("Blockchain") +chain = get_chain() + +block_indexes = [] +tx_counts = [] + +for block in chain : + block_indexes.append(block["index"]) + tx_counts.append(len(block["transactions"])) + with st.expander(f"Block #{block['index']}") : + st.write("Hash:" , block['hash']) + st.write("Previous Hash :" , block['prev_hash']) + st.write("Transactions" , block['transactions']) + +# Graph........................ +st.subheader("Transactions per Block") +fig = px.line( + x = block_indexes , + y = tx_counts, + labels ={"x": "Block index" , "y": "Transactions"}, + title = "Blockchain Activity" +) +st.plotly_chart(fig) + + +# Mempool Section.............. + +st.subheader("Pending transactions") +pending = get_pending() +if pending["transactions"]: + for tx in pending["transactions"]: + st.write(f"{tx['sender']} -> {tx['recipient']} : {tx['amount']}") +else : + st.write("No pending transactions") + +#Balance........................ + +st.subheader("Wallet Balance") +address = st.text_input("Enter Wallet Address : ") +if address: + balance = requests.get(f"{NODE_URL}/balance/{address}").json() + st.write("Balance:" , balance["balance"]) + + + + + + + + + +