For detailed information about the project, please refer to project wiki.
Start in project directory (/EthereumProject) Run the initial setup script
sh InitialSetup.sh
To install IPFS, enter these commands:
wget https://dist.ipfs.tech/kubo/v0.17.0/kubo_v0.17.0_linux-amd64.tar.gz
tar -xvzf kubo_v0.17.0_linux-amd64.tar.gz
cd kubo
sudo bash install.sh
To start IPFS:
ipfs init
ipfs daemon
source env/bin/activate
pip install flask
Currently both the website and dapps are running using a Ganache test chain
- Install Ganache (can download it from here)
- Use Quickstart in Ganache to open a new workspace
- To launch the website run connection.py (EthereumProject/App/connection/connection.py)
- Make sure IPFS is running (run
ipfs daemonin another terminal) - Visit the IP address provided in the terminal after connection.py launches
- On the website for doctor and patient addresses use any of the default addresses provided in Ganache workspace
- run the command
sudo python3 setup.py install
- All dapps are located in /EthereumProject/dapps/
- Dapp functionality is contained within a library located in /EthereumProject/library/
- Run File
- Console will show a list of account addresses to use (they are the same as the ones in Ganache workspace)
- Deploy/Transfer Contract
- Input account address for the manufacturer -> they deploy the contract on the blockchain
- Deploy contract before continuing
- After that transferring of contract ownership is done using the same input field
- Register Machine -> Create/Mint Machine NFT
- Enter path to the file you are associating the machine with
- Click "Register Machine"
- This will upload machine file to IPFS and mint an NFT associated to it to the blockchain
- Information shows on right side and in console
- Transfer Token/NFT ownership
- Enter account address of the new NFT owner
- Enter Token ID
- Click "Transfer Token"
- Run the file
- Console will show a list of account addresses to use
- Deploy Contract
- Enter Patient Account address -> Deploys/Owns the contract
- Enter Doctor Account address -> Associated with the Contract/Patient
- Click "Deploy Contract"
- Create Prescription NFT
- Enter path to the file containing prescription information
- Enter Machine Token ID -> The machine NFT that the prescription is registered to
- Click "Create Prescription"
- This will upload prescription file to IPFS and mint an NFT associated to it to the blockchain
- Run the file
- Console will show a list of account addresses to use
- Deploy Contract
- Enter Patient Account address -> Deploys/Owns their own contract/files
- Enter Doctor Account address -> Associated with Patient
- Upload Files
- Enter Machine Hash -> Reference to file location on IPFS (CID)
- Enter Machine Token ID -> The machine which produces these files
- Enter Prescription Token ID -> The Prescription NFT that is associated with the Machine producing the data files
- Enter path to directory containing files to upload (e.g. ../path/to/dir/ )
- Click "Upload Files"
- This will upload files to IPFS and mint NFTs for each of them
- Transfer Contract ownership
- Enter account address to transfer the ownership of contract to
- Transfer NFT ownership
- Enter the account address of the new owner
- Enter a select number of NFT Token IDs to transfer to the account (e.g. 1,3,6 )
- Click "Transfer NFTs"
- Run the file
- Console will show a list of account addresses to use
- Deploy Contract
- Enter Doctor Account address -> Deploys/owns Contract
- Click "Deploy Contract"
- Add Patient
- Enter Patient Account address -> Patient is associated with this Doctor
- Click "Add New Patient"
- This will check whether patient account address is already registered
- If yes, it will return data contract and prescription contract addresses on the blockchain associated with this patient
- If no, new data and prescription contracts will be deployed to the blockchain and their addresses will be returned
- This will check whether patient account address is already registered
- Run the file
- Select contract type
- Click "Get Contract History"
- History for that contract appears in the text box