Sample Dapp for the thesis "DNA-Sharing-Chain: A Privacy Preserving DNA Sequence Sharing Ecosystem".
- OS: Ubuntu 20.04.5 LTS
- Node: v20.11.1
- NVM: 0.39.1
- Ganache: 7.9.2 (@ganache/cli: 0.10.2, @ganache/core: 0.10.2)
- Truffle
- Truffle v5.11.5 (core: 5.11.5)
- Ganache v7.9.1
- Solidity - 0.8.13 (solc-js)
- Node v20.11.1
- Web3.js v1.10.0
- Browserify: 17.0.0
- Metamask browser extension
-
Install ganache & truffle
npm install -g ganache
npm install -g truffle
-
Build up ganache network
ganache -s 0 --gasPrice 0 --blockTime 0.5
-
Deploy smart contracts
cd did_chain/
truffle migrate
-
Install fablo environment
- Put the fablo script at
/app_chain/
.
- Put the fablo script at
-
Build up hyperledger fabric network
cd app_chain/
./fablo up
-
To shut down the network
./fablo down
-
To clean all data
./fablo prune
- You should do this after modifying chaincodes.
-
-
Parse ABI files
cd did_chain/
node parse_abi.js
- The ABI files (*.abi.js) will be generated at
/app/public/javascripts/
.
- The ABI files (*.abi.js) will be generated at
-
Bundle up packages
cd bundle_files/
npm install
npm run build
- The bundle files (*.bundle.js) will be generated at
/app/public/javascripts/
.
- The bundle files (*.bundle.js) will be generated at
-
Start the Dapp
cd app/
npm install
npm start
-
Open browser.
- DID-Chain: http://localhost:3000/did
- APP-Chain: http://localhost:3000/ or http://localhost:3000/app/
-
If you get an error like
2024-07-06T12:46:53.547Z - error: [DiscoveryResultsProcessor]: parseDiscoveryResults[access-control-channel] - Channel:access-control-channel received discovery error:access denied...
Delete the folder
/app/routes/wallet/
and restart the system again.
-
Generate sample data in VCF format. Written in C++.
cd data_generator/
./data_generator.cpp <output_file_path> <record_number>
Generate CSR and private key by OpenSSL.
openssl ecparam -name prime256v1 -genkey -noout -out key.pem
openssl req -new -sha256 -key key.pem -nodes -nodes -out key.csr