From 98bce39b23885dc0e9ed6dc9976ace95936322a9 Mon Sep 17 00:00:00 2001 From: Morty Date: Fri, 22 Nov 2024 18:49:37 +0800 Subject: [PATCH] update sdk to support contracts verification --- public/locales/en/translation.json | 1 + src/config/sidebar.ts | 4 +++ .../docs/en/sdk/guides/aws-deployment.mdx | 2 +- .../docs/en/sdk/guides/devnet-deployment.mdx | 4 +-- .../guides/digital-ocean-alt-gas-token.mdx | 2 +- .../sdk/operation/contracts-verification.mdx | 31 +++++++++++++++++++ .../en/sdk/technical-stack/configuration.mdx | 15 +++++++++ 7 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 src/content/docs/en/sdk/operation/contracts-verification.mdx diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 90e8d95b..c03a4809 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -171,6 +171,7 @@ "customizingSdkComponents": "Customizing SDK Components", "awsDeployment": "AWS Deployment", "operation": "Operating a Chain", + "contractsVerification": "Contracts Verification", "gasAndFees": "Gas & Fee Management", "monitoring": "Monitoring", "security": "Security and Recovery", diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index a75eefe7..6256c16f 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -411,6 +411,10 @@ export const getSidebar = () => { { section: t("sidebar.sdk.operation"), contents: [ + { + title: t("sidebar.sdk.contractsVerification"), + url: formatUrl("sdk/operation/contracts-verification"), + }, { title: t("sidebar.sdk.gasAndFees"), url: formatUrl("sdk/operation/gas-and-fees"), diff --git a/src/content/docs/en/sdk/guides/aws-deployment.mdx b/src/content/docs/en/sdk/guides/aws-deployment.mdx index fafb6b7b..36d61724 100644 --- a/src/content/docs/en/sdk/guides/aws-deployment.mdx +++ b/src/content/docs/en/sdk/guides/aws-deployment.mdx @@ -58,7 +58,7 @@ Make sure to follow the installation instructions for each tool on their respect To install the scroll-sdk-cli, run: ```bash -npm install -g @scroll-tech/scroll-sdk-cli +npm install -g @scroll-tech/scroll-sdk-cli@0.1.1 ``` {/* TODO: Replace with new command */} diff --git a/src/content/docs/en/sdk/guides/devnet-deployment.mdx b/src/content/docs/en/sdk/guides/devnet-deployment.mdx index 8e5e7371..78d76abd 100644 --- a/src/content/docs/en/sdk/guides/devnet-deployment.mdx +++ b/src/content/docs/en/sdk/guides/devnet-deployment.mdx @@ -64,7 +64,7 @@ As we migrate to the Blockscout upgrade with native Scroll SDK support, we haven - `brew install nvm` - `nvm install node` - scroll-sdk-cli *(Experimental, APIs may change)* - - `npm install -g @scroll-tech/scroll-sdk-cli` + - `npm install -g @scroll-tech/scroll-sdk-cli@0.1.1` 3. You should now be able to open a terminal and run the following: - `docker -v` - `kubectl version` @@ -125,7 +125,7 @@ As we migrate to the Blockscout upgrade with native Scroll SDK support, we haven curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash # Re-login or source your shell configuration nvm install 20 - npm install -g @scroll-tech/scroll-sdk-cli + npm install -g @scroll-tech/scroll-sdk-cli@0.1.1 ``` {/* TODO: Update the cli command to use the new `scrollsdk` install command */} diff --git a/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx b/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx index 6698c808..5052d851 100644 --- a/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx +++ b/src/content/docs/en/sdk/guides/digital-ocean-alt-gas-token.mdx @@ -63,7 +63,7 @@ Please be aware that Blockscout will take a few extra steps to setup without aut - k9s *(optional)* -To install the scroll-sdk-cli, run `npm install -g @scroll-tech/scroll-sdk-cli` +To install the scroll-sdk-cli, run `npm install -g @scroll-tech/scroll-sdk-cli@0.1.1` Then, run `scrollsdk test dependencies` to test that the tool works and to check the required dependencies listed above. diff --git a/src/content/docs/en/sdk/operation/contracts-verification.mdx b/src/content/docs/en/sdk/operation/contracts-verification.mdx new file mode 100644 index 00000000..cc83dd42 --- /dev/null +++ b/src/content/docs/en/sdk/operation/contracts-verification.mdx @@ -0,0 +1,31 @@ +--- +section: sdk +title: "Upgrading Scroll SDK" +lang: "en" +permalink: "sdk/operation/contracts-verification" +excerpt: "Learn more about verify smart contract scource code on blockchain explorer" +--- + +import Steps from '../../../../../components/Steps/Steps.astro'; + +## Overview + +This guide documents how to verify the smart contract source code of your own Scroll SDK deployment on blockchain explorers. + +### Devnet deployment + + +1. Go to the `devnet` folder of `scroll-sdk` repository +2. Configurate `[contracts.verification]` section of your config.toml file as described [here](/en/sdk/technical-stack/configuration#contracts-verification) +3. To start the verification process, run the following command: + - `make verify` + + +### Production deployment + + +1. Go to the root directory of your local workspace repo +2. Configurate `[contracts.verification]` section of your config.toml file as described [here](/en/sdk/technical-stack/configuration#contracts-verification) +3. To start the verification process, run the following command: + - `scrollsdk setup verify-contracts` + \ No newline at end of file diff --git a/src/content/docs/en/sdk/technical-stack/configuration.mdx b/src/content/docs/en/sdk/technical-stack/configuration.mdx index ed9f1a30..bc49f16a 100644 --- a/src/content/docs/en/sdk/technical-stack/configuration.mdx +++ b/src/content/docs/en/sdk/technical-stack/configuration.mdx @@ -179,6 +179,21 @@ Contained in the `[contracts.overrides]` section. | L2_WETH | Override address for the L2 WETH contract. | `0x5300000000000000000000000000000000000004` | | L2_TX_FEE_VAULT | Override address for the L2 transaction fee vault contract. | `0x5300000000000000000000000000000000000005` | +### Contracts Verification + +Contained in the `[contracts.verification]` section. + +| Config Variable | Description | Default Value | +|-----------------|-------------|---------------| +| VERIFIER_TYPE_L1 | Verifier type for the L1 contracts. supports `blockscout`, `etherscan` and `sourcify`. | `blockscout` | +| VERIFIER_TYPE_L2 | Verifier type for the L2 contracts. supports `blockscout`, `etherscan` and `sourcify`. | `blockscout` | +| EXPLORER_URI_L1 | Homepage URL of L1 explorer. | `http://l1-explorer.scrollsdk` | +| EXPLORER_URI_L2 | Homepage URL of L2 explorer. | `http://blockscout.scrollsdk` | +| RPC_URI_L1 | RPC URL of L1 network. | `http://l1-devnet.scrollsdk` | +| RPC_URI_L2 | RPC URL of L1 network. | `http://l1-devnet.scrollsdk` | +| EXPLORER_API_KEY_L1 | Explorer API key for L1 contracts verification. Leave it blank if verifier type is `blockscout`. | | +| EXPLORER_API_KEY_L2 | Explorer API key for L2 contracts verification. Leave it blank if verifier type is `blockscout`. | | + ### Coordinator Contained in the `[coordinator]` section.