Skip to content

Johnson-Su/Certi-Chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Certi-Chain

Blockchain based authentication for luxury/artisan goods using Python

Certi-Chain allows companies to combat counterfeiting and reduce the number of fakes on the market. It uses the immutability proporty of blockchains to prevent records of existing products being tampered. Certi-Chain is cheap and easy to implement in every product, just stick a certified NFC tag onto any product to ensure that one is real!

See it live here!

There are 2 ways to try Certi-Chain

  • Easily add items to the blockchain or check if an item exists using the Cert-Chain website
  • Run the python client onto your local machine for a more polished experience, and try adding multiple nodes!

Try the program using the Certi-Chain webite

Try the program on your local machine.

Add New Nodes!

  • Once you have 2 terminals up and running from the instuctions above its time to add a new node.
    • What is a node? In this case a node just represents another computer. A blockchain is decentralized, so multiple computers are used to keep this database running. Each node needs to sync up with one another to keep up to date!
  • Open a third terminal and navigate to the same directory.
  • Start up another node by typing the following in the terminal/cmd:
    • Windows Users (cmd):
      set FLASK_APP=Node_Server.py
      flask run --port 8001
    • Linux (terminal):
      export FLASK_APP=Node_Server.py
      flask run --port 8001
  • The only difference with these commands and the commands in the above section is the port, which does not have to be 8001 but we use 8001, 8002, 8003, etc. just for simplicity.
  • Now that a new node is running we must sync it up with the other nodes.
  • Open up the terminal and type the following (Windows users should use the bash shell as it may not work on cmd)
  • Type the following:
    curl -X POST \ http://127.0.0.1:8001/register_with \ -H 'Content-Type: application/json' \ -d '{"node_address": "http://127.0.0.1:8000"}'
  • If you are starting up multiple nodes, replace 8001 before the /register_with to the port you specified when starting up the node (ex. 8002, 8003 if you are starting up more nodes).
  • This allows the new node to sync up with the other nodes.
  • Now if you add a new product to the chain and see that it updates at http://localhost:8000/chain, it should also update at http://localhost:8001/chain!

About

Blockchain based authentication for luxury/artisan goods using python

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors