borisflesch / baas-consent-management

Blockchain as a Service for Consent Management in Clinical Trials (investigation as part of my MSc Dissertation project; not intended for production usage)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BaaS for Consent Management for Clinical Trials

Requirements

Quickstart

  1. Clone this repository
  2. Open four terminals in folders blockchain-besu/node-{1,2,3,4}
  3. Run the command besu --config-file=config.toml in each terminal to start the four nodes of the blockchain (which are pre-configured)
  4. Navigate to baas-api
  5. Run the command truffle migrate --network besu --reset to compile and deploy the smart contract
  6. Run the following commands to install dependencies and start the server:
npm install
npm run start

Fetch and decode data from a TXH (transaction hash)

  1. Navigate to the folder baas-api
  2. Run the following command: node txh-decode.js <txh>

Output example for node txh-decode.js 0xfbf439b8d5adbc2e853dc04abbdcf1409d087544c6234153100436efb24a5279:

{
  "name": "requestConsent",
  "params": [
    {
      "name": "_patientAddr",
      "value": "0xe8faea3207b2c31c6d238b25e35219fbd318582a",
      "type": "address"
    },
    { "name": "_clinicalTrialId", "value": "1", "type": "uint256" },
    { "name": "_parentId", "value": "0", "type": "uint256" },
    { "name": "_expiresAt", "value": "1629208887", "type": "uint256" },
    { "name": "_additionalInformation", "value": "", "type": "string" },
    { "name": "_additionalArtifacts", "value": "", "type": "string" }
  ]
}

About

Blockchain as a Service for Consent Management in Clinical Trials (investigation as part of my MSc Dissertation project; not intended for production usage)


Languages

Language:Solidity 51.4%Language:JavaScript 48.6%