Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghaven committed Apr 30, 2024
0 parents commit e6c6ce5
Show file tree
Hide file tree
Showing 2,061 changed files with 507,656 additions and 0 deletions.
598 changes: 598 additions & 0 deletions .github/workflows/create-release.yaml

Large diffs are not rendered by default.

162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

contract_deploy_info.json
76 changes: 76 additions & 0 deletions A1_contracts_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash


NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'


set -e


echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Building PubSub contracts...${NC}"
make -C pubsub-onchain
echo -e "${GREEN}PubSub contracts built.${NC}"
echo -e "${GREEN}=========================================================${NC}"

echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Building Revoker contracts...${NC}"
make -C revoker-onchain
echo -e "${GREEN}Revoker contracts built.${NC}"
echo -e "${GREEN}=========================================================${NC}"

echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Building End2EndLatency tests contracts...${NC}"
make -C Revoker/tests/End2EndLatency/contracts/
echo -e "${GREEN}End2EndLatency tests contracts built.${NC}"
echo -e "${GREEN}=========================================================${NC}"


echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Setting up Python virtual environment...${NC}"
if [ -d "venv" ]; then
echo -e "${YELLOW}venv directory already exists. Skipping creation.${NC}"
else
echo -e "${GREEN}Creating venv directory...${NC}"
python3 -m venv venv
fi
./venv/bin/python3 -m pip install --upgrade pip
echo -e "${GREEN}Python virtual environment setup complete.${NC}"
echo -e "${GREEN}=========================================================${NC}"


echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Installing Python requirements for PubSub contracts gas eval...${NC}"
./venv/bin/python3 -m pip install --requirement pubsub-onchain/utils/gas_cost_eval_requirements.txt
echo -e "${GREEN}Python requirements for PubSub contracts gas eval installed.${NC}"
echo -e "${GREEN}=========================================================${NC}"


echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Installing Python requirements for Revoker contracts gas eval...${NC}"
./venv/bin/python3 -m pip install --requirement revoker-onchain/utils/gas_cost_eval_requirements.txt
echo -e "${GREEN}Python requirements for Revoker contracts gas eval installed.${NC}"
echo -e "${GREEN}=========================================================${NC}"


echo ""
echo ""
echo -e "${GREEN}####################${NC}"
echo -e "${GREEN}Contracts setup complete.${NC}"
echo -e "${GREEN}####################${NC}"
echo ""
39 changes: 39 additions & 0 deletions A2_contracts_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash


NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'


set -e

echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}PubSub contracts gas evaluation...${NC}"
pushd pubsub-onchain
echo -e "${YELLOW}Running GasCostEvalMultiSubs.py...${NC}"
../venv/bin/python3 tests/GasCostEvalMultiSubs.py
echo -e "${YELLOW}Running GasCostEvalMultiPubs.py...${NC}"
../venv/bin/python3 tests/GasCostEvalMultiPubs.py
echo -e "${YELLOW}Running GasCostEvalDeploy.py...${NC}"
../venv/bin/python3 tests/GasCostEvalDeploy.py
echo -e "${YELLOW}Running GasCostEvalPlot.py...${NC}"
../venv/bin/python3 tests/GasCostEvalPlot.py
popd
echo -e "${GREEN}PubSub contracts gas evaluation complete.${NC}"
echo -e "${GREEN}=========================================================${NC}"


echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Revoker contracts gas evaluation...${NC}"
pushd revoker-onchain
echo -e "${YELLOW}Running GasEvalEnclaveRevoker.py...${NC}"
../venv/bin/python3 utils/GasEvalEnclaveRevoker.py
echo -e "${YELLOW}Running GasEvalKeyRevoker.py...${NC}"
../venv/bin/python3 utils/GasEvalKeyRevoker.py
popd
echo -e "${GREEN}Revoker contracts gas evaluation complete.${NC}"
echo -e "${GREEN}=========================================================${NC}"
30 changes: 30 additions & 0 deletions B1_offchain_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash


set -e


NC='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'


echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Building off-chain broker${NC}"
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -B Ethereum/build -S Ethereum
cmake --build Ethereum/build --config Release
echo -e "${GREEN}off-chain broker build complete.${NC}"
echo -e "${GREEN}=========================================================${NC}"


echo ""
echo ""
echo -e "${GREEN}=========================================================${NC}"
echo -e "${GREEN}Building off-chain revoker${NC}"
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -B Revoker/build -S Revoker
cmake --build Revoker/build --config Release
echo -e "${GREEN}off-chain revoker build complete.${NC}"
echo -e "${GREEN}=========================================================${NC}"
Loading

0 comments on commit e6c6ce5

Please sign in to comment.