Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
Signed-off-by: nidhi-singh02 <[email protected]>
  • Loading branch information
nidhi-singh02 committed Sep 30, 2024
1 parent f7246c7 commit 6dc4435
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions testing/hardhat-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
- For `network`, network name as defined in hardhat.config.ts of the contract repository.

- If the smart contract has prerequisites or dependencies, there are two options:
1) If the contracts repository has their dependency in built, provide the full path till the dependency script.
1) If the contracts repository has its dependency built-in, provide the full path to the dependency script.
2) Else, to set it locally via kurtosis package. Ensure that the `dependency.sh` file inside the `dependency` folder is completed.

Set the `dependency` `type` to "git" or "local". This is necessary when additional setup is required before deployment.

## Example for GitHub hosted repository having dependency in the local kurtosis package
```

```yaml
deployment:
repository: "github.com/nidhi-singh02/CrocSwap-protocol" # give repo name if there are submodules, else give the folder till contracts
contracts_path: "" # give the path till contracts, if the repository is the contract folder itself, then leave it empty
Expand All @@ -30,8 +31,10 @@ deployment:
type: local # type can be "local" or "git".
path: "dependency.sh" # Full path for local dependency.
```
## Example for GitHub hosted repository having dependency on Git
```
```yaml
deployment:
repository: "github.com/nidhi-singh02/CrocSwap-protocol"
contracts_path: ""
Expand Down
8 changes: 5 additions & 3 deletions testing/hardhat-deployment/dependency/dependency.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# SPDX-License-Identifier: BUSL-1.1
#
# Copyright (C) 2024, Berachain Foundation. All rights reserved.
Expand All @@ -18,6 +19,7 @@
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
# TITLE.

apk update && apk add --no-cache python3 make g++ build-base
cd /app/contracts && npm install

set -e
apk update && apk add --no-cache python3 make g++ build-base || { echo "Failed to install system packages"; exit 1; }
cd /app/contracts && npm install || { echo "Failed to install Node.js dependencies"; exit 1; }
echo "All dependencies installed successfully."

0 comments on commit 6dc4435

Please sign in to comment.