Skip to content

songwen6968/colink-privshare-dev

Repository files navigation

CoLink Privshare Dev

Distributed private database management system built with CoLink.

Mock Database Description

Table

t_transaction

Schema

transaction_id | user_id | sector_name | asset_name | asset_type | volume | volume_for_buy | volume_for_sell | price | price_for_buy | price_for_sell | is_buy | time

Example Queries

SELECT AVG(price_for_buy) FROM t_transaction WHERE user_id = 36 AND volume_for_buy >= 500
SELECT COUNT(*) FROM t_transaction WHERE asset_type = "Cash" AND is_buy = 1
SELECT SUM(volume) FROM t_transaction WHERE user_id < 12 OR asset_name = "Apple"

Requirements

  • Python 3.9
  • Pyfhel 3.4.1
  • CoLink 0.3.4

Usage

Create two new terminals and start protocol operators for the client and the server separately.

python protocol_query.py --addr <addr> --jwt <user_jwt>

Server runs a script to read and upload the database.

python provider.py <addr> <user_jwt>

Client runs a script that create an interactive interface to read a query and issue the query with a task.

python client.py <addr> <user_jwt> \
    <server user_id>

Instant Server Simulation

python run_with_instant_server.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages