File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change
1
+ import time
1
2
from flask import Flask , render_template
2
3
from network_integration import run
3
4
4
- # my_blockchain, network = run()
5
-
6
5
app = Flask (__name__ )
7
6
8
7
"""
12
11
"""
13
12
14
13
15
- # @app.route('/')
16
- # def accueil():
17
- # chain = my_blockchain.chain
18
- # current_transactions = my_blockchain.current_transactions
19
- # return render_template('index.html', chain=chain, current_transactions=current_transactions)
14
+ @app .route ('/' )
15
+ def accueil ():
16
+ my_blockchain , network = run ()
17
+
18
+ chain = my_blockchain .chain
19
+ current_transactions = my_blockchain .current_transactions
20
+ return render_template ('index.html' , chain = chain , current_transactions = current_transactions )
20
21
21
22
22
23
if __name__ == '__main__' :
Original file line number Diff line number Diff line change @@ -32,4 +32,5 @@ def run():
32
32
return bc , network
33
33
34
34
35
- run ()
35
+ if __name__ == '__main__' :
36
+ run ()
Original file line number Diff line number Diff line change 19
19
< th class ="p-3 text-left "> Creation time</ th >
20
20
< th class ="p-3 text-left "> Previous hash</ th >
21
21
< th class ="p-3 text-left " width ="110px "> Number of transactions</ th >
22
+ < th > transactions</ th >
22
23
</ tr >
23
24
{% endfor %}
24
25
</ thead >
29
30
< td class ="border-grey-light border hover:bg-gray-100 p-3 truncate "> {{ block.previous_hash }}</ td >
30
31
< td class ="border-grey-light border hover:bg-gray-100 p-3 truncate ">
31
32
{{ block.transactions | length }}</ td >
33
+
34
+ < td >
35
+ {% for transaction in block.transactions %}
36
+ {{ transaction.value }} - {{ transaction }}
37
+ {% endfor %}
38
+ </ td >
32
39
<!-- <td
33
40
class="border-grey-light border hover:bg-gray-100 p-3 text-blue-400 hover:text-blue-600 hover:font-medium cursor-pointer">
34
41
See more</td> -->
35
42
</ tr >
36
43
{% endfor %}
37
-
38
44
</ tbody >
39
45
</ table >
46
+
47
+ <!-- current transactions -->
48
+ < table class ="w-full flex flex-row flex-no-wrap sm:bg-white rounded-lg overflow-hidden sm:shadow-lg my-5 ">
49
+ </ table >
40
50
</ div >
41
51
</ body >
42
52
You can’t perform that action at this time.
0 commit comments