This demo demonstrates a federated learning using Flwr framework with a private Etherum blockchain to classify images in CIFAR-10 dataset.
The project contains the following:
To run this project successfully, you need to install the following:
venv.yml
with Anacoda promp
conda env create --file venv.yml
In ./Blockchain, compile the smart contracts by truffle compile
.
After compilation, run the promp truffle migrate --network development
to mirgrate the contract on the network.
Please help check the configuration in truffle-config.js
Ganache should be opened before running the project
Change your keys in api_key.json
- Change the direction to ./Server
- Use uvicorn promp to start a server:
uvicorn server_api:server --reload
. The server will run default onlocalhost:8000
- Access
localhost:8000/docs
to interact with the API
- Change the direction to ./Client
- Use uvicorn promp to start a client:
uvicorn client_api:app --reload --port PORT_NUMBER
. The client will run default onlocalhost:PORT_NUMBER
- Access
localhost:PORT_NUMBER/docs
to interact with the API