Code Monkey home page Code Monkey logo

ethertrack's Introduction

EtherTrack

! This project is no longer supported !

If you are interested by the idea behind it, feel free to contact me.

Traceability system based on Ethereum Blockchain

Live at : https://ethertrack.firebaseapp.com/

Travis CI + JSHint status : alt text

Main goal

This project's goal is mainly to present a concrete example of an off-chain (Firebase) and in-chain (contracts) dynamic content management.

What is traceability ?

Identify, follow and authenticate a product throught its whole life cycle.

What is the blockchain ?

You can see the blockchain as a decentralized database composed of nodes that uses peer-to-peer to exchange data. Each transaction issued on the blockchain is validated by severales nodes and added to other blocks of validated transaction. Validated transactions are unalterable and publicly available. Ethereum blockchain allow the creation of "Smart Contract", autonomous programs hosted in the decentralized network. EtherTrack use various types of smart contract to :

  1. Register companies
  2. Modify traceability unit state
  3. Record traceability unit movements
  4. Ensure traceability unit / owner identity

Why would I want to use a traceability sytem based on Ethereum Blockchain ?

The nature of the blockchain system address a lot of issues that you must face when you work with traceability, for example :

  • Descentralized architecture to ensure data integrity
  • Smart-Contract source code can be read and approved by everyone, data can not be tampered with.
  • Data format is publicly available, anyone can build an interface and get data from the chain.

Current version

Current version features :

  • 3 Contracts : EtherTrackNS (Naming Service) EtherTrackWarehouse (Manage traceability Unit) and EtherTrackDatastore (a data store proxy)
  • A basic web site designed with Bootstrap 4 to use with Metamask. It can deploy contracts and do basic contracts calls.
  • Truffle deploy scripts and refactored contracts.

Installing

Clone repository :

git clone https://github.com/SunPaz/EtherTrack

Start Node.js web server :

node Firebase/www/NodeJS/node-server.js

Compile contracts using Truffle :

truffle compile

(optional)

Launch truffle test network :

truffle develop

Migrate contracts to network (in truffle develop console) :

migrate --reset

Launch you browser on http://localhost:8081/ and you are done !

Built with :

  • Truffle : Ethereum development framework
  • Remix : Solidity IDE
  • JQuery : Javascript library
  • Solidity : Smart contract language
  • Web3.js : Ethereum JavaScript API
  • MetaMask : Ethereum chrome extension
  • Node.js : Asynchronous event driven JavaScript runtime
  • Express : Web framework for Node.js
  • Firebase : Google's mobile platform, used to cache user preferences
  • JSHint : Used as a JS linter

ethertrack's People

Contributors

dependabot[bot] avatar matthamoros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ethertrack's Issues

"EtherTrackNS" -- invalid address (arg="parent", coderType="address", value="")

Hi all,

I had compile the contracts without error, however when migrate the following error appear?

~/EtherTrack/Truffle-project$ sudo truffle migrate
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Compiling your contracts...

Everything is up to date, there is nothing to compile.

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Starting migrations...

Network name: 'development'
Network id: 123456
Block gas limit: 0x7a1200

1_initial_migration.js

Deploying 'Migrations'

transaction hash: 0x85595dfc88ce5439193331d5e517d75c831763fa3543c935620714c7b7a09bfc
Blocks: 0 Seconds: 36
contract address: 0x6bFcEe4E364161eee217EB2dF9967C5f7Ae1e3A4
block number: 10907
block timestamp: 1556817362
account: 0x51E37247B26E1d29eaAC8E550a6b2124F11B0061
balance: 53694.00220492
gas used: 269543
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00539086 ETH

Saving migration to chain.
Saving artifacts


Total cost: 0.00539086 ETH

2_deploy_basics.js

Deploying 'owned'

transaction hash: 0x595f7180b00e9cde2180d46b804e3a45299afc4f4bf3327acd62c61da4b42d38
Blocks: 0 Seconds: 28
contract address: 0xc1F65776Cf4A22b3Aa92D609EA37e042998eFCc3
block number: 10909
block timestamp: 1556817410
account: 0x51E37247B26E1d29eaAC8E550a6b2124F11B0061
balance: 53704.00220492
gas used: 200906
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00401812 ETH

Deploying 'mortal'

transaction hash: 0x7555170c36b992e815e74919dc597c2e9405c3d0cf68c3dc888cdb9e7635867d
Blocks: 0 Seconds: 4
contract address: 0x214728d177307300C8911254023C0BCF64cea224
block number: 10910
block timestamp: 1556817441
account: 0x51E37247B26E1d29eaAC8E550a6b2124F11B0061
balance: 53714.00220492
gas used: 200267
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00400534 ETH

Saving migration to chain.
Saving artifacts


Total cost: 0.00802346 ETH

2_deploy_core.js

Replacing 'owned'

transaction hash: 0x92b2f3be6bc00c813cb335dc35c796ad5f9ea075ab560852524ad637adc66d7d
Blocks: 0 Seconds: 4
contract address: 0xA48BFdf47C645638b79a9CfB88635fabcEC2e3d4
block number: 10914
block timestamp: 1556817463
account: 0x51E37247B26E1d29eaAC8E550a6b2124F11B0061
balance: 53729.00220492
gas used: 200906
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00401812 ETH

Replacing 'mortal'

transaction hash: 0x26533a41e74782a2d227a794f9ed3ba13fcd3549d1d0890b2e294d07af963b27
Blocks: 0 Seconds: 4
contract address: 0x2d27433e38a4A3856dE73b2aB51858938329c746
block number: 10915
block timestamp: 1556817472
account: 0x51E37247B26E1d29eaAC8E550a6b2124F11B0061
balance: 53734.00220492
gas used: 200267
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00400534 ETH

Saving migration to chain.
Saving artifacts


Total cost: 0.00802346 ETH

3_deploy_business.js

Deploying 'EtherTrackNS'

Error: *** Deployment Failed ***

"EtherTrackNS" -- invalid address (arg="parent", coderType="address", value="").

at /usr/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
at processTicksAndRejections (internal/process/task_queues.js:88:5)

Truffle v5.0.14 (core: 5.0.14)
Node v12.0.0

Stock privacy

Because transactions logs are public, everyone get access to my stock.
Could you implement some kind of protected access ?

When I ran truffle compile, errors occured.

Dannys-Air:EtherTrack dannyng$ sudo truffle compile

Compiling your contracts...

✖ Fetching solc version list from solc-bin. Attempt #1
✖ Fetching solc version list from solc-bin. Attempt #2
✖ Fetching solc version list from solc-bin. Attempt #3
Error: Could not find a compiler version matching 0.5.16. Please ensure you are specifying a valid version, constraint or build in the truffle config. Run truffle compile --list to see available versions.
at VersionRange.errors (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/compilerSupplier/loadingStrategies/LoadingStrategy.js:66:1)
at VersionRange.getSatisfyingVersionFromCache (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/compilerSupplier/loadingStrategies/VersionRange.js:81:1)
at VersionRange.load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/compilerSupplier/loadingStrategies/VersionRange.js:197:1)
Truffle v5.1.46 (core: 5.1.46)
Node v12.13.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.