Skip to content

Latest commit

 

History

History
131 lines (107 loc) · 6.54 KB

README_EN.md

File metadata and controls

131 lines (107 loc) · 6.54 KB

PrimiHub

build workflow Contributors Gitter GitHub release Docker Pulls

English | 中文

Feature

PrimiHub is a platform that supports Multi-Party Computing(MPC), Federated Learning, Private set intersection (PSI), and Private Information Retrieval (PIR) features, and supports extensions of data source access, data consumption, access application, syntax, semantic and security protocols. For details, see PrimiHub core feature.

Quick Start

Run an Multi-Party Computing application in 5 minutes

Run an MPC LR case

Depolyment

Quick start without docker

Build Application Server

two options you have to choose, Download the latest release version (released binary or source code)

  1. download binary (skip build step)latest release
  2. download redis
    x86_64
    aarch64
  3. build with source code build

Attention: the release binary is compiled on os ubuntu20.04

Start Server

change to redis dir
./run_redis.sh
change dir which parallel with bazel-bin
waring !!!!!! if server is build by bazel build, before run script start_server.sh, comment the definition of PYTHONPATH
./start_server.sh

the server log will be record into log_node0, log_node1, log_node2 seperately
if all server run success, using cmd ps -ef |grep bin/node, you will see the following process

root       4915       1  0 3月13 ?        00:08:49 ./redis-server 127.0.0.1:7379
root    4172627       1  0 10:03 pts/6    00:00:00 ./bazel-bin/node --node_id=node0 --service_port=50050 --config=./config/node0.yaml
root    4172628       1  0 10:03 pts/6    00:00:00 ./bazel-bin/node --node_id=node1 --service_port=50051 --config=./config/node1.yaml
root    4172629       1  0 10:03 pts/6    00:00:00 ./bazel-bin/node --node_id=node2 --service_port=50052 --config=./config/node2.yaml

Run logistic regression based on MPC

choose one of server which is used to submit task run the follwing cmd

./bazel-bin/cli --server="${SERVER_IP}:${SERVER_PORT}" --task_config_file="example/mpc_lr_task_conf.json"
or ./client_run.sh will execute all case

Run Server with docker

Install docker and docker-compose
Download the code and switch to the code root path

git clone https://github.com/primihub/primihub.git
cd primihub

Start Server

Start three docker containers using docker-compose. The container includes: one simple bootstrap node, one redis, three nodes

docker-compose up -d

or, you could specific the container register and version, such as:

echo -e "REGISTRY=registry.cn-beijing.aliyuncs.com\nTAG=1.5.0" >> .env && docker-compose up -d

Check out the running docker container

docker-compose ps
NAME                    COMMAND                  SERVICE                 STATUS              PORTS
primihub-node0          "/bin/bash -c './pri…"   node0                   running             0.0.0.0:6666->6666/tcp, 0.0.0.0:8050->50050/tcp
primihub-node1          "/bin/bash -c './pri…"   node1                   running             0.0.0.0:6667->6667/tcp, 0.0.0.0:8051->50051/tcp
primihub-node2          "/bin/bash -c './pri…"   node2                   running             0.0.0.0:6668->6668/tcp, 0.0.0.0:8052->50052/tcp
redis                   "docker-entrypoint.s…"   redis                   running             0.0.0.0:6379->6379/tcp
simple_bootstrap_node   "/app/simple-bootstr…"   simple_bootstrap_node   running             0.0.0.0:4001->4001/tcp

Create an MPC task

Let three nodes jointly perform a logistic regression task of multi-party secure computation (MPC)

docker run --network=host -it primihub/primihub-node:latest ./primihub-cli --server=127.0.0.1:8050

💡 The node response the task

You can request computing tasks from any node in the computing cluster

💡 Available task parameters

The following parameters can be specified through primihub-cli:

  1. Which node is requested to start the task.
  2. Which shared datasets are used.
  3. What kind of private computing tasks to do.

In this example, primihub-cli will use the default parameters to request an ABY3 tripartite logistic regression test task from node 0. For the parameters that can be specified by cli, please refer to Create task

Advanced use

To learn how to start from native applications and how to use PrimiHub features to implement more applications, see Advanced Usage

Developer

  • For how to build, see Build

How to contribute

If you want to contribute to this project, feel free to create an issue at our Issue page (e.g., documentation, new idea and proposal).
Also, you can learn about our community PrimiHub Open Source Community Governance
This is an active open source project for everyone, and we are always open to everyone who want to use this system or contribute to it.

Contributors

contrib.rocks

Community

  • Wechat Official Account:

wechat_helper