Skip to content

Commit

Permalink
feat: add script run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hduoc2003 committed Dec 4, 2024
1 parent 8963db9 commit d2889f0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Once that is good and installed on your system, you can run the following comman
deployment includes ..., ... as the sequencer, and ... This process typically takes around eight to ten minutes.

```bash
kurtosis clean --all
kurtosis run --enclave apstark-v1 --args-file params.yml .
# Specify <DEPLOY_REPORT_DIR> if you set "deploy_contracts = True" in the config file "params.yml", default is "."
./run.sh <DEPLOY_REPORT_DIR>
```

Changing the configs:
Expand Down
10 changes: 5 additions & 5 deletions lib/jayce.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ def apply_default(args):

def start(plan, args, suffix):
args = apply_default(args)

name = args["name"] + suffix

output_file_path = "/app/" + args["output_file_name"]
output_file_name = "deploy-report.json"
output_file_path = "/app/" + output_file_name

# mount config files
config_file_artifact = plan.upload_files(
Expand Down Expand Up @@ -67,7 +66,7 @@ def start(plan, args, suffix):
output_file_artifact = plan.store_service_files(
service_name=name,
src=output_file_path,
name=args["output_file_name"],
name=output_file_name,
)
plan.add_service(
name="jayce-output",
Expand All @@ -76,7 +75,8 @@ def start(plan, args, suffix):

# stop jayce
plan.stop_service(name=name)
plan.stop_service(name="jayce-output")


def last_file_or_dir(path):
return path.split("/")[-1]
return path.split("/")[-1]
1 change: 0 additions & 1 deletion params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ args:
jayce:
image: sotazklabs/jayce:latest
config_file: ../static_files/jayce/deploy-contracts.toml
output_file_name: deploy-output.json
contracts:
- ../contracts/navori/libs
- ../contracts/navori/cpu-2
Expand Down
27 changes: 27 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Usage: ./run.sh [DEPLOY_REPORT_DIR]
# DEPLOY_REPORT_DIR: Optional. The directory where the deploy-report.json file will be saved. Defaults to the current directory.

# Run Apstark
kurtosis run --enclave apstark-v1 --args-file params.yml .

# Check if the command was successful
if [ $? -eq 0 ]; then
echo "Running Apstark successfully."

# Get jayce deploy output
if yq .deploy_contracts params.yml | grep -q 'true'; then
DEPLOY_REPORT_DIR="${1:-.}"

kurtosis files download apstark-v1 deploy-report.json "$DEPLOY_REPORT_DIR"

if [ $? -eq 0 ]; then
echo "Jayce deploy output downloaded successfully."
else
echo "Failed to download jayce deploy output."
fi
fi
else
echo "Failed to run Apstark"
fi

0 comments on commit d2889f0

Please sign in to comment.