nustalgic / Blockchain-With-Python

Built a blockchain-based ledger system, complete with a user-friendly web interface. This ledger should allow partner banks to conduct financial transactions (that is, to transfer money between senders and receivers) and to verify the integrity of the data in the ledger.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module-18-Challenge

18-4-application-image.png

Background

In this Challenge, I'm a fintech engineer who’s working at one of the five largest banks in the world. I was recently promoted to act as the lead developer on their decentralized finance team. The task is to build a blockchain-based ledger system, complete with a user-friendly web interface. This ledger should allow partner banks to conduct financial transactions (that is, to transfer money between senders and receivers) and to verify the integrity of the data in the ledger.


Technologies

We'll be using Python and the following libraries to run and read our data.

  • Streamlit - turns data scripts into shareable web apps in minutes. All in pure Python. No front‑end experience required.

  • Data Classes - provides a decorator and functions for automatically adding generated special methods.

  • hashlib - Secure hashes and message digests.

  • datetime - Basic date and time types.

  • typing - Support for type hints.

  • pandas - an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.

Installation Guide

In order for us to get the data we need we must import proper libraries.

import streamlit as st
from dataclasses import dataclass
from typing import Any, List
import datetime as datetime
import pandas as pd
import hashlib

Usage

  • Create additional user input areas in the Streamlit application.
if st.button("Add Block"):
    prev_block = pychain.chain[-1]
    prev_block_hash = prev_block.hash_block()

    # Update `new_block` so that `Block` consists of an attribute named `record`
    # which is set equal to a `Record` that contains the `sender`, `receiver`,
    # and `amount` values

    new_block = Block(
        record= Record(sender,receiver,amount),
        creator_id=42,
        prev_hash=prev_block_hash
    )

    pychain.add_block(new_block)
    st.balloons()

Screen-Shot-2022-05-08-at-12-12-52-PM.png

Screen-Shot-2022-05-08-at-12-11-46-PM.png


Contributors

Brought to you by Elgin Braggs Jr.


License

MIT

About

Built a blockchain-based ledger system, complete with a user-friendly web interface. This ledger should allow partner banks to conduct financial transactions (that is, to transfer money between senders and receivers) and to verify the integrity of the data in the ledger.

License:MIT License


Languages

Language:Python 100.0%