Skip to content

Commit

Permalink
create: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
berzanorg committed Apr 30, 2024
1 parent 7ff1716 commit e53dc23
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
- `NACHO_WITHRAWALS_DB_PATH`
- `NACHO_TRANSACTIONS_DB_PATH`
- `NACHO_EVENTS_DB_PATH`
- `NACHO_MEMPOOL_PATH`
- `NACHO_PROOFPOOL_PATH`
- `NACHO_EVENT_FETCHER_PROCESS_SCRIPT_PATH`
- `NACHO_PROOF_GENERATOR_PROCESS_SCRIPT_PATH`
- `NACHO_PROOF_MERGER_PROCESS_SCRIPT_PATH`
- `NACHO_PROOF_SUBMITTER_PROCESS_SCRIPT_PATH`
- `NACHO_SIGNATURE_VERIFIER_PROCESS_SCRIPT_PATH`
- `NACHO_MEMPOOL_PATH`
- `NACHO_PROOFPOOL_PATH`
15 changes: 15 additions & 0 deletions scripts/build-nacho.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

##############################################
# BUILD NACHO #
##############################################

rm -rf /nacho/bin/
mkdir -p /nacho/bin/

cargo build -p nacho-zk-rollup --release

mv ./target/release/nacho-zk-rollup /nacho/bin/


22 changes: 22 additions & 0 deletions scripts/environment-variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

##############################################
# ENVIRONMENT VARIABLES #
##############################################

export NACHO_PROOFS_PATH="/nacho/state/proofs/"
export NACHO_BALANCES_DB_PATH="/nacho/state/balances-db/"
export NACHO_LIQUIDITIES_DB_PATH="/nacho/state/liquidities-db/"
export NACHO_POOLS_DB_PATH="/nacho/state/pools-db/"
export NACHO_BURNS_DB_PATH="/nacho/state/burns-db/"
export NACHO_WITHRAWALS_DB_PATH="/nacho/state/withdrawals-db/"
export NACHO_TRANSACTIONS_DB_PATH="/nacho/state/transactions-db/"
export NACHO_EVENTS_DB_PATH="/nacho/state/events-db/"
export NACHO_MEMPOOL_PATH="/nacho/state/mempool/"
export NACHO_PROOFPOOL_PATH="/nacho/state/proofpool/"
export NACHO_EVENT_FETCHER_PROCESS_SCRIPT_PATH="/nacho/dependencies/node_modules/nacho-event-fetcher-process/build/event-fetcher-process.mjs"
export NACHO_PROOF_GENERATOR_PROCESS_SCRIPT_PATH="/nacho/dependencies/node_modules/nacho-proof-generator-process/build/proof-generator-process.mjs"
export NACHO_PROOF_MERGER_PROCESS_SCRIPT_PATH="/nacho/dependencies/node_modules/nacho-proof-merger-process/build/proof-merger-process.mjs"
export NACHO_PROOF_SUBMITTER_PROCESS_SCRIPT_PATH="/nacho/dependencies/node_modules/nacho-proof-submitter-process/build/proof-submitter-process.mjs"
export NACHO_SIGNATURE_VERIFIER_PROCESS_SCRIPT_PATH="/nacho/dependencies/node_modules/nacho-signature-verifier-process/build/signature-verifier-process.mjs"
24 changes: 24 additions & 0 deletions scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e

##############################################
# INSTALL DEPENDENCIES #
##############################################

rm -rf /nacho/dependencies/
mkdir -p /nacho/dependencies/

echo '{
"dependencies": {
"nacho-event-fetcher-process": "0.1.0",
"nacho-proof-generator-process": "0.1.0",
"nacho-proof-merger-process": "0.1.0",
"nacho-proof-submitter-process": "0.1.0",
"nacho-signature-verifier-process": "0.1.0"
}
}' > /nacho/dependencies/package.json

npm install --prefix /nacho/dependencies/



11 changes: 11 additions & 0 deletions scripts/start-mina.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e


##############################################
# START MINA #
##############################################

npm install -g zkapp-cli

zk lightnet start
17 changes: 17 additions & 0 deletions scripts/start-nacho.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e

##############################################
# START NACHO #
##############################################

# Don't forget to set those private environment variables before running this script.
# NACHO_RPC_SERVER_PORT
# NACHO_SUBMITTER_PRIVATE_KEY
# NACHO_MINA_NODE_URL
# NACHO_ROLLUP_CONTRACT_PUBLIC_KEY
# NACHO_BRIDGE_CONTRACT_PUBLIC_KEY

source ./scripts/environment-variables.sh

/nacho/bin/nacho-zk-rollup

0 comments on commit e53dc23

Please sign in to comment.