From 3d6df1cd0469fe379cc0431cea23df46fb9922ca Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:57:45 +0000 Subject: [PATCH 1/7] Add backend quickstart guide --- docs/get-started/build/quickstart/backend.mdx | 227 ++++++++++++++++++ .../get-started/build/quickstart/frontend.mdx | 9 + .../how-to/deploy-smart-contract/foundry.mdx | 14 +- .../how-to/verify-smart-contract/foundry.mdx | 2 +- sidebars.js | 12 + 5 files changed, 256 insertions(+), 8 deletions(-) create mode 100644 docs/get-started/build/quickstart/backend.mdx create mode 100644 docs/get-started/build/quickstart/frontend.mdx diff --git a/docs/get-started/build/quickstart/backend.mdx b/docs/get-started/build/quickstart/backend.mdx new file mode 100644 index 000000000..f526bdc89 --- /dev/null +++ b/docs/get-started/build/quickstart/backend.mdx @@ -0,0 +1,227 @@ +--- +title: "Quickstart: Backend" +description: Create a new project and deploy and verify your contracts using Foundry +sidebar_position: 1 +pagination_next: get-started/build/quickstart/frontend +pagination_prev: null +--- + +Building apps on Linea needn't be complicated. In this guide, we'll walk you through using +[Foundry](https://book.getfoundry.sh/) to create a new project from scratch. + +## Prerequisites + +- [Install Foundry](https://book.getfoundry.sh/getting-started/installation). +- A Linea-compatible wallet with some Linea Sepolia ETH. We recommend using [MetaMask](https://metamask.io/). + +## Create a project + +To get started, we're going to use Foundry's `forge init` command to create a new project. [`forge`](https://book.getfoundry.sh/forge/) +is the Foundry CLI tool. + +Firstly, navigate to wherever you want to create your project. We'll call ours `foundry-test`: + +```bash +mkdir foundry-test +cd foundry-test +``` + +Then initiate the new project, choosing whatever name you prefer: + +```bash +forge init foundry_test +``` + +Foundry will build out the file structure and create a GitHub repository. It also installs one +dependency: `forge-std`, the Forge Standard Library, which enables you to test your project. +To get more familiar with your new project, it might help to open it in a code editor and inspect +the files. + +You can also run `forge build` to compile your project, and then `forge test` to use the `forge-std` +testing library. + +:::note + +If you already have a project set up, clone the project and run `forge install` in the directory to +use Foundry. See the [Foundry guide](https://book.getfoundry.sh/projects/working-on-an-existing-project#working-on-an-existing-project) +for more information. + +::: + +## Deploy a contract + +The default Foundry template comes with a simple placeholder contract, `Counter.sol`. You're likely +going to need something with a bit more functionality. You probably already have a idea of what +you want your app to do, and you might have the skills to write your own contract from scratch. + +For simplicity, we're going to stick with `Counter.sol`, but you can use any template you want, or +refer to our [contract templates section](../../tooling/contracts-templates/index.mdx) for more inspiration. + +We'll use the `forge create` command to deploy the contract. First, we must get an RPC endpoint and +ensure we have a secure method for using a private key. + +:::note + +For this section, you can also refer to our separate [Foundry contract deployment guide](../../how-to/deploy-smart-contract/foundry.mdx). + +::: + +### RPC endpoints + +#### Get the RPC endpoint + +To deploy a contract, you need to interact with the blockchain, which means you need an [RPC endpoint](../../tooling/node-providers/index.mdx) +to send those calls to. + +To keep things simple, we're going to use the default public RPC endpoint for Linea Sepolia: +`https://rpc.sepolia.linea.build`. + +Public endpoints such as this one are rate limited, and if you intend to deploy your app for public +use, you'll need an endpoint better equipped to handle the load. We recommend heading to the +MetaMask Developer Dashboard to get a private RPC endpoint ([instructions](https://docs.metamask.io/developer-tools/dashboard/get-started/create-api/)). + +You can also find alternative public and private RPC endpoints on our [node providers page](../../tooling/node-providers/index.mdx). + +#### Update `foundry.toml` + +Add the RPC endpoint to the `foundry.toml` file: + +```toml +[profile.rpc-endpoints] +sepolia = "https://rpc.sepolia.linea.build" +``` + +### Store your private key + +Deploying a contract requires an account's private key, which means you need to either provide it in +the command line when running the deployment command (not recommended) or store it securely and +access it with alternative methods. + +A standard approach is to store your private key as an environment variable in a `.env` file that +is only stored locally (i.e. listed in `.gitignore` file). However, we're going to use Foundry's +keystore system to encrypt and store the private key, and then access it with a password. + +To do this, we'll use Foundry's [`cast`](https://book.getfoundry.sh/cast/) CLI tool; specifically, +the [`cast wallet import`](https://book.getfoundry.sh/reference/cast/cast-wallet-import) command. + +```bash +cast wallet import --interactive test-account +``` + +The `--interactive` flag means that you'll be prompted to enter your private key in the terminal, +followed by a corresponding password. `test-account` is the name you want to give the account in +the keystore; choose whatever is suitable for your purposes here. + +When you enter the private key and then your password, you'll get confirmation that it has been +stored successfully: + +``` +`test-account` keystore was saved successfully. Address: +``` + +Run `cast wallet list` to see accounts in your keystore. + +### Deploy the contract + +#### Adjust Solidity version + +By default, the `forge init` command we used originally creates the `Counter.sol` contract with the +following Solidity compiler version: + +``` +pragma solidity ^0.8.13; +``` + +This enables the compiler to use any version newer than Solidity v0.8.13. [Linea is only compatible +with Solidity 0.8.19 or lower](../../build/ethereum-differences.mdx), so we need to adjust this +statement in the contract: + +``` +pragma solidity 0.8.19; +``` + +#### Run `forge create` + +With your RPC endpoint to hand and your private key stored more securely, you're ready to deploy +using `forge create`. + +Execute this command, then enter your password to use the private key when prompted: + +```bash +forge create --rpc-url https://rpc.sepolia.linea.build --account test-account --broadcast src/Counter.sol:Counter +``` + +- `--rpc-url` is the RPC endpoint you want to use. +- `--account` is the keystore account you want to use to deploy the contract. +- `--broadcast` tells Forge to send the transaction to the network. You can test the command by +omitting this flag, but you won't actually deploy the contract. + +The format of the contract you want to deploy is `path/to/contract.sol:ContractName`; in this case, +we want the `Counter` contract from `src/Counter.sol`. + +If successful, you'll see this in the terminal: + +``` +Deployer: 0x ... // The address of the account used to deploy the contract +Deployed to: 0x ... // The address of the deployed contract +Transaction hash: 0x ... // The deployment transaction itself +``` + +You can copy each of these addresses and head to the [block explorer](https://sepolia.lineascan.build/) +to see the deployed contract. + +Make sure to copy the `Deployed to` address, as you'll need it to verify the contract. + +## Verify a contract + +Verifying a contract makes the source code publicly visible, and also confirms to others that it +originated from a genuine source. + +Verifying can be done with the `forge verify-contract` command, and requires a Lineascan API key. + +### Get a Lineascan API key + +Get a Lineascan API key by [creating an account](https://lineascan.build/myapikey). + +Since it's best practice to avoid using API keys in the command line, add the API key to your +`.env` file: + +``` +LINEASCAN_API_KEY=YOUR_LINEASCAN_API_KEY +``` + +Then modify the `foundry.toml` configuration file to include the Lineascan API key: + +``` +[etherscan] +linea-sepolia = { key = "${LINEASCAN_API_KEY}" } +``` + +#### Run `forge verify-contract` + +Execute this command: + +```bash +forge verify-contract --chain linea-sepolia YOUR_CONTRACT_ADDRESS path_to_contract:contract_name --watch +``` + +`--watch` automatically runs the `forge verify-check` command to report verification status in the +terminal until verification is complete. + +:::note + +You can also complete verification at the same time as deployment by adding the `--verify` and +`--verifier-url` flags to the `forge create` command, and providing your Lineascan API key. + +For example: + +```bash +forge create --rpc-url https://rpc.sepolia.linea.build --account test-account --broadcast --verify --verifier-url https://api-sepolia.lineascan.build/api --etherscan-api-key LINEASCAN_API_KEY src/Counter.sol:Counter +``` + +::: + +## Next steps + +Head to [part two of our quickstart](./frontend.mdx) to learn how to deploy an app and configure it +to interact with your deployed contract. \ No newline at end of file diff --git a/docs/get-started/build/quickstart/frontend.mdx b/docs/get-started/build/quickstart/frontend.mdx new file mode 100644 index 000000000..cfbabfff8 --- /dev/null +++ b/docs/get-started/build/quickstart/frontend.mdx @@ -0,0 +1,9 @@ +--- +title: "Quickstart: Frontend" +description: Connect your contracts to a frontend app +sidebar_position: 2 +pagination_next: null +pagination_prev: get-started/build/quickstart/backend +--- + +TODO \ No newline at end of file diff --git a/docs/get-started/how-to/deploy-smart-contract/foundry.mdx b/docs/get-started/how-to/deploy-smart-contract/foundry.mdx index 1294fe75a..129198d05 100644 --- a/docs/get-started/how-to/deploy-smart-contract/foundry.mdx +++ b/docs/get-started/how-to/deploy-smart-contract/foundry.mdx @@ -47,8 +47,8 @@ cd linea-tutorial ## Deploy a smart contract -To deploy a smart contract we highly recommend using an Infura endpoint, as the public endpoint may experience -rate limiting and is not meant for production use. +To deploy a smart contract we highly recommend using an Infura endpoint, as the public endpoint may +experience rate limiting and is not meant for production use. [Sign up for an Infura account](https://docs.infura.io/api/getting-started) to get an API key that provides access to the Linea endpoints. Assign the Linea endpoints you want to access to your API key. @@ -83,10 +83,10 @@ Transaction hash: 0x967e1290b285e67b3d74940ee19925416734c345f58bd1ec64dcea134647 ## Deploy a smart contract using a `.env` file -Directly pasting your private key into the command line poses security risks. To avoid exposing sensitive -information such as wallet private keys or API keys, use files with the `.env` extension to store private -data. Create a `.env` file, then add the file to the `.gitignore` file to prevent committing it. Populate -the `.env` file with the relevant private information: +Directly pasting your private key into the command line poses security risks. To avoid exposing +sensitive information such as wallet private keys or API keys, use files with the `.env` extension +to store private data. Create a `.env` file, then add the file to the `.gitignore` file to prevent +committing it. Populate the `.env` file with the relevant private information: ```bash PRIVATE_KEY=YOUR_PRIVATE_KEY @@ -102,7 +102,7 @@ source .env Finally, modify the `foundry.toml` file to store the various RPC endpoints we might be working with. For example: ```bash -[rpc_endpoints] +[profile.rpc-endpoints] linea-sepolia = "https://linea-sepolia.infura.io/v3/${INFURA_API_KEY}" linea-mainnet = "https://linea-mainnet.infura.io/v3/${INFURA_API_KEY}" ``` diff --git a/docs/get-started/how-to/verify-smart-contract/foundry.mdx b/docs/get-started/how-to/verify-smart-contract/foundry.mdx index b2fe0c7c7..2db42b24e 100644 --- a/docs/get-started/how-to/verify-smart-contract/foundry.mdx +++ b/docs/get-started/how-to/verify-smart-contract/foundry.mdx @@ -85,7 +85,7 @@ forge create --rpc-url https://linea-sepolia.infura.io/v3/INFURA_API_KEY src/Cou You can check that it was verified correctly by navigating to the [testnet block explorer](https://sepolia.lineascan.build/) or the [mainnet block explorer](https://lineascan.build/) and pasting in the deployed contract address. -## Using `.env` and `foundry.toml` to store etherscan information +## Using `.env` and `foundry.toml` to store Lineascan information If you don't want to paste your keys inline and have multiple Etherscan API keys to manage, you can use the `.env` and `foundry.toml` files to set up custom configurations. diff --git a/sidebars.js b/sidebars.js index e08e04185..f1290123c 100644 --- a/sidebars.js +++ b/sidebars.js @@ -12,6 +12,18 @@ const sidebars = { link: null, collapsible: false, items: [ + { + type: "category", + label: "Quickstart", + link: { + type: "doc", + id: "get-started/build/quickstart/backend", + }, + items: [ + "get-started/build/quickstart/backend", + "get-started/build/quickstart/frontend", + ] + }, "get-started/build/ethereum-differences", "get-started/build/network-info", "get-started/build/contracts", From 8ee92114c7e2fdfae465c0b6ca923d922aaa592f Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:15:29 +0000 Subject: [PATCH 2/7] Feedback and adjustments --- .../quickstart/{backend.mdx => deploy.mdx} | 73 +++++++++++++------ .../get-started/build/quickstart/frontend.mdx | 2 +- sidebars.js | 4 +- 3 files changed, 54 insertions(+), 25 deletions(-) rename docs/get-started/build/quickstart/{backend.mdx => deploy.mdx} (76%) diff --git a/docs/get-started/build/quickstart/backend.mdx b/docs/get-started/build/quickstart/deploy.mdx similarity index 76% rename from docs/get-started/build/quickstart/backend.mdx rename to docs/get-started/build/quickstart/deploy.mdx index f526bdc89..a129abab1 100644 --- a/docs/get-started/build/quickstart/backend.mdx +++ b/docs/get-started/build/quickstart/deploy.mdx @@ -1,5 +1,5 @@ --- -title: "Quickstart: Backend" +title: "Quickstart: Deployment" description: Create a new project and deploy and verify your contracts using Foundry sidebar_position: 1 pagination_next: get-started/build/quickstart/frontend @@ -9,27 +9,37 @@ pagination_prev: null Building apps on Linea needn't be complicated. In this guide, we'll walk you through using [Foundry](https://book.getfoundry.sh/) to create a new project from scratch. +This involves: +1. [Creating a project](#create-a-project) +2. [Deploying](#deploy-a-contract) and then [verifying](#verify-a-contract) your contract. + +After that, we'll move to [part two](./frontend.mdx): deploying your app and ensuring it interacts +with your deployed contract. + +> _Estimated time to complete: ~20 minutes._ + ## Prerequisites -- [Install Foundry](https://book.getfoundry.sh/getting-started/installation). - A Linea-compatible wallet with some Linea Sepolia ETH. We recommend using [MetaMask](https://metamask.io/). + - Get some testnet ETH by heading to our [Discord server](https://discord.gg/linea) and asking in + the `#developer-chat` channel. Our admins or other community members will help you out. ## Create a project To get started, we're going to use Foundry's `forge init` command to create a new project. [`forge`](https://book.getfoundry.sh/forge/) is the Foundry CLI tool. -Firstly, navigate to wherever you want to create your project. We'll call ours `foundry-test`: +Firstly, let's [install Foundry](https://book.getfoundry.sh/getting-started/installation): ```bash -mkdir foundry-test -cd foundry-test +curl -L https://foundry.paradigm.xyz | bash ``` -Then initiate the new project, choosing whatever name you prefer: +Then initiate the new project, choosing whatever name you prefer. Make sure you're in the +directory you want to create your project in: ```bash -forge init foundry_test +forge init linea_test_project ``` Foundry will build out the file structure and create a GitHub repository. It also installs one @@ -60,15 +70,9 @@ refer to our [contract templates section](../../tooling/contracts-templates/inde We'll use the `forge create` command to deploy the contract. First, we must get an RPC endpoint and ensure we have a secure method for using a private key. -:::note - -For this section, you can also refer to our separate [Foundry contract deployment guide](../../how-to/deploy-smart-contract/foundry.mdx). - -::: - ### RPC endpoints -#### Get the RPC endpoint +#### Get your RPC endpoint To deploy a contract, you need to interact with the blockchain, which means you need an [RPC endpoint](../../tooling/node-providers/index.mdx) to send those calls to. @@ -95,11 +99,23 @@ sepolia = "https://rpc.sepolia.linea.build" Deploying a contract requires an account's private key, which means you need to either provide it in the command line when running the deployment command (not recommended) or store it securely and -access it with alternative methods. +access it with alternative methods. See the [MetaMask support guide to finding your private key](https://support.metamask.io/managing-my-wallet/secret-recovery-phrase-and-private-keys/how-to-export-an-accounts-private-key/). + +:::tip[Private key security best practices] + +We recommend [creating a new account in MetaMask](https://support.metamask.io/managing-my-wallet/accounts-and-addresses/how-to-add-accounts-in-your-wallet/) +specifically for this project, and [naming it](https://support.metamask.io/managing-my-wallet/accounts-and-addresses/how-do-i-change-my-account-name-/) +something appropriate, such as "linea-project". + +Even though we're working on a testnet, it's best to behave as if real assets were at stake, and +work in a sandboxed context with a somewhat expendable account. + +::: A standard approach is to store your private key as an environment variable in a `.env` file that is only stored locally (i.e. listed in `.gitignore` file). However, we're going to use Foundry's -keystore system to encrypt and store the private key, and then access it with a password. +keystore system to encrypt and store the private key, and then access it with a password. This +ensures that you won't accidentally expose your private key—for example, in a GitHub repository. To do this, we'll use Foundry's [`cast`](https://book.getfoundry.sh/cast/) CLI tool; specifically, the [`cast wallet import`](https://book.getfoundry.sh/reference/cast/cast-wallet-import) command. @@ -116,7 +132,7 @@ When you enter the private key and then your password, you'll get confirmation t stored successfully: ``` -`test-account` keystore was saved successfully. Address: +`test-account` keystore was saved successfully. Address: ``` Run `cast wallet list` to see accounts in your keystore. @@ -133,11 +149,23 @@ pragma solidity ^0.8.13; ``` This enables the compiler to use any version newer than Solidity v0.8.13. [Linea is only compatible -with Solidity 0.8.19 or lower](../../build/ethereum-differences.mdx), so we need to adjust this -statement in the contract: +with Solidity 0.8.19 or lower](../../build/ethereum-differences.mdx), so we need to make some +adjustments. + +Add this line to `[profile.default]` in your `foundry.toml` file: +```toml +solc-version = 0.8.19 ``` -pragma solidity 0.8.19; + +So that your `[profile.default]` now looks like this: + +```toml +[profile.default] +src = "src" +out = "out" +libs = ["lib"] +solc-version = "0.8.19" ``` #### Run `forge create` @@ -223,5 +251,6 @@ forge create --rpc-url https://rpc.sepolia.linea.build --account test-account -- ## Next steps -Head to [part two of our quickstart](./frontend.mdx) to learn how to deploy an app and configure it -to interact with your deployed contract. \ No newline at end of file +Now you've successfully deployed and verified your contract! It's recorded on the blockchain and +ready to receive calls from your app. Speaking of which, head to [part two of our quickstart](./frontend.mdx) +to learn how to deploy an app and configure it to interact with your deployed contract. \ No newline at end of file diff --git a/docs/get-started/build/quickstart/frontend.mdx b/docs/get-started/build/quickstart/frontend.mdx index cfbabfff8..75e55c549 100644 --- a/docs/get-started/build/quickstart/frontend.mdx +++ b/docs/get-started/build/quickstart/frontend.mdx @@ -3,7 +3,7 @@ title: "Quickstart: Frontend" description: Connect your contracts to a frontend app sidebar_position: 2 pagination_next: null -pagination_prev: get-started/build/quickstart/backend +pagination_prev: get-started/build/quickstart/deploy --- TODO \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index f1290123c..4d6490b83 100644 --- a/sidebars.js +++ b/sidebars.js @@ -17,10 +17,10 @@ const sidebars = { label: "Quickstart", link: { type: "doc", - id: "get-started/build/quickstart/backend", + id: "get-started/build/quickstart/deploy", }, items: [ - "get-started/build/quickstart/backend", + "get-started/build/quickstart/deploy", "get-started/build/quickstart/frontend", ] }, From 46aaa0bd67d3db98be625bbae21358d40e0c15e2 Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:22:45 +0000 Subject: [PATCH 3/7] Adjustments for clarity --- docs/get-started/build/quickstart/deploy.mdx | 9 +++++---- src/pages/index.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/get-started/build/quickstart/deploy.mdx b/docs/get-started/build/quickstart/deploy.mdx index a129abab1..600dc7f04 100644 --- a/docs/get-started/build/quickstart/deploy.mdx +++ b/docs/get-started/build/quickstart/deploy.mdx @@ -42,7 +42,7 @@ directory you want to create your project in: forge init linea_test_project ``` -Foundry will build out the file structure and create a GitHub repository. It also installs one +Foundry will build out the file structure and create a git repository. It also installs one dependency: `forge-std`, the Forge Standard Library, which enables you to test your project. To get more familiar with your new project, it might help to open it in a code editor and inspect the files. @@ -158,7 +158,7 @@ Add this line to `[profile.default]` in your `foundry.toml` file: solc-version = 0.8.19 ``` -So that your `[profile.default]` now looks like this: +So that your `[profile.default]`, which is applied universally, now looks like this: ```toml [profile.default] @@ -218,9 +218,10 @@ Since it's best practice to avoid using API keys in the command line, add the AP LINEASCAN_API_KEY=YOUR_LINEASCAN_API_KEY ``` -Then modify the `foundry.toml` configuration file to include the Lineascan API key: +Then modify the `foundry.toml` configuration file to include the Lineascan API key, pulling it from +the `.env` file: -``` +```toml [etherscan] linea-sepolia = { key = "${LINEASCAN_API_KEY}" } ``` diff --git a/src/pages/index.tsx b/src/pages/index.tsx index fceca8a8e..26762cc80 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -39,7 +39,7 @@ function HomepageHeader() { "button button--secondary button--lg", styles.bannerButton, )} - to="/get-started"> + to="/get-started/build/quickstart/deploy"> START BUILDING From d3271b5d496046f64a3ae34b1a274d3c8dbed69d Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:49:41 +0000 Subject: [PATCH 4/7] Filename changes etc. --- .../build/quickstart/{frontend.mdx => app.mdx} | 2 +- docs/get-started/build/quickstart/deploy.mdx | 11 ++++++----- sidebars.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) rename docs/get-started/build/quickstart/{frontend.mdx => app.mdx} (84%) diff --git a/docs/get-started/build/quickstart/frontend.mdx b/docs/get-started/build/quickstart/app.mdx similarity index 84% rename from docs/get-started/build/quickstart/frontend.mdx rename to docs/get-started/build/quickstart/app.mdx index 75e55c549..7885fdfc8 100644 --- a/docs/get-started/build/quickstart/frontend.mdx +++ b/docs/get-started/build/quickstart/app.mdx @@ -1,5 +1,5 @@ --- -title: "Quickstart: Frontend" +title: Build your app description: Connect your contracts to a frontend app sidebar_position: 2 pagination_next: null diff --git a/docs/get-started/build/quickstart/deploy.mdx b/docs/get-started/build/quickstart/deploy.mdx index 600dc7f04..15360f84e 100644 --- a/docs/get-started/build/quickstart/deploy.mdx +++ b/docs/get-started/build/quickstart/deploy.mdx @@ -1,8 +1,8 @@ --- -title: "Quickstart: Deployment" +title: Contract deployment description: Create a new project and deploy and verify your contracts using Foundry sidebar_position: 1 -pagination_next: get-started/build/quickstart/frontend +pagination_next: get-started/build/quickstart/app pagination_prev: null --- @@ -20,9 +20,10 @@ with your deployed contract. ## Prerequisites -- A Linea-compatible wallet with some Linea Sepolia ETH. We recommend using [MetaMask](https://metamask.io/). - - Get some testnet ETH by heading to our [Discord server](https://discord.gg/linea) and asking in - the `#developer-chat` channel. Our admins or other community members will help you out. +A Linea-compatible wallet with some Linea Sepolia ETH. We recommend using [MetaMask](https://metamask.io/). + +Get some testnet ETH by heading to our [Discord server](https://discord.gg/linea) and asking in +the `#developer-chat` channel. Our admins or other community members will help you out. ## Create a project diff --git a/sidebars.js b/sidebars.js index e7cdeacaa..4ce434190 100644 --- a/sidebars.js +++ b/sidebars.js @@ -21,7 +21,7 @@ const sidebars = { }, items: [ "get-started/build/quickstart/deploy", - "get-started/build/quickstart/frontend", + "get-started/build/quickstart/app", ] }, "get-started/build/ethereum-differences", From 82fcf6c40aa627f496675e32184d9d8a510df879 Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:52:23 +0000 Subject: [PATCH 5/7] Fix Infura docs link --- docs/get-started/how-to/deploy-smart-contract/foundry.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/how-to/deploy-smart-contract/foundry.mdx b/docs/get-started/how-to/deploy-smart-contract/foundry.mdx index 129198d05..daa82e88c 100644 --- a/docs/get-started/how-to/deploy-smart-contract/foundry.mdx +++ b/docs/get-started/how-to/deploy-smart-contract/foundry.mdx @@ -69,7 +69,7 @@ forge create --rpc-url YOUR_LINEA_ENDPOINT src/Counter.sol:Counter --private-key In the command: - Replace `YOUR_LINEA_ENDPOINT` with the URL of a - [supported Infura Linea network](https://docs.infura.io/api/networks/linea/choose-a-network) + [supported Infura Linea network](https://docs.metamask.io/services/get-started/endpoints/) or [public endpoint URL](../../build/network-info.mdx). - Replace `YOUR_PRIVATE_KEY` with your wallet's private key. From 7340f97ca48d42b62560059176b4077b106f507d Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:03:37 +0000 Subject: [PATCH 6/7] Amend paths --- docs/get-started/build/quickstart/deploy.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/get-started/build/quickstart/deploy.mdx b/docs/get-started/build/quickstart/deploy.mdx index 15360f84e..220cd6215 100644 --- a/docs/get-started/build/quickstart/deploy.mdx +++ b/docs/get-started/build/quickstart/deploy.mdx @@ -13,7 +13,7 @@ This involves: 1. [Creating a project](#create-a-project) 2. [Deploying](#deploy-a-contract) and then [verifying](#verify-a-contract) your contract. -After that, we'll move to [part two](./frontend.mdx): deploying your app and ensuring it interacts +After that, we'll move to [part two](./app.mdx): deploying your app and ensuring it interacts with your deployed contract. > _Estimated time to complete: ~20 minutes._ @@ -254,5 +254,5 @@ forge create --rpc-url https://rpc.sepolia.linea.build --account test-account -- ## Next steps Now you've successfully deployed and verified your contract! It's recorded on the blockchain and -ready to receive calls from your app. Speaking of which, head to [part two of our quickstart](./frontend.mdx) +ready to receive calls from your app. Speaking of which, head to [part two of our quickstart](./app.mdx) to learn how to deploy an app and configure it to interact with your deployed contract. \ No newline at end of file From a537e14d3b19cf847e3fb58aeb46ef718036239d Mon Sep 17 00:00:00 2001 From: jlwllmr <95916148+jlwllmr@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:18:27 +0000 Subject: [PATCH 7/7] Hide part 2, other minor changes --- docs/get-started/build/quickstart/app.mdx | 4 +++- docs/get-started/build/quickstart/deploy.mdx | 17 ++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/docs/get-started/build/quickstart/app.mdx b/docs/get-started/build/quickstart/app.mdx index 7885fdfc8..516874532 100644 --- a/docs/get-started/build/quickstart/app.mdx +++ b/docs/get-started/build/quickstart/app.mdx @@ -4,6 +4,8 @@ description: Connect your contracts to a frontend app sidebar_position: 2 pagination_next: null pagination_prev: get-started/build/quickstart/deploy +unlisted: true +image: /img/socialCards/build-your-app.jpg --- -TODO \ No newline at end of file +TODO diff --git a/docs/get-started/build/quickstart/deploy.mdx b/docs/get-started/build/quickstart/deploy.mdx index 220cd6215..0fb2436f9 100644 --- a/docs/get-started/build/quickstart/deploy.mdx +++ b/docs/get-started/build/quickstart/deploy.mdx @@ -4,6 +4,7 @@ description: Create a new project and deploy and verify your contracts using Fou sidebar_position: 1 pagination_next: get-started/build/quickstart/app pagination_prev: null +image: /img/socialCards/contract-deployment.jpg --- Building apps on Linea needn't be complicated. In this guide, we'll walk you through using @@ -13,9 +14,6 @@ This involves: 1. [Creating a project](#create-a-project) 2. [Deploying](#deploy-a-contract) and then [verifying](#verify-a-contract) your contract. -After that, we'll move to [part two](./app.mdx): deploying your app and ensuring it interacts -with your deployed contract. - > _Estimated time to complete: ~20 minutes._ ## Prerequisites @@ -25,7 +23,7 @@ A Linea-compatible wallet with some Linea Sepolia ETH. We recommend using [MetaM Get some testnet ETH by heading to our [Discord server](https://discord.gg/linea) and asking in the `#developer-chat` channel. Our admins or other community members will help you out. -## Create a project +## Create your project To get started, we're going to use Foundry's `forge init` command to create a new project. [`forge`](https://book.getfoundry.sh/forge/) is the Foundry CLI tool. @@ -59,7 +57,7 @@ for more information. ::: -## Deploy a contract +## Deploy your contract The default Foundry template comes with a simple placeholder contract, `Counter.sol`. You're likely going to need something with a bit more functionality. You probably already have a idea of what @@ -138,7 +136,7 @@ stored successfully: Run `cast wallet list` to see accounts in your keystore. -### Deploy the contract +### Deploy #### Adjust Solidity version @@ -201,7 +199,7 @@ to see the deployed contract. Make sure to copy the `Deployed to` address, as you'll need it to verify the contract. -## Verify a contract +## Verify your contract Verifying a contract makes the source code publicly visible, and also confirms to others that it originated from a genuine source. @@ -251,8 +249,5 @@ forge create --rpc-url https://rpc.sepolia.linea.build --account test-account -- ::: -## Next steps - Now you've successfully deployed and verified your contract! It's recorded on the blockchain and -ready to receive calls from your app. Speaking of which, head to [part two of our quickstart](./app.mdx) -to learn how to deploy an app and configure it to interact with your deployed contract. \ No newline at end of file +ready to receive calls from your app.