|
1 | 1 | # Blockchain_-_Cryptocurrency |
2 | | -Step 1 :- To run hadcoin_node_5001.py & hadcoin_node_5002.py & hadcoin_node_5003.py on Pycharm |
3 | 2 |
|
4 | | -step 2 :- select (Get method )on Postman to get blockchain |
5 | | - http://127.0.0.1:5001/get_chain |
6 | | - http://127.0.0.1:5002/get_chain |
7 | | - http://127.0.0.1:5003/get_chain |
8 | | - |
9 | | - select (POST Method) on postman |
10 | | - http://127.0.0.1:5001/connect_node |
11 | | - select body and next select to raw & JSON formate |
12 | | - enter :- |
| 3 | +## ⚡ Step 1 :- |
| 4 | +```python |
| 5 | +- To create Decentralizing network we are using Pycharm to run this code |
| 6 | +- To run this file hadcoin_node_5001.py & hadcoin_node_5002.py & hadcoin_node_5003.py on Pycharm |
| 7 | +``` |
| 8 | + |
| 9 | + |
| 10 | +## ⚡ Step 2 :- |
| 11 | +```python |
| 12 | +- select (Get method )on Postman to get Chain |
| 13 | + http://127.0.0.1:5001/get_chain |
| 14 | + http://127.0.0.1:5002/get_chain |
| 15 | + http://127.0.0.1:5003/get_chain |
| 16 | +``` |
| 17 | + |
| 18 | + |
| 19 | +## ⚡ Step 3 :- |
| 20 | +```python |
| 21 | +- Select (POST Method) on postman to connect full chain |
| 22 | + 1. http://127.0.0.1:5001/connect_node |
| 23 | + select body and next select to raw & JSON formate |
| 24 | + enter :- |
13 | 25 | { |
14 | | - "nodes": [ |
15 | | - "http://127.0.0.1:5002", |
16 | | - "http://127.0.0.1:5003" |
17 | | - ] |
| 26 | + "nodes": [ |
| 27 | + "http://127.0.0.1:5002", |
| 28 | + "http://127.0.0.1:5003" |
| 29 | + ] |
18 | 30 | } |
19 | 31 |
|
20 | | - Now blockchain are full connect to each node Decentralizing our blockchain |
21 | | - |
22 | | - Now select Get method on postman |
23 | | - http://127.0.0.1:5001/mine_block |
24 | | - Mine the block on blockchain |
25 | | - |
26 | | - now replace the original chain |
27 | | - http://192.168.106.56:5003/replace_chain |
| 32 | + 2. http://127.0.0.1:5002/connect_node |
| 33 | + select body and next select to raw & JSON formate |
| 34 | + enter :- |
| 35 | + { |
| 36 | + "nodes": [ |
| 37 | + "http://127.0.0.1:5001", |
| 38 | + "http://127.0.0.1:5003" |
| 39 | + ] |
| 40 | + } |
| 41 | + 3. http://127.0.0.1:5003/connect_node |
| 42 | + select body and next select to raw & JSON formate |
| 43 | + enter :- |
| 44 | + { |
| 45 | + "nodes": [ |
| 46 | + "http://127.0.0.1:5001", |
| 47 | + "http://127.0.0.1:5002" |
| 48 | + ] |
| 49 | + } |
28 | 50 |
|
29 | | - Now add the transactions of block |
30 | | - Select the POST method on postman |
31 | | - http://192.168.106.56:5001/add_transaction |
32 | | - and add to body of message on raw formate JSON |
| 51 | + Now blockchain are full connect to each node Decentralizing network our blockchain |
| 52 | +``` |
| 53 | + |
| 54 | + |
| 55 | +## ⚡ Step 4 :- |
| 56 | +```python |
| 57 | +- Select Get method on postman to mine new block |
| 58 | + http://127.0.0.1:5001/mine_block |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +## ⚡ Step 5 :- |
| 63 | +```python |
| 64 | +- Now check the block chain if some one add a new block or some one tempared on blockchain |
| 65 | + http://192.168.106.56:5003/replace_chain |
| 66 | + http://192.168.106.56:5002/replace_chain |
| 67 | +``` |
| 68 | + |
| 69 | + |
| 70 | +## ⚡ Step 6 :- |
| 71 | +```python |
| 72 | +- Now add create some transactions this transactions is add on Mempool on bitcon |
| 73 | + Select the POST method on postman |
| 74 | + http://192.168.106.56:5001/add_transaction |
| 75 | + Select body add to body of message on raw formate JSON |
33 | 76 | { |
34 | 77 | "sender": "Sk", |
35 | 78 | "receiver": "Yash", |
36 | 79 | "amount": 10000 |
37 | 80 | } |
38 | | - |
39 | | - pic |
40 | | - |
41 | | - Now mine the block to add this transaction on block |
42 | | - http://192.168.106.56:5001/mine_block |
43 | | - |
| 81 | +``` |
| 82 | + |
| 83 | + |
| 84 | +## ⚡ Step 7 :- |
| 85 | +```python |
| 86 | +- Now mine the new block to add this transaction on block |
| 87 | + http://192.168.106.56:5001/mine_block |
| 88 | +``` |
| 89 | + |
| 90 | + |
| 91 | +## ⚡ Step 8 :- |
| 92 | +```python |
| 93 | +- To Get full chain on blockchain using this on postman |
| 94 | + http://192.168.106.56:5001/get_chain |
| 95 | +``` |
44 | 96 | |
45 | 97 | |
0 commit comments