Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update installation scripts for quick install #567

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install foundry-zksync
run: ./install-foundry-zksync
- name: verify
- name: Install foundry-zksync
run: |
curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash
- name: Verify installation
run: forge --version

34 changes: 12 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,25 @@ For the most effective use of our library, we recommend familiarizing yourself w

Follow these steps to quickly install the binaries for `foundry-zksync`:

**Note:** This installation overrides any existing forge and cast binaries in ~/.foundry. You can use forge without the --zksync flag for standard EVM chains. To revert to a previous installation, follow the instructions [here](https://book.getfoundry.sh/getting-started/installation#using-foundryup).
**Note:** This installation overrides any existing `forge` and `cast` binaries in `~/.foundry`. You can use `forge` without the `--zksync` flag for standard EVM chains. To revert to a previous installation, follow the instructions [here](https://book.getfoundry.sh/getting-started/installation#using-foundryup).

1. **Clone the Repository**:
Begin by cloning the `foundry-zksync` repository from GitHub. This will download the latest version of the source code to your local machine.
### 1. **Run the Installer**

```bash
git clone [email protected]:matter-labs/foundry-zksync.git
```
Run the following `curl` command, which downloads and runs the installation script:

2. **Change Directory**:
Navigate into the directory where the repository has been cloned. This is where you will run the installation commands.
```bash
curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash
```

```bash
cd foundry-zksync
```
This command will download the latest `foundry-zksync` binaries (`forge` and `cast`) and set them up on your system.

3. **Run the Installer**:
Now, you're ready to execute the installation script. This command initializes the setup and installs `foundry-zksync` binaries `forge` and `cast`.
### 2. **Verify the Installation** (Recommended)

```bash
./install-foundry-zksync
```
After installation, it's recommended to verify that the binaries have been installed correctly. Run the following command to check the installed version:

4. **Verify the Installation** (Recommended):
After installation, it's good practice to verify that the binaries have been installed correctly. Run the following command to check the installed version:

```bash
forge --version
```
```bash
forge --version
```

This should return the installed version of `forge`, confirming that `foundry-zksync` is installed properly on your system.

Expand Down
2 changes: 1 addition & 1 deletion foundryup-zksync/foundryup-zksync
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ EOF
# Install by cloning the repo with the provided branch/tag
else
need_cmd cargo
FOUNDRYUP_BRANCH=${FOUNDRYUP_BRANCH:-dev}
FOUNDRYUP_BRANCH=${FOUNDRYUP_BRANCH:-main}
REPO_PATH="$FOUNDRY_DIR/$FOUNDRYUP_REPO"

# If repo path does not exist, grab the author from the repo, make a directory in .foundry, cd to it and clone.
Expand Down
2 changes: 1 addition & 1 deletion foundryup-zksync/install
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FOUNDRY_DIR="${FOUNDRY_DIR-"$BASE_DIR/.foundry"}"
FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin"
FOUNDRY_MAN_DIR="$FOUNDRY_DIR/share/man/man1"

BIN_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/dev/foundryup-zksync/foundryup-zksync"
BIN_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/foundryup-zksync/foundryup-zksync"
BIN_PATH="$FOUNDRY_BIN_DIR/foundryup-zksync"

# Create the .foundry bin directory and foundryup binary if it doesn't exist.
Expand Down
9 changes: 7 additions & 2 deletions install-foundry-zksync
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

set -e

echo "Navigating to the foundryup-zksync script..."
cd foundryup-zksync
# URLs to the raw files on GitHub
INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/foundryup-zksync/install"
FOUNDRYUP_ZKSYNC_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/foundryup-zksync/foundryup-zksync"

# Download the install script
echo "Downloading the install script..."
curl -L "$INSTALL_SCRIPT_URL" -o install

echo "Making install script executable..."
chmod +x ./install
Expand Down