/mine.js

Federated Learning Client + User Data Warehouse

Primary LanguageJavaScriptApache License 2.0Apache-2.0

mine.js 🗻⚒

Test Status Coverage

nodeJS implementation of an OpenMined data mine

⬆️ Setup

🎬 Prerequisites

  • the npm install requires a python executable >= v2.5.0 & < 3.0.0 (child-dep of web3)
  • The code was developed using node v8.1.2 and it is recommend to stick around this version.

📦 Installation

# install this project
npm install
# in addition you need the syft python library installed
pip install git+https://github.com/OpenMined/Syft.git

🏃 Usage

🏁 Start

You need to start the following things before you can use your mine:

  • blockchain (testrpc for now)
  • ipfs daemon

This repository comes with a docker-compose file that allows you to bootstrap blockchain, ipfs and any other services via one command. This will also start an instance of the latest openmined/mine.js:edge docker container with all local files mounted into it. This allows development on the code with an auto-reloading docker environment.

It will not work if you install new dependencies as those are not hot-loaded. You have to restart the mine.js container to install new dependencies.

# to start the development environment
npm run dev

Alternatively you can only run the Mine (assuming you have testrpc and ipfs running somewhere):

 npm start -- --mine-address <your mine address> --contract-address <a sonar smart contract address>

You should see the following output:

mine logs

If you have the docker setup running you can access the data scientist notebook at localhost:8888 and add new models to the blockchain. Models will be stored there until you call docker-compose -f ./docker/docker-compose-dev.yml down. Use docker-compose .. stop to stop the containers without removing any stored data.

🌙 Command Line Interface

To list available commands, execute npm start -- --help:

🐞 Known Issues

  • Connection to dockerized IPFS/testrpc containers outside the docker network are unstable

⚖️ License

Apache-2.0 by OpenMined contributors. If you have valid reason for us to consider going for a more permissive license please get in touch, we're not monsters 👾