- This project used Flower, Go Ethereum, Web3, IPFS, Socket, Digital signature to implement Blockchain-based federated learning
-
執行順序:
-
Run Go Ethereum Boot Node
$ bootnode --verbosity 9 --nodekey=boot.key
-
Run Miner Node, set up network id they’re connect with
- Miner 1:
$ geth --mine --miner.threads 2 --syncmode "full" --miner.gasprice=0 --networkid 8787 --bootnodes enode://bootnode -writeaddress --nodekey=boot.key@127.0.0.1:30301 --datadir miner1/data --unlock "0xca38618860d047b63592cab7CB26c6DF2554141F" --password password.txt --http --http.addr 0.0.0.0 --http.port 8547 --http.corsdomain '' --http.api 'admin,eth,net,web3,personal,miner' --ws --ws.addr 0.0.0.0 --ws.port 8548 --port 30304 --ws.origins '' --ws.api 'eth,net,web3' --nousb --allow-insecure-unlock
- Miner 2:
$ geth --mine --miner.threads 2 --syncmode "full" --miner.gasprice=0 --networkid 8787 --bootnodes enode://bootnode -writeaddress --nodekey=boot.key@127.0.0.1:30301 --datadir miner2/data --unlock "0x086e0Fcab268b9eE0C781a58D93D8de524D58fBf" --password password.txt --http --http.addr 0.0.0.0 --http.port 8549 --http.corsdomain '' --http.api 'admin,eth,net,web3,personal,miner' --ws --ws.addr 0.0.0.0 --ws.port 8549 --port 30305 --ws.origins '' --ws.api 'eth,net,web3' --nousb --allow-insecure-unlock
- Miner 1:
-
Run IPFS daemon
$ cd BCFL/ & ipfs daemon
-
Flower server-client local training
$ cd BCFL/
$ python server_8080.py
$ python client_8080.py
$ python server_8787.py
$ python client_8787.py
-
Run Task owner (socket_server)
$ python socket_server.py --deploy_contract True
-
Client(s) pass their trained local model weight (IPFS hash) to task owner for validation & aggregation
$ python socket_client.py -p="8787"
$ python socket_client.py -p="8080"
-
-
Result : Task owner會回傳新Global Model Weight IPFS Hash, update
latest_GMhash.txt
and clearhash.txt