-
Notifications
You must be signed in to change notification settings - Fork 58
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
Updated Localnet doc #481
base: main
Are you sure you want to change the base?
Updated Localnet doc #481
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces comprehensive revisions to the documentation for Localnet, a local development environment for ZetaChain. Key updates include an enhanced introduction outlining Localnet's capabilities, expanded prerequisites for setup, and clarified instructions for initializing Localnet. The documentation now details two methods for setup, updates commands for starting Localnet, and provides a clearer presentation of output, including contract addresses. Additionally, the section on Localnet's functionalities has been elaborated, and the conclusion reinforces the environment's readiness for application development and testing. Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Outside diff range and nitpick comments (1)
src/pages/developers/tutorials/localnet.mdx (1)
5-5
: Address minor grammatical issues.
Line 5: Consider changing "multi-chain" to "multichain" for consistency with common usage in the blockchain industry.
Line 56: Replace "The examples ships with" with "The example ships with" or "The examples ship with" to correct the subject-verb agreement.
These minor adjustments will improve the overall quality of the document.
Also applies to: 56-56
🧰 Tools
🪛 LanguageTool
[misspelling] ~5-~5: This word is normally spelled as one.
Context: ... and Uniswap pools locally, mimicking a multi-chain environment. By using Localnet, you can...(EN_COMPOUNDS_MULTI_CHAIN)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- src/pages/developers/tutorials/localnet.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/localnet.mdx
[misspelling] ~5-~5: This word is normally spelled as one.
Context: ... and Uniswap pools locally, mimicking a multi-chain environment. By using Localnet, you can...(EN_COMPOUNDS_MULTI_CHAIN)
[grammar] ~56-~56: You should probably use “ship”.
Context: ...v @zetachain/localnet ``` The examples ships with the latest version of Localnet. S...(AGREEMENT_SENT_START)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...s the following parameters: ---anvil
: Additional arguments to pass to Anvil (...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...vil (default:""
). ---exit-on-error
: Exit with an error if a revert is not h...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~156-~156: Loose punctuation mark.
Context: ... revert is not handled. ---force-kill
: Force kill any process on the port with...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~157-~157: Loose punctuation mark.
Context: ...n the port without prompting. ---port
: Port to run Anvil on (default:8545
)....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~158-~158: Loose punctuation mark.
Context: ...(default:8545
). ---stop-after-init
: Stop the Localnet after successful init...(UNLIKELY_OPENING_PUNCTUATION)
🔇 Additional comments (2)
src/pages/developers/tutorials/localnet.mdx (2)
1-7
: Introduction provides a clear and concise overview.The introduction effectively communicates the purpose and capabilities of Localnet, emphasizing its ability to simulate a multi-chain environment on a single local EVM chain. This sets the stage well for the rest of the document.
🧰 Tools
🪛 LanguageTool
[misspelling] ~5-~5: This word is normally spelled as one.
Context: ... and Uniswap pools locally, mimicking a multi-chain environment. By using Localnet, you can...(EN_COMPOUNDS_MULTI_CHAIN)
90-112
: Comprehensive explanation of Localnet functionality.The "What Localnet Does" section provides a clear and detailed explanation of Localnet's actions. The use of bullet points and links to relevant resources enhances readability and understanding. This section effectively communicates the value proposition of Localnet to developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- src/pages/developers/tutorials/localnet.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/tutorials/localnet.mdx
[misspelling] ~5-~5: This word is normally spelled as one.
Context: ... and Uniswap pools locally, mimicking a multi-chain environment. By using Localnet, you can...(EN_COMPOUNDS_MULTI_CHAIN)
[grammar] ~56-~56: You should probably use “ship”.
Context: ...v @zetachain/localnet ``` The examples ships with the latest version of Localnet. S...(AGREEMENT_SENT_START)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...s the following parameters: ---anvil
: Additional arguments to pass to Anvil (...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...vil (default:""
). ---exit-on-error
: Exit with an error if a revert is not h...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~156-~156: Loose punctuation mark.
Context: ... revert is not handled. ---force-kill
: Force kill any process on the port with...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~157-~157: Loose punctuation mark.
Context: ...n the port without prompting. ---port
: Port to run Anvil on (default:8545
)....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~158-~158: Loose punctuation mark.
Context: ...(default:8545
). ---stop-after-init
: Stop the Localnet after successful init...(UNLIKELY_OPENING_PUNCTUATION)
🔇 Additional comments (4)
src/pages/developers/tutorials/localnet.mdx (4)
1-7
: Introduction section is well-crafted and informative.The introduction effectively communicates the purpose and functionality of Localnet, emphasizing its ability to simulate a multi-chain environment on a single local EVM chain. This provides developers with a clear understanding of Localnet's capabilities and benefits.
🧰 Tools
🪛 LanguageTool
[misspelling] ~5-~5: This word is normally spelled as one.
Context: ... and Uniswap pools locally, mimicking a multi-chain environment. By using Localnet, you can...(EN_COMPOUNDS_MULTI_CHAIN)
21-36
: Prerequisites section is comprehensive and well-structured.The prerequisites are clearly listed with appropriate installation links, providing users with the necessary information to set up their development environment. The two setup options are succinctly described, allowing users to choose the most suitable approach for their needs.
90-112
: "What Localnet Does" section is comprehensive and well-structured.This section effectively outlines the actions performed by Localnet, providing users with a clear understanding of its functionality. Each action is succinctly explained with relevant links, enhancing the overall clarity and usefulness of the documentation.
113-148
: Output section effectively presents contract addresses.The Output section clearly displays the contract addresses in a well-formatted tabular structure, making it easy for developers to reference. The accompanying context provides users with a clear understanding of the displayed information and its relevance to their local blockchain setup.
<div className="mt-8" style={{ width: "100%", height: "auto", "aspect-ratio": "16 / 8" }}> | ||
<iframe | ||
width="100%" | ||
height="100%" | ||
src="https://www.youtube.com/embed/b4EWTQ3VCZk?si=kiKncEWFZolVAo0F" | ||
filename="YouTube video player" | ||
frameborder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" | ||
allowfullscreen | ||
></iframe> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance video embedding for accessibility and standards compliance.
While the video is a valuable addition, consider the following improvements:
-
Replace the deprecated
frameborder
attribute with CSS:style={{ border: 'none' }}
-
Update
allowfullscreen
toallowFullScreen
for JSX compatibility. -
Replace the non-standard
filename
attribute withtitle
for better accessibility:title="YouTube video player"
-
Add
loading="lazy"
attribute to improve page load performance.
Implementing these changes will enhance accessibility, standards compliance, and performance of the embedded video.
# Available Parameters | ||
|
||
Execute the `callFromZetaChain` function of the universal app: | ||
Localnet supports the following parameters: | ||
|
||
``` | ||
yarn hardhat call-from-zetachain --message bob --network localhost --revert-address 0x9A676e781A523b5d0C0e43731313A708CB607508 --revert-message "my revert message" --call-on-revert --contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 --receiver 0x9A676e781A523b5d0C0e43731313A708CB607508 | ||
``` | ||
- `--anvil`: Additional arguments to pass to Anvil (default: `""`). | ||
- `--exit-on-error`: Exit with an error if a revert is not handled. | ||
- `--force-kill`: Force kill any process on the port without prompting. | ||
- `--port`: Port to run Anvil on (default: `8545`). | ||
- `--stop-after-init`: Stop the Localnet after successful initialization. | ||
|
||
The function calls the ZetaChain gateway contract. The ZetaChain gateway emits a | ||
"Called" event acknowledging that the call has been successful. | ||
For an up-to-date list of arguments, run: | ||
|
||
``` | ||
[ZetaChain]: Gateway: 'Called' event emitted | ||
npx hardhat localnet --help | ||
``` | ||
|
||
Localnet picks up the "Called" event and calls the EVM gateway `execute` | ||
function, which calls the Receiver contract: | ||
**Example:** | ||
|
||
``` | ||
[EVM]: Calling 0x9a676e781a523b5d0c0e43731313a708cb607508 with message 0xa777d0dc00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000 | ||
npx hardhat localnet --anvil "--block-time 1" --port 2000 | ||
``` | ||
|
||
The Receiver contract then emits an event: | ||
|
||
``` | ||
[EVM]: Event from contract: {"_type":"log","address":"0x9A676e781A523b5d0C0e43731313A708CB607508","blockHash":"0x0deb4a3e22b73320ffad3d916c5e2b2db450dddc162feaafa84546612cebd238","blockNumber":22,"data":"0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000","index":0,"removed":false,"topics":["0xfa051318aca3e493e16e6cf4bccc017c7e061924a42ef27b3bb373c4707b636a"],"transactionHash":"0x94c4d53aed68c97f18e467207ff6cdc1e855c65bcddab399f100fe2786ee33a8","transactionIndex":0} | ||
``` | ||
# Conclusion | ||
|
||
Interacting between real networks like ZetaChain and Ethereum follows the same | ||
steps as Localnet. Developers or users can seamlessly engage with the EVM | ||
gateway on live networks such as Ethereum, BSC, or Base to call contracts on | ||
ZetaChain or vice versa. This allows for a consistent development experience, | ||
whether on a local testnet or across real-world blockchain networks, ensuring | ||
that the transition from development to production environments is seamless. | ||
With Localnet set up, you're ready to develop and test your universal | ||
applications locally with ZetaChain's protocol contracts, tokens, and Uniswap | ||
pools fully configured. This environment enables rapid development and | ||
debugging, ensuring that your applications are robust and ready for deployment | ||
on the testnet or mainnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance Conclusion with next steps and resources.
The Available Parameters section effectively lists the supported parameters with clear descriptions. To further improve the Conclusion, consider adding next steps or links to additional resources. For example:
# Conclusion
With Localnet set up, you're ready to develop and test your universal applications locally. To start building on ZetaChain:
1. Explore our [Smart Contract Development Guide](/developers/smart-contracts/overview)
2. Check out our [Example Applications](/developers/examples/overview)
3. Join our [Developer Community](https://discord.gg/zetachain) for support and discussions
These resources will help you leverage the full potential of ZetaChain in your applications.
This addition will guide developers on their next steps after setting up Localnet, providing a more comprehensive conclusion to the documentation.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...s the following parameters: ---anvil
: Additional arguments to pass to Anvil (...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~155-~155: Loose punctuation mark.
Context: ...vil (default:""
). ---exit-on-error
: Exit with an error if a revert is not h...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~156-~156: Loose punctuation mark.
Context: ... revert is not handled. ---force-kill
: Force kill any process on the port with...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~157-~157: Loose punctuation mark.
Context: ...n the port without prompting. ---port
: Port to run Anvil on (default:8545
)....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~158-~158: Loose punctuation mark.
Context: ...(default:8545
). ---stop-after-init
: Stop the Localnet after successful init...(UNLIKELY_OPENING_PUNCTUATION)
Once the localnet is started you will see the standard Anvil output with a list | ||
of accounts, private keys as well as the output from protocol contracts being | ||
deployed. After the localnet is set up you will see a list of protocol contract | ||
addresses: | ||
To get started with the example contracts, clone the repository and install the | ||
dependencies: | ||
|
||
``` | ||
EVM Contract Addresses | ||
====================== | ||
|
||
Gateway EVM: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 | ||
ZETA: 0x5FbDB2315678afecb367f032d93F642f64180aa3 | ||
|
||
ZetaChain Contract Addresses | ||
============================ | ||
|
||
Gateway ZetaChain: 0x610178dA211FEF7D417bC0e6FeD39F05609AD788 | ||
ZETA: 0xa513E6E4b8f2a923D98304ec87F64353C4D5C853 | ||
ZRC-20 ETH: 0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c | ||
git clone https://github.com/zeta-chain/example-contracts | ||
cd example-contracts/universal/hello | ||
yarn | ||
``` | ||
|
||
Keep the terminal window with localnet running open and open a new terminal. | ||
|
||
Compile the contracts and deploy both a Hello universal app contract and a | ||
Receiver contract. | ||
Localnet is installed from the `@zetachain/localnet` package. If you need to | ||
update Localnet, run: | ||
|
||
``` | ||
yarn deploy | ||
yarn add --dev @zetachain/localnet | ||
``` | ||
|
||
Universal app contract address: | ||
|
||
``` | ||
🚀 Successfully deployed contract on localhost. | ||
📜 Contract address: 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 | ||
``` | ||
The examples ships with the latest version of Localnet. | ||
|
||
Receiver contract: | ||
Start the Localnet by running: | ||
|
||
``` | ||
🚀 Successfully deployed contract on localhost. | ||
📜 Contract address: 0x9A676e781A523b5d0C0e43731313A708CB607508 | ||
npx hardhat localnet | ||
``` | ||
|
||
Even though both contracts are deployed on the same local testnet we will think | ||
of Hello as running on ZetaChain and Receiver as running on a generic EVM chain. | ||
These two contracts are connected with each other through the | ||
[gateway](/developers/evm/gateway). | ||
This command initializes the local development environment with all necessary | ||
contracts and configurations. | ||
|
||
## Call a Universal App from EVM | ||
# Option 2: Using the Localnet Repository | ||
|
||
Call the `depositAndCall` function on the EVM gateway to call a universal app | ||
contract: | ||
If you prefer to set up Localnet independently, clone the Localnet repository: | ||
|
||
``` | ||
yarn hardhat deposit-and-call --contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 --amount 2 --message bob --network localhost --revert-address 0x9A676e781A523b5d0C0e43731313A708CB607508 --revert-message 0x --call-on-revert | ||
git clone https://github.com/zeta-chain/localnet | ||
cd localnet | ||
``` | ||
|
||
The command calls the `depositAndCall` function on the EVM gateway. | ||
|
||
The EVM gateway emits a "Deposited" event acknowledging that the function call | ||
has been successful: | ||
Install the necessary packages: | ||
|
||
``` | ||
[EVM]: Gateway: 'Deposited' event emitted | ||
``` | ||
|
||
Localnet picks up the "Deposited" event and calls the ZetaChain's gateway | ||
`execute` function, which calls the universal app: | ||
|
||
``` | ||
[ZetaChain]: Universal contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 executing onCrossChainCall (context: {"origin":"0x610178dA211FEF7D417bC0e6FeD39F05609AD788","sender":"0x735b14BB79463307AAcBED86DAf3322B1e6226aB","chainID":1}), zrc20: 0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c, amount: 2000000000000000000, message: 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000) | ||
yarn | ||
``` | ||
|
||
The `onCrossChainCall` is executed and emits an event: | ||
Start the Localnet by running: | ||
|
||
``` | ||
[ZetaChain]: Event from onCrossChainCall: {"_type":"log","address":"0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82","blockHash":"0xc8a8ebc484c5330f118a9e838587b918657ca2b347b7b76846236c00e44006bd","blockNumber":23,"data":"0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001a48656c6c6f2066726f6d206120756e6976657273616c206170700000000000000000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000","index":2,"removed":false,"topics":["0x39f8c79736fed93bca390bb3d6ff7da07482edb61cd7dafcfba496821d6ab7a3"],"transactionHash":"0x3a6612c174d980a13e3ee6b17a21c4708f0f31b823c1fba1037fc6c4124a7b68","transactionIndex":0} | ||
npx hardhat localnet | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setup options are well-explained, with a minor grammatical correction needed.
The setup instructions for both options are clear, concise, and easy to follow. However, there's a minor grammatical error that should be addressed:
- The examples ships with the latest version of Localnet.
+ The examples ship with the latest version of Localnet.
This correction ensures grammatical accuracy while maintaining the informative nature of the setup instructions.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# Option 1: Using the Example Contracts Repository | |
Once the localnet is started you will see the standard Anvil output with a list | |
of accounts, private keys as well as the output from protocol contracts being | |
deployed. After the localnet is set up you will see a list of protocol contract | |
addresses: | |
To get started with the example contracts, clone the repository and install the | |
dependencies: | |
``` | |
EVM Contract Addresses | |
====================== | |
Gateway EVM: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 | |
ZETA: 0x5FbDB2315678afecb367f032d93F642f64180aa3 | |
ZetaChain Contract Addresses | |
============================ | |
Gateway ZetaChain: 0x610178dA211FEF7D417bC0e6FeD39F05609AD788 | |
ZETA: 0xa513E6E4b8f2a923D98304ec87F64353C4D5C853 | |
ZRC-20 ETH: 0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c | |
git clone https://github.com/zeta-chain/example-contracts | |
cd example-contracts/universal/hello | |
yarn | |
``` | |
Keep the terminal window with localnet running open and open a new terminal. | |
Compile the contracts and deploy both a Hello universal app contract and a | |
Receiver contract. | |
Localnet is installed from the `@zetachain/localnet` package. If you need to | |
update Localnet, run: | |
``` | |
yarn deploy | |
yarn add --dev @zetachain/localnet | |
``` | |
Universal app contract address: | |
``` | |
🚀 Successfully deployed contract on localhost. | |
📜 Contract address: 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 | |
``` | |
The examples ships with the latest version of Localnet. | |
Receiver contract: | |
Start the Localnet by running: | |
``` | |
🚀 Successfully deployed contract on localhost. | |
📜 Contract address: 0x9A676e781A523b5d0C0e43731313A708CB607508 | |
npx hardhat localnet | |
``` | |
Even though both contracts are deployed on the same local testnet we will think | |
of Hello as running on ZetaChain and Receiver as running on a generic EVM chain. | |
These two contracts are connected with each other through the | |
[gateway](/developers/evm/gateway). | |
This command initializes the local development environment with all necessary | |
contracts and configurations. | |
## Call a Universal App from EVM | |
# Option 2: Using the Localnet Repository | |
Call the `depositAndCall` function on the EVM gateway to call a universal app | |
contract: | |
If you prefer to set up Localnet independently, clone the Localnet repository: | |
``` | |
yarn hardhat deposit-and-call --contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 --amount 2 --message bob --network localhost --revert-address 0x9A676e781A523b5d0C0e43731313A708CB607508 --revert-message 0x --call-on-revert | |
git clone https://github.com/zeta-chain/localnet | |
cd localnet | |
``` | |
The command calls the `depositAndCall` function on the EVM gateway. | |
The EVM gateway emits a "Deposited" event acknowledging that the function call | |
has been successful: | |
Install the necessary packages: | |
``` | |
[EVM]: Gateway: 'Deposited' event emitted | |
``` | |
Localnet picks up the "Deposited" event and calls the ZetaChain's gateway | |
`execute` function, which calls the universal app: | |
``` | |
[ZetaChain]: Universal contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 executing onCrossChainCall (context: {"origin":"0x610178dA211FEF7D417bC0e6FeD39F05609AD788","sender":"0x735b14BB79463307AAcBED86DAf3322B1e6226aB","chainID":1}), zrc20: 0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c, amount: 2000000000000000000, message: 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000) | |
yarn | |
``` | |
The `onCrossChainCall` is executed and emits an event: | |
Start the Localnet by running: | |
``` | |
[ZetaChain]: Event from onCrossChainCall: {"_type":"log","address":"0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82","blockHash":"0xc8a8ebc484c5330f118a9e838587b918657ca2b347b7b76846236c00e44006bd","blockNumber":23,"data":"0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001a48656c6c6f2066726f6d206120756e6976657273616c206170700000000000000000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000","index":2,"removed":false,"topics":["0x39f8c79736fed93bca390bb3d6ff7da07482edb61cd7dafcfba496821d6ab7a3"],"transactionHash":"0x3a6612c174d980a13e3ee6b17a21c4708f0f31b823c1fba1037fc6c4124a7b68","transactionIndex":0} | |
npx hardhat localnet | |
``` | |
# Option 1: Using the Example Contracts Repository | |
To get started with the example contracts, clone the repository and install the | |
dependencies: | |
``` | |
git clone https://github.com/zeta-chain/example-contracts | |
cd example-contracts/universal/hello | |
yarn | |
``` | |
Localnet is installed from the `@zetachain/localnet` package. If you need to | |
update Localnet, run: | |
``` | |
yarn add --dev @zetachain/localnet | |
``` | |
The examples ship with the latest version of Localnet. | |
Start the Localnet by running: | |
``` | |
npx hardhat localnet | |
``` | |
This command initializes the local development environment with all necessary | |
contracts and configurations. | |
# Option 2: Using the Localnet Repository | |
If you prefer to set up Localnet independently, clone the Localnet repository: | |
``` | |
git clone https://github.com/zeta-chain/localnet | |
cd localnet | |
``` | |
Install the necessary packages: | |
``` | |
yarn | |
``` | |
Start the Localnet by running: | |
``` | |
npx hardhat localnet | |
``` |
🧰 Tools
🪛 LanguageTool
[grammar] ~56-~56: You should probably use “ship”.
Context: ...v @zetachain/localnet ``` The examples ships with the latest version of Localnet. S...(AGREEMENT_SENT_START)
Summary by CodeRabbit
New Features
Documentation