Skip to content

Commit

Permalink
Create a Blockchain with python
Browse files Browse the repository at this point in the history
  • Loading branch information
BroProgramerWeb3 committed Jan 4, 2024
1 parent 8975036 commit 05679ba
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6,902 deletions.
Binary file modified .DS_Store
Binary file not shown.
22 changes: 22 additions & 0 deletions Blockchain_2/Blockchain/blockchain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# create a Blockchain.
# A blockchain is a chain of blocks that contain data or information.

# To be installed: pip install Flask
# Download Postman to test the API
# Importing the libraries
import datetime # to get the current time
import hashlib # to hash the blocks
import json # to encode the blocks before hashing
from flask import Flask, jsonify # to create the web app

# Part 1 - Building a Blockchain.
class Blockchain:
# this init like a constructor
# Self is the object that we are going to create
def __init__(self)
# create the chain
self.chain = []
self.create_block(
proof = 1,
previous_has='0'
)
Empty file removed Blockchain_2/index.js
Empty file.
Loading

0 comments on commit 05679ba

Please sign in to comment.