-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into david/actors-update
- Loading branch information
Showing
16 changed files
with
676 additions
and
43 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,119 @@ | ||
# ================================================================================ | ||
# [Shared Settings] | ||
|
||
# Services to be started during the deployment | ||
# Leaving it blank will default to 'deployer, worker' | ||
# Options are: administrator, client, deployer, optimist, worker | ||
export DEPLOYMENT_SERVICES= | ||
|
||
# The network name defined for this deployment | ||
# Information related to this network is present in config/default.js. See the README.md for additional details | ||
# Required! | ||
export ETH_NETWORK=blockchain | ||
|
||
# The Ethereum address to be used during the deployment | ||
# Required! | ||
export ETH_ADDRESS=0x9C8B2276D490141Ae1440Da660E470E7C0349C63 | ||
|
||
# The private key related to the Ethereum address set in ETH_ADDRESS | ||
# Required! | ||
export ETH_PRIVATE_KEY=0x4775af73d6dc84a0ae76f8726bda4b9ecf187c377229cb39e1afa7a18236a69e | ||
|
||
# The blockchain the services will connect to | ||
# Required! | ||
export BLOCKCHAIN_URL=ws://blockchain:8546 | ||
|
||
# Sets the default gas value and price | ||
# Leaving it blank will fallback to the defined defaults | ||
export GAS= | ||
export GAS_PRICE= | ||
|
||
# Text free variable indicating the environment name | ||
export ENVIRONMENT=localhost | ||
|
||
# Log level | ||
export LOG_LEVEL= | ||
|
||
# If the logging of HTTP payload is enabled | ||
export LOG_HTTP_PAYLOAD_ENABLED= | ||
|
||
# If the HTTP full data payload should be logged | ||
export LOG_HTTP_FULL_DATA= | ||
|
||
# Number of times the app will try to get the contracts info before giving up | ||
export AUTOSTART_RETRIES= | ||
|
||
# Used by the client & deployer services - defines the 'worker' host. | ||
# Leave it blank to get the one started in the docker-compose | ||
export CIRCOM_WORKER_HOST= | ||
|
||
# Used by the client & optimist services | ||
# Set to 'true' so that client will not wait for the blockchain to initialize | ||
export USE_EXTERNAL_NODE= | ||
|
||
|
||
# ================================================================================ | ||
# [Administrator] | ||
|
||
# MongoDB database connection string | ||
# Leaving it blank will make the app connect to the mongodb started by the docker-compose | ||
export ADMIN_MONGO_URL= | ||
|
||
|
||
# ================================================================================ | ||
# [Client] | ||
|
||
# MongoDB database connection string | ||
# Leaving it blank will make the app connect to the mongodb started by the docker-compose | ||
export CLIENT_MONGO_URL= | ||
|
||
# Optimist host the client will connect to | ||
# Leaving it blank will make the app connect to the mongodb started by the docker-compose | ||
export OPTIMIST_HOST= | ||
export OPTIMIST_PORT= | ||
|
||
# If the queue should be enabled | ||
# Leaving it blank will make the apps connect to the RabbitMQ instance | ||
export ENABLE_QUEUE= | ||
|
||
# RabbitMQ host the client will connect to | ||
# Leaving it blank will make the app connect to the mongodb started by the docker-compose | ||
export RABBITMQ_HOST= | ||
export RABBITMQ_PORT= | ||
|
||
|
||
# ================================================================================ | ||
# [Deployer] | ||
|
||
# The L2 Token ID that was defined in the settings ('config/default.js') to be used to pay the fees. See nightfall-deployer/README.md. | ||
# Required! | ||
FEE_L2_TOKEN_ID= | ||
|
||
# When submitting a transaction, Nightfall verifies if the sender address is sanctioned on Chainalysis sanctions screening oracle | ||
# If set to 'true', a mocked sanctions contract will be deployed, otherwise the Chainalysis sanctions oracle will be used instead. | ||
# Required! | ||
export DEPLOY_MOCKED_SANCTIONS_CONTRACT= | ||
|
||
# It is enabled by default. Set to 'disable' to disable the whitelisting process. See docs/whitelist.md | ||
export WHITELISTING= | ||
|
||
# The number of Approvers required to authorise `onlyOwner` transactions. See nightfall-administrator/README.md. | ||
# Required! | ||
export MULTISIG_SIGNATURE_THRESHOLD= | ||
|
||
# A comma separated Ethereum addresses list of the approvers | ||
# Leave it blank if no approvers are needed | ||
export MULTISIG_APPROVERS= | ||
|
||
# If the Trusted Setup should always run during the deployment | ||
export ALWAYS_DO_TRUSTED_SETUP= | ||
|
||
# If for some reason the contracts deployment went well, but the cirtuits didn't finish well, set to 'true' to skip the contracts' deployment | ||
export SKIP_DEPLOYMENT= | ||
|
||
# If the deployment to run will upgrade contracts | ||
export UPGRADE_CONTRACTS= | ||
|
||
# When set to anything different of 'false', deploys the Smart Contract mocks, and funds some contracts and users (for Testing) | ||
# Defaults to 'true' if left blank | ||
export DEPLOY_MOCK_TOKENS=false |
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 |
---|---|---|
|
@@ -16,3 +16,4 @@ typechain-types/ | |
config/geth/data | ||
backup/ | ||
coverage/ | ||
docker/volumes |
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,78 @@ | ||
#! /bin/bash | ||
set -e | ||
|
||
# select a Geth or Ganache client | ||
if [ -z "$1" ]; then | ||
echo "Please, inform the .env file to be used for deploying!" | ||
exit 1 | ||
fi | ||
|
||
DEPLOYMENT_ENV_FILE=$1 | ||
|
||
if [ -z "${DEPLOYMENT_SERVICES}" ]; then | ||
DEPLOYMENT_SERVICES=$(cat ${DEPLOYMENT_ENV_FILE} | sed -n -e 's/^export DEPLOYMENT_SERVICES=//p') | ||
|
||
if [ -z "${DEPLOYMENT_SERVICES}" ]; then | ||
DEPLOYMENT_SERVICES="deployer,worker" | ||
fi | ||
fi | ||
|
||
if [ -z "${NO_SERVICES_SETUP}" ]; then | ||
echo -e "Building applications...\n" | ||
|
||
# Install node dependencies | ||
npm ci | ||
|
||
# build common-files | ||
cd common-files && npm ci && cd .. | ||
|
||
OS_ARCH=$(uname -m) | ||
NO_CACHE_FLAG='' | ||
|
||
# Workaround when building in a Mac | ||
if [ $OS_ARCH != "x86_64" ]; then | ||
NO_CACHE_FLAG='--no-cache' | ||
fi | ||
|
||
echo -e "Building the contaners's images: ${DEPLOYMENT_SERVICES}\n" | ||
|
||
docker build ${NO_CACHE_FLAG} -t ghcr.io/eyblockchain/local-circom -f docker/circom.Dockerfile . | ||
|
||
if [[ "${DEPLOYMENT_SERVICES}" == *"deployer"* ]]; then | ||
docker-compose -f docker/docker-compose.deployment.yml --env-file $DEPLOYMENT_ENV_FILE build ${NO_CACHE_FLAG} deployer | ||
fi | ||
|
||
if [[ "${DEPLOYMENT_SERVICES}" == *"worker"* ]]; then | ||
docker-compose -f docker/docker-compose.deployment.yml --env-file $DEPLOYMENT_ENV_FILE build ${NO_CACHE_FLAG} worker | ||
fi | ||
|
||
if [[ "${DEPLOYMENT_SERVICES}" == *"administrator"* ]]; then | ||
docker-compose -f docker/docker-compose.deployment.yml --env-file $DEPLOYMENT_ENV_FILE build ${NO_CACHE_FLAG} administrator | ||
fi | ||
|
||
if [[ "${DEPLOYMENT_SERVICES}" == *"client"* ]]; then | ||
docker-compose -f docker/docker-compose.deployment.yml --env-file $DEPLOYMENT_ENV_FILE build ${NO_CACHE_FLAG} client | ||
fi | ||
|
||
if [[ "${DEPLOYMENT_SERVICES}" == *"optimist"* ]]; then | ||
docker-compose -f docker/docker-compose.deployment.yml --env-file $DEPLOYMENT_ENV_FILE build ${NO_CACHE_FLAG} optimist | ||
fi | ||
|
||
echo -e "Build finished!\n" | ||
fi | ||
|
||
echo -e "Creating volumes folders...\n" | ||
|
||
# create the volumes folders | ||
mkdir -p docker/volumes/build | ||
mkdir -p docker/volumes/proving_files | ||
|
||
echo -e "Starting the services: ${DEPLOYMENT_SERVICES}\n" | ||
|
||
DEPLOYMENT_COMPOSER_FILES="-f docker/docker-compose.deployment.yml" | ||
|
||
docker-compose $DEPLOYMENT_COMPOSER_FILES --env-file $DEPLOYMENT_ENV_FILE -p 'nightfall_3' up -d ${DEPLOYMENT_SERVICES//,/ } | ||
|
||
echo -e "Deployment services started!\n" | ||
|
||
docker-compose -p 'nightfall_3' $DEPLOYMENT_COMPOSER_FILES --env-file $DEPLOYMENT_ENV_FILE logs -f ${DEPLOYMENT_SERVICES//,/ } |
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
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# Checking sanctions list | ||
|
||
Nightfall automatically checks the Chainalysis sanctions screening oracle [contract](https://go.chainalysis.com/chainalysis-oracle-docs.html#:~:text=The%20Chainalysis%20oracle%20is%20a,included%20in%20a%20sanctions%20designation). | ||
When submitting a transaction, Nightfall automatically checks the sender address against Chainalysis sanctions screening oracle [contract](https://go.chainalysis.com/chainalysis-oracle-docs.html#:~:text=The%20Chainalysis%20oracle%20is%20a,included%20in%20a%20sanctions%20designation). | ||
|
||
Although this check arguably forms part of a KYC check, it is not done via the KYC interface. This is because the sanctions contract already exposes its own interface, and manages its own blacklisting, thus there is nothing for Nightfall to do, other than to check the mapping held by the Chainalysis contract via the `SanctionsListInterface.sol` interface. | ||
|
||
When testing, Nightfall uses a stub contract to simulate the Chainalysis one. This has one sanctions-listed user (set in the default config's `TEST_OPTIONS` section) for test purposes. Nightfall will autmatically deploy this stub if the default config `SANCTIONS_CONTRACT` constant is set to anything other than an Ethereum address, in which case it will not deploy a stub but will call the sanctions list interface at that address. | ||
|
||
|
||
When testing, Nightfall can use a stub contract to simulate the Chainalysis one. This has one sanctions-listed user (set in the default config's `TEST_OPTIONS` section) for test purposes. The environment variable `DEPLOY_MOCKED_SANCTIONS_CONTRACT` allows one to control which contract will be used in the deployment - setting to `true` will make Nightfall to use the stub (mocked contract), while setting it to `false` will make it to use the Chainalysis one. |
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
Oops, something went wrong.