Skip to content

ReliefChain - C++ based EOS.IO smartcontracts

Notifications You must be signed in to change notification settings

CodyDeeds/ReliefChain-smartcontracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReliefChain-smartcontract

ReliefChain - C++ based EOS.IO smartcontract

DAPP based on EOS Blockchain, solving natural disaster management issues such as enabling NGO's collaborating to act on a common action plan, minimizing the double spending of limited supplies (cloth/water/medical/shelter/volunteers), real-time updating the missing database, track status of the disaster event and post-event anaylsis for potential future.

Problem

Natural disasters are events such as a flood, earthquake, or hurricane that causes significant damage or loss of life. In such events, often NGO's find it difficult to plan and distribute the required supplies such as food, water, shelter, clothes and medicine. The main reason for this is that NO common platform exists where all NGOs/volunteers/others can follow up on the event relief status on a real-time basis. They may find it difficult to know how much supplies are required, which other NGO's are actively helping and present status of missing people. Moreover, they have the double spending of limited rations problem.

Solution

Our solution, ReliefChain, enables citizens to pre-register (using bio-metrics), NGOs collaboratively come together during the time of the disaster event and create a common supply inventory list where food, water, shelter/medical support, clothes and volunteer information is prepared. The volunteers coordinating with the NGOs on site can use the same platform to authenticate registered citizens (or fresh register them) and confirm supply inventory for them, updating on the disaster event page in real-time. This will ensure less wastage of supply rations and listing of missing citizens. Post-event, the platform could be used to perform analysis to provide insights on how to better plan for the next event or other major factors to be more effective.

The main reason for using blockchain as the technology was to promote a public ledger to record missing people database (enabling friends/family to track the last location) and making NGOs transparent in terms of distribution of supplies (enabling them getting more support and improved accountability).

How we built it

We built it using EOS Blockchain platform, then a minimal nodejs based backend that calls the chain to perform actions written in smart contracts.

Technology

(a) Staring private EOS blockchain

  • Download the docker
docker pull eosio/eos-dev
  • Start the blockchain. You need to be careful about the path you mount to docker image. This will change from the path mentioned below, so please change else it wont work!
sudo docker run --rm --name eosio -p 8888:8888 -p 9876:9876 -v /Users/gautamanand/Library/Github/serganus/ReliefChain-smartcontracts:/tmp/work -v /Users/gautamanand/Library/Github/serganus/dataEOS:/mnt/dev/data -v /Users/gautamanand/Library/Github/serganus/dataEOS:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"
sudo docker logs --tail 10 eosio

(b) Compiling/Publishing/Seeding

docker exec -it eosio /bin/bash
cd /tmp/work
eosiocpp -o reliefchain/reliefchain.wast reliefchain/reliefchain.cpp
eosiocpp -g reliefchain/reliefchain.abi reliefchain/reliefchain.hpp
bash ./scripts/setup.sh
cleos wallet unlock --name default --password "${PASSWORD}" --unlock-timeout 36000
cleos set contract reliefchain reliefchain -p reliefchain
bash ./scripts/seed.sh

(c) Data Model: Smart Contracts

DATA MODEL

(d) Workflow of the DAPP

WORKFLOW

(e) Actions: Smart Contracts

WORKFLOW

(f) Tips

  • Kill the docker image and delete the mounted local folder to ensure everything is working
docker container stop eosio
docker container prune
rm -rf /Users/gautamanand/Library/Github/serganus/dataEOS

Contact

About

ReliefChain - C++ based EOS.IO smartcontracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published