- Node.js (tested on v16.5.0) — https://nodejs.org/
- Hyperledger Besu — https://besu.hyperledger.org/en/stable/HowTo/Get-Started/Installation-Options/Install-Binaries/
- Truffle — https://www.npmjs.com/package/truffle
- Clone this repository
- Open four terminals in folders
blockchain-besu/node-{1,2,3,4}
- Run the command
besu --config-file=config.toml
in each terminal to start the four nodes of the blockchain (which are pre-configured) - Navigate to
baas-api
- Run the command
truffle migrate --network besu --reset
to compile and deploy the smart contract - Run the following commands to install dependencies and start the server:
npm install
npm run start
- Navigate to the folder
baas-api
- 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" }
]
}