-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* contract is deployed in a separate service and address is written to a file that can be read by all parties * servers are instantiated with a contract context (address, name, source code) * Client reads the contract address from pubic data, and creates web3 Contract object to interact with the on-chain contract. * MPC servers serve a GET /inputmasks/{id} endpoint * Client queries servers for input mask shares * Makefile can be used to launch example into tmux panes for each service (ethereum blockchain, setup phase (contract deployment), MPC network, client) next: * config for public data including ethereum addresses of client and servers * authorization check for clients when they query a share * MPC server communication over network sockets * preprocessing service * cleanup note: some of the above next steps may be done at at later stage
- Loading branch information
Showing
17 changed files
with
646 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.PHONY: clean clean-test clean-pyc clean-build docs help | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
define PRINT_HELP_PYSCRIPT | ||
import re, sys | ||
|
||
for line in sys.stdin: | ||
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) | ||
if match: | ||
target, help = match.groups() | ||
print("%-20s %s" % (target, help)) | ||
endef | ||
|
||
export PRINT_HELP_PYSCRIPT | ||
|
||
|
||
|
||
help: | ||
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) | ||
|
||
clean: clean-pyc | ||
|
||
clean-pyc: ## remove Python file artifacts | ||
docker-compose run --no-deps --rm mpcnet find . -name '*.pyc' -exec rm -f {} + | ||
docker-compose run --no-deps --rm mpcnet find . -name '*.pyo' -exec rm -f {} + | ||
docker-compose run --no-deps --rm mpcnet find . -name '*~' -exec rm -f {} + | ||
docker-compose run --no-deps --rm mpcnet find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
down: ## stop and remove containers, networks, images, and volumes | ||
docker-compose down | ||
|
||
run: down ## run the example | ||
docker-compose up -d blockchain | ||
docker-compose up setup | ||
docker-compose up -d client | ||
sh follow-logs-with-tmux.sh | ||
|
||
run-without-tmux: down ## run the example | ||
docker-compose up -d blockchain | ||
docker-compose up setup | ||
docker-compose up -d client | ||
docker-compose logs --follow blockchain mpcnet client | ||
|
||
setup: down | ||
docker-compose up -d blockchain | ||
docker-compose up setup | ||
docker-compose down blockchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from pathlib import Path | ||
|
||
PARENT_DIR = Path(__file__).resolve().parent | ||
PUBLIC_DATA_DIR = "public-data" | ||
CONTRACT_ADDRESS_FILENAME = "contract_address" | ||
CONTRACT_ADDRESS_FILEPATH = PARENT_DIR.joinpath( | ||
PUBLIC_DATA_DIR, CONTRACT_ADDRESS_FILENAME | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
if [ -z $TMUX ]; then | ||
echo "tmux is not active, will start new session" | ||
TMUX_CMD="new-session" | ||
else | ||
echo "tmux is active, will launch into new window" | ||
TMUX_CMD="new-window" | ||
fi | ||
|
||
tmux $TMUX_CMD "docker-compose logs -f blockchain; sh" \; \ | ||
splitw -h -p 50 "docker-compose logs -f setup; sh" \; \ | ||
splitw -v -p 50 "docker-compose logs -f mpcnet; sh" \; \ | ||
selectp -t 0 \; \ | ||
splitw -v -p 50 "docker-compose logs -f client; sh" |
Oops, something went wrong.