Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Remove symlinks. Add .env files #194

Merged
merged 5 commits into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -162,14 +162,6 @@ cython_debug/
#.idea/

# mpc-demo-infra
.env.coord
!mpc_demo_infra/coordination_server/docker/.env.coord
.env.party
!mpc_demo_infra/computation_party_server/docker/.env.party
.env.client_cli
!mpc_demo_infra/client_cli/.env.client_cli
.env.consumer_api
!mpc_demo_infra/data_consumer_api/docker/.env.consumer_api
*.db
!tests/proof.json
certs/
3 changes: 3 additions & 0 deletions MP-SPDZ/.gitignore
Original file line number Diff line number Diff line change
@@ -124,3 +124,6 @@ _build/
# temp doc files
doc/readme.md
doc/xml

deps
Programs/Source/share_data_*.mpc
4 changes: 2 additions & 2 deletions mpc_demo_infra/client_cli/config.py
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@ class Settings(BaseSettings):

# mpc-demo-infra/certs
certs_path: str = str(this_file_path.parent.parent / "certs")
# ../../../tlsn
tlsn_project_root: str = str(this_file_path.parent.parent.parent / "tlsn")
# project-root/tlsn
tlsn_project_root: str = str(this_file_path.parent.parent / "tlsn")
print(f"tlsn_project_root: {tlsn_project_root}")

party_web_protocol: str = "http"
6 changes: 3 additions & 3 deletions mpc_demo_infra/computation_party_server/config.py
Original file line number Diff line number Diff line change
@@ -19,14 +19,14 @@ class Settings(BaseSettings):
# In production, we need https to protect the API key from being exposed.
party_api_key: str = "1234567890"

# ../../../tlsn
tlsn_project_root: str = str(this_file_path.parent.parent.parent / "tlsn")
# project-root/tlsn
tlsn_project_root: str = str(this_file_path.parent.parent / "tlsn")

port: int = 8006
party_web_protocol: str = "http"
party_hosts: list[str] = ["127.0.0.1", "127.0.0.1", "127.0.0.1"]
party_ports: list[int] = [8006, 8007, 8008]
mpspdz_project_root: str = str(this_file_path.parent.parent.parent / "MP-SPDZ")
mpspdz_project_root: str = str(this_file_path.parent.parent / "MP-SPDZ")

fullchain_pem_path: str = "ssl_certs/fullchain.pem"
privkey_pem_path: str = "ssl_certs/privkey.pem"
2 changes: 1 addition & 1 deletion mpc_demo_infra/coordination_server/config.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ class Settings(BaseSettings):
# Database settings
database_url: str = "sqlite:///./coordination.db"

tlsn_project_root: str = str(this_file_path.parent.parent.parent / "tlsn")
tlsn_project_root: str = str(this_file_path.parent.parent / "tlsn")

# mpc-demo-infra/tlsn_proofs
tlsn_proofs_dir: str = str(this_file_path.parent.parent / "tlsn_proofs")
2 changes: 1 addition & 1 deletion run_all_servers.sh
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ poetry run consumer-api-run &
pids+=($!)

echo "Starting Notary Server..."
pushd ../tlsn/notary/target/release
pushd ./tlsn/notary/target/release
./notary-server &
notary_pid=$!
popd
41 changes: 2 additions & 39 deletions setup_env.sh
Original file line number Diff line number Diff line change
@@ -214,30 +214,6 @@ if [ "$install_rust" = true ]; then
fi
fi

# Create tlsn symbolic link if required and not present
if [ "$install_rust" = true ]; then
if [ ! -L "../tlsn" ]; then
if [ -e "../tlsn" ]; then
echo "Unable to create a symbolic link ../tlsn because ../tlsn directory or file already exists"
exit 1
fi
print "Creating symbolic link: ../tlsn -> ./tlsn"
ln -s $(pwd)/tlsn ..
fi
fi

# Create MP-SPDZ symbolic link if required and not present
if [ "$install_mpspdz" = true ]; then
if [ ! -L "../MP-SPDZ" ]; then
if [ -e "../MP-SPDZ" ]; then
echo "Unable to create a symbolic link ../MP-SPDZ because ../MP-SPDZ directory or file already exists"
exit 1
fi
print "Creating symbolic link: ../MP-SPDZ -> ./MP-SPDZ"
ln -s $(pwd)/MP-SPDZ ..
fi
fi

# Setup MP-SPDZ if so specified
if [ "$install_mpspdz" = true ]; then
# Install dependencies
@@ -248,7 +224,7 @@ if [ "$install_mpspdz" = true ]; then
fi

# Setup MP-SPDZ
spushd ../MP-SPDZ
spushd MP-SPDZ
git submodule update --init --recursive

# Add CONFIG.mine with MOD if not already present
@@ -271,7 +247,7 @@ fi

if [ "$install_rust" = true ]; then
MPC_DEMO_INFRA_ROOT=$(pwd)
spushd ../tlsn
spushd tlsn

if [ "$install_prover" = true ] || [ "$install_verifier" = true ]; then
spushd tlsn
@@ -324,18 +300,5 @@ if [ "$install_rust" = true ]; then
spopd # pushd ../tlsn
fi

# Create server confguration files
if [ "$install_target" = "$all_servers" ]; then
print "Creating server configuration files..."
for server in coord party consumer_api client_cli; do
eval "mv -f .env.${server}.example .env.${server} $OUT_REDIR"
done
else
if [ "$install_client_cfg" = true ]; then
eval "mv -f .env.client_cli.example .env.client_cli $OUT_REDIR"
print "Created .env.client_cli"
fi
fi

echo -e "\nEnvironment setup is complete."

4 changes: 2 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -58,8 +58,8 @@ def process_secret_file(secret_file):
FREE_PORTS_END = 8100
COMPUTATION_HOSTS = ["127.0.0.1"] * NUM_PARTIES
COMPUTATION_PARTY_PORTS = [COORDINATION_PORT + 1 + party_id for party_id in range(NUM_PARTIES)]
MPSPDZ_PROJECT_ROOT = Path(__file__).parent.parent.parent / "MP-SPDZ"
TLSN_PROJECT_ROOT = Path(__file__).parent.parent.parent / "tlsn"
MPSPDZ_PROJECT_ROOT = Path(__file__).parent.parent / "MP-SPDZ"
TLSN_PROJECT_ROOT = Path(__file__).parent.parent / "tlsn"
CERTS_PATH = MPSPDZ_PROJECT_ROOT / "Player-Data"

TIMEOUT_MPC = 60