-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f863e9
commit 0326651
Showing
26 changed files
with
534 additions
and
755 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,140 @@ | ||
--- | ||
title: Getting Started | ||
description: Learn to build and deploy smart contracts on zkSync Era. | ||
--- | ||
|
||
Welcome to the Quickstart Guide for deploying smart contracts on zkSync! | ||
In this guide, we'll walk you through the process of creating and deploying a simple smart contract that creates a crowdfunding campaign for Zeek. | ||
|
||
By the end of the series, you will learn integral pieces that will | ||
help you become a great developer on zkSync! You will learn how to: | ||
|
||
:check-icon Initialize a new project with zksync-cli | ||
|
||
:check-icon Deploy contracts on zkSync Era using Hardhat or Foundry. | ||
|
||
:check-icon Test your contracts with Hardhat or Foundry. | ||
|
||
:check-icon Implement upgradable patterns for your contracts. | ||
|
||
:check-icon Implement a Paymaster to simplify transactions for your users. | ||
|
||
## Install zksync-cli | ||
|
||
Our Quickstart Guide series utilizes the `zksync-cli` to help you develop and interact with zkSync from your local machine. | ||
<!-- TODO: update link --> | ||
<!-- Check out our [zksync-cli section](/content/tooling/zksync-cli) to learn more on how to use the CLI. --> | ||
|
||
You will need to install a couple tools to effectively use `zksync-cli`: | ||
|
||
#### Install Node.js or Bun.sh | ||
|
||
You will need either Node.js or Bun.sh. | ||
The choice depends on your project's requirements and personal preference for package management and execution speed. | ||
If you are unfamiliar with both, choose Node.js. | ||
|
||
- Node.js | ||
- Download the Long-Term Support (LTS) version from the :external-link{text="official Node.js website" href="https://nodejs.org/en/download"}. | ||
- For first-time users, the :external-link{text="Node.js usage guide" href="https://nodejs.org/api/synopsis.html#usage"} | ||
offers comprehensive instructions on getting started. | ||
- Bun.sh | ||
- Obtain the latest version from the :external-link{text="Bun installation page" href="https://bun.sh/docs/installation"}. | ||
Bun.sh is known for its high performance and modern JavaScript features. | ||
|
||
### Setup era local node (optional) | ||
|
||
Our Quick Start series will have you compile and deploy contracts to | ||
zkSync Sepolia testnet which requires you to have ETH in your wallet for funding transactions. | ||
Our `zksync-cli` tool provides a way for you to setup a test node locally. | ||
This era local node allows for quicker testing and debugging processes without incurring testnet transaction costs. | ||
|
||
#### Install Docker | ||
|
||
The era local node will need Docker to run locally on your machine. | ||
Download the appropriate version from the :external-link{text="Docker website" href="https://docs.docker.com/engine/install/"}. | ||
|
||
#### Run a local zkSync Era node | ||
|
||
Run the following command in your terminal: | ||
|
||
```bash | ||
zksync-cli dev start | ||
``` | ||
|
||
Choose "In memory node" to deploy a local zkSync Era node in a Docker container. | ||
|
||
The local era node will also include pre-configured rich wallets for use, | ||
<!-- TODO: update link --> | ||
<!-- visit [era-test-node rich wallets](https://era.zksync.io/docs/tools/testing/era-test-node.html#use-pre-configured-rich-wallets) --> | ||
|
||
Your local zkSync Era node is accessible at **[http://127.0.0.1:8011](http://127.0.0.1:8011/)**, ready for deployment or testing purposes. | ||
|
||
## Choose Hardhat or Foundry | ||
|
||
Our Quickstart series provides two options for your learning process using | ||
either Hardhat or Foundry. Pick one to use and stick with as you go through | ||
each of the guides. | ||
|
||
<!-- Create a component that sets which tool they use and pre-set the tabs --> | ||
|
||
### Install foundry-zksync | ||
|
||
If you choose to use Foundry for the Quick Start series, you will need to | ||
install the `foundry-zksync` tool. This tool is a specialized fork of Foundry, tailored for zkSync. | ||
It extends Foundry's capabilities for Ethereum app development to support zkSync, | ||
allowing for the compilation, deployment, testing, and interaction with smart contracts on zkSync. | ||
|
||
::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} | ||
`foundry-zksync` is still in an alpha stage, so some features might not be fully supported | ||
yet and may not work as fully intended. It is open-sourced and contributions are welcome. | ||
:: | ||
|
||
Install `foundry-zksync` with the following command: | ||
<!-- TODO: @dutterbutter this should be a single curl command --> | ||
```bash | ||
curl -L https://foundry-zksync.zksync.io | bash | ||
``` | ||
|
||
## Fund your wallet | ||
|
||
If you did not set up a local era node for development and plan to use zkSync Sepolia testnet, you will need testnet ETH to fund transactions. | ||
|
||
1. Obtaining Testnet ETH: | ||
|
||
- Use the [LearnWeb3 faucet](https://learnweb3.io/faucets/zksync_sepolia/) | ||
to directly receive testnet ETH on zkSync Sepolia. | ||
- Alternatively, acquire SepoliaETH from [recommended faucets](https://www.notion.so/tooling/network-faucets.md) and | ||
transfer it to the zkSync Sepolia testnet via the [zkSync bridge](https://portal.zksync.io/bridge/?network=sepolia). | ||
|
||
1. Verify your balance: | ||
|
||
- Check your wallet's balance using the [zkSync Sepolia explorer](https://sepolia.explorer.zksync.io/). | ||
|
||
## Configure your wallet in a project | ||
|
||
To deploy contracts, you'll need to securely add your wallet's private key to the project environment. Follow these steps when you set up a new project: | ||
|
||
1. **Extract Your Private Key:** | ||
<!-- markdownlint-disable-next-line MD013 --> | ||
- If you are using the local era node, use a private key from the available rich accounts. Otherwise, find your personal wallet's private key. For MetaMask users, here's how to :external-link{ text="export your wallet's private key" href="https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key" }. | ||
|
||
1. **Prepare the Environment File:** | ||
- Locate the **`.env-example`** file in your project directory. | ||
- Rename this file to **`.env`**. | ||
|
||
1. **Add Your Private Key:** | ||
- Open the `.env` file and add your private key in the following format: | ||
|
||
```sh | ||
WALLET_PRIVATE_KEY=your_private_key_here | ||
``` | ||
|
||
- Replace **`your_private_key_here`** with your actual private key. | ||
|
||
## Next Steps | ||
|
||
You should now have a fully working local environment to build new projects on zkSync! | ||
|
||
- Continue to [Hello zkSync!](/quick-start/hello-zksync) to begin the series on building a crowdfunding campaign for Zeek. | ||
<!-- TODO: add a link to other guides --> | ||
- You can skip on to creating your own projects using `zksync-cli` with your fully set up local dev environment. |
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
10 changes: 5 additions & 5 deletions
10
content/10.quick-start/2.deploy_factory.md → content/10.quick-start/20.deploy-factory.md
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
21 changes: 11 additions & 10 deletions
21
content/10.quick-start/5.paymaster.md → content/10.quick-start/50.paymaster.md
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.