Git Product home page Git Product logo

gpjc-api's Introduction

GPJC API

Rust wrapper API for using fork of google/private-join-and-compute protocol.

Before running the API:

In order to build Private Join and Compute, you need to install Bazel, if you don't have it already. Follow the instructions for your platform on the Bazel website.

In order to run API, you need to install Rust, if you don't have it already. To install Rust follow instructions from this website.

For ease of use, Makefile is used for building and running the application. If you don't have it already you can install it following instructions from this webiste for Windows, or from this webiste for Linux based systems.

How to run the API:

First build the project using:

make build

Using this command will build both the private-join-and-compute protocol and the Rust API code.

After this you can start API. Depending on your operating system you will use:

make run-linux

or

make run-windows

These commands will start gpjc server on local machine(localhost).


In case of running the program on multiple machines:

  1. Use different version of google/private-join-and-compute intended for use on different machines
  2. Edit .env file and set BACKEND_API_ADDRESS value to your backend server address
  3. Edit .env file and set DNS_NAME value to DNS name of the machine that runs it (for example client1.ethernal.com)

To run the program with different address(not the localhost) for gpjc server for Windows use:

cargo run --bin gpjc-api -- <address>

For Linux based systems:

cargo run --bin gpjc-api -- <address>

To test out methods you can use(be aware of key duplication when running these commands):

  • Start gpjc server:
curl -X POST -d '{"compliance_check_id": "1", "policy_id": "1"}' -H "Content-type: application/json" http://localhost:9090/api/start-server
  • Start gpjc client:
curl -X POST -d '{"compliance_check_id": "1", "policy_id": "1", "participants": ["Comapny A", "Comapny B"], "to": "0.0.0.0:10501"}' -H "Content-type: application/json" http://localhost:9090/api/start-client

gpjc-api's People

Contributors

milos-ethernal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.