-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8975036
commit 05679ba
Showing
5 changed files
with
22 additions
and
6,902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.