diff --git a/app.py b/app.py new file mode 100644 index 0000000..7e02175 --- /dev/null +++ b/app.py @@ -0,0 +1,23 @@ +from flask import Flask, render_template +from blockchain import Blockchain + +my_blockchain = Blockchain() + +app = Flask(__name__) + +""" +- List transactions that are currently not in a block. +- List blocks + +""" + + +@app.route('/') +def accueil(): + chain = my_blockchain.chain + current_transactions = my_blockchain.current_transactions + return render_template('index.html', chain=chain, current_transactions=current_transactions) + + +if __name__ == '__main__': + app.run(debug=True) diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..107b3e7 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,68 @@ + + + + + + + + + My blockchain + + + +
+ + + {% for block in chain %} + + + + + + {% endfor %} + + + {% for block in chain %} + + + + + + + {% endfor %} + + +
Creation timePrevious hashNumber of transactions
{{ block.timestamp }}{{ block.previous_hash }} + {{ block.transactions | length }}
+
+ + + + +