Skip to content

Commit

Permalink
Complete the cryptocurrency transaction algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
BroProgramerWeb3 committed Jan 6, 2024
1 parent f92b8d0 commit 68ac720
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions Blockchain_2/Create a CryptoCurrency/readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
HOW TO RUN THE PROGRAM

# Step 1:
# Step 1: Run the files
- To run the program, U have to run 3 hadcoin_node...py files separately on the terminal.

# Step 2: Get the chain
- Open the postman software
- Type these url in order to get the genesis block(first block) -> press enter:
- Use these url in order to get the genesis block(first block) -> press enter:
GET: http://127.0.0.1:5002/get_chain
GET: http://127.0.0.1:5003/get_chain
GET: http://127.0.0.1:5004/get_chain

# Step 3: Connect all the node together:
- Chose the raw feature, Json format
- Chose the raw feature of the body, Json format
- copy the url set in the nodes.json
- Paste the url set to the raw box, but have to remove to the url that has the same port to the current using port:
EX:
Expand All @@ -24,5 +24,29 @@
}
- Press enter, then repeat to other url as well.

# Step 4:
-
# Step 4: Check the chain valid or not
- Use
POST: http://127.0.0.1:5002/is_valid
POST: http://127.0.0.1:5003/is_valid
POST: http://127.0.0.1:5004/is_valid
- Get this result:
'message': 'All good. The Blockchain is valid.'
Or
'message': 'Houston, we have a problem. The Blockchain is not valid.'

# step 5: Make transaction.
- Copy and paste transaction.json file to the raw box of body feature
- Use
POST: http://127.0.0.1:5002/add_transaction

# step 6: Mine block to get the block chain
- use
GET: http://127.0.0.1:5002/mine_block

# step 6: get update to other nodes
- use
GET: http://127.0.0.1:5003/replace_chain
GET: http://127.0.0.1:5004/replace_chain


# whenever you add transaction, you have to use the url replace_chain to get the chain update, then use the url has get_chain to see full chain of blockchain.

0 comments on commit 68ac720

Please sign in to comment.