Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschakki committed Feb 11, 2025
2 parents 1d423a6 + ad8be86 commit eab7799
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ However, for this guide, we will mainly talk about the [thirdweb Explore](https:
- [Build (Solidity SDK)](https://portal.thirdweb.com/contracts/build/overview): Write custom smart contracts.
- [Deploy](https://portal.thirdweb.com/contracts/deploy/overview): Support for contract deployment built for any use case.
- [Publish](https://portal.thirdweb.com/contracts/publish/overview): Publish your contracts onchain.
- [Interact](https://portal.thirdweb.com/contracts/interact/overview): Interact with smart contracts and integrate smart contracts directly into your app.

## Deploying pre-built contracts via thirdweb Explore
In case you want to deploy a pre-built contract without any customization, thirdweb offers a convenient way to do so with **Explore**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ The `0x` prefix indicates that the following string is a hexadecimal number.
</Tabs>

:::info
In addition to making a JSON-RPC request (`eth_requestAccounts`) to get an Account, viem provides various helper methods for creating an `Account`, including: [`privateKeyToAccount`](https://viem.sh/docs/accounts/privateKey.html), [`mnemonicToAccount`](https://viem.sh/docs/accounts/mnemonic.html), and [`hdKeyToAccount`](https://viem.sh/docs/accounts/hd.html).
In addition to making a JSON-RPC request (`eth_requestAccounts`) to get an Account, viem provides various helper methods for creating an `Account`, including: [`privateKeyToAccount`](https://viem.sh/docs/accounts/local/privateKeyToAccount), [`mnemonicToAccount`](https://viem.sh/docs/accounts/local/mnemonicToAccount), and [`hdKeyToAccount`](https://viem.sh/docs/accounts/local/hdKeyToAccount).

{ /* To use Lisk Sepolia (testnet), replace `lisk` with `liskSepolia`.
*/}
Expand Down
87 changes: 70 additions & 17 deletions docs/building-on-lisk/run-a-lisk-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,22 @@ If you're looking to harden your app and avoid rate-limiting for your users, ple

## System requirements

The following system requirements are recommended to run a Lisk L2 node.
We recommend you the following hardware configuration to run a Lisk L2 node:

### Memory
- a modern multi-core CPU with good single-core performance
- a minimum of 16 GB RAM (32 GB recommended)
- a locally attached NVMe SSD drive
- adequate storage capacity to accommodate both the snapshot restoration process (if restoring from snapshot) and chain data, ensuring a minimum of (2 * current_chain_size) + snapshot_size + 20%_buffer
- if running with Docker, please install Docker Engine version [27.0.1](https://docs.docker.com/engine/release-notes/27.0/) or higher

- Modern multi-core CPU with good single-core performance.
- Machines with a minimum of 16 GB RAM (32 GB recommended).

### Storage

- Machines with a high performance SSD drive with at least 750GB (full node) or 4.5TB (archive node) free.
*Note: If utilizing Amazon Elastic Block Store (EBS), ensure timing buffered disk reads are fast enough in order to avoid latency issues alongside the rate of new blocks added to Base during the initial synchronization process; `io2 block express` is recommended.*

## Usage

:::note
It is currently not possible to run the nodes with the `--op-network` flag until the configs for Lisk have been merged into the [superchain-registry](https://github.com/ethereum-optimism/superchain-registry).
It is now possible to run the Lisk nodes with the `--op-network` flag on the `op-geth` execution client.

There is currently an [open PR](https://github.com/ethereum-optimism/superchain-registry/pull/234) to add the Lisk Mainnet config.
The Lisk Sepolia Testnet will be supported soon as well.
It is still not possible to run the Lisk nodes with the `--chain` flag on the `op-reth` execution client.
:::

### Clone the Repository
Expand All @@ -84,17 +82,35 @@ cd lisk-node
If running your own L1 node, it needs to be synced before the Lisk node will be able to fully sync.
2. Please ensure that the environment file relevant to your network (`.env.sepolia`, or `.env.mainnet`) is set for the `env_file` properties within `docker-compose.yml`.
By default, it is set to `.env.mainnet`.
:::info
We currently support running either the `op-geth` or the `op-reth` nodes alongside the `op-node`. By default, we run the `op-geth` node. If you would like to run the `op-reth` node instead, please set the `CLIENT` environment variable to `reth` before starting the node.
3. We currently support running either the `op-geth` or the `op-reth` nodes alongside the `op-node`. By default, we run the `op-geth` node. If you would like to run the `op-reth` node instead, please set the `CLIENT` environment variable to `reth` before starting the node.
:::note
The `op-reth` client can be built in either the `maxperf` (default) or `release` profile. To learn more about them, please check reth's documentation on [Optimizations](https://github.com/paradigmxyz/reth/blob/main/book/installation/source.md#optimizations). Please set the `RETH_BUILD_PROFILE` environment variable accordingly.
Unless you are building the `op-reth` client in `release` profile, please ensure that you have a machine with 32 GB RAM.
Additionally, if you have the Docker Desktop installed on your system, please make sure to set Memory limit to a minimum of 16 GB.
It can be set under `Settings -> Resources -> Resource Allocation -> Memory limit`.
:::
3. Run:

4. Run:
:::important
Important: To run the node on Lisk Sepolia, first patch the Dockerfile(s) with:
```sh
git apply dockerfile-lisk-sepolia.patch
```
:::

with `op-geth` execution client:

```sh
docker compose up --build --detach
```

4. You should now be able to `curl` your Lisk node:
or, with `op-reth` execution client:

```sh
CLIENT=reth RETH_BUILD_PROFILE=maxperf docker compose up --build --detach
```
5. You should now be able to `curl` your Lisk node:
```sh
curl -s -d '{"id":0,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false]}' \
-H "Content-Type: application/json" http://localhost:8545
```
Expand All @@ -114,5 +130,42 @@ $( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Cont
```
[partners]: /lisk-tools/api-providers
[lisk node]: https://github.com/LiskHQ/lisk-node
[partners]: /lisk-tools/node-providers
[lisk node]: https://github.com/LiskHQ/lisk-node
### Snapshots
:::note
- Snapshots are available for both `op-geth` and `op-reth` clients:
- `op-geth` supports both export and datadir snapshots
- `op-reth` only supports datadir snapshots
- All snapshots are from archival nodes
- Snapshot types:
- `export`: small download size, slow to restore from, data is verified during restore (`op-geth` only)
- `datadir`: large download size, fast to restore from, no data verification during restore
:::
To enable auto-snapshot download and application, set the `APPLY_SNAPSHOT` environment variable to true when starting the node:
```sh
APPLY_SNAPSHOT=true docker compose up --build --detach
```
To specify the client and snapshot type, set both the `CLIENT` and `SNAPSHOT_TYPE` environment variables:

```sh
# For op-geth with export snapshot (default)
APPLY_SNAPSHOT=true CLIENT=geth SNAPSHOT_TYPE=export docker compose up --build --detach

# For op-geth with datadir snapshot
APPLY_SNAPSHOT=true CLIENT=geth SNAPSHOT_TYPE=datadir docker compose up --build --detach

# For op-reth (only supports datadir)
APPLY_SNAPSHOT=true CLIENT=reth SNAPSHOT_TYPE=datadir docker compose up --build --detach
```

You can also download and apply a snapshot from a custom URL by setting the `SNAPSHOT_URL` environment variable.
Please make sure the snapshot file ends with `*.tar.gz`.

```sh
APPLY_SNAPSHOT=true SNAPSHOT_URL=<custom-snapshot-url> docker compose up --build --detach
```
36 changes: 18 additions & 18 deletions docs/building-on-lisk/web3-app-development.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Web3 App Development
title: Web3 app development
description: 'An introduction into Web3 application development on Lisk.'
keywords:
[
Expand All @@ -21,11 +21,11 @@ toc_max_heading_level: 4
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Web3 App Development
# Web3 app development

On this page, you will learn what Web3 applications are, how they differ from Web 2.0 apps, and how to get started with Web3 app development on Lisk.

## What are Web3 Applications?
## What are Web3 applications?

### Evolution of the Web

Expand Down Expand Up @@ -55,7 +55,7 @@ To describe important steps in this innovation, websites, and apps are generally
Many of these applications and services became important pillars of the internet and people's lives, and even society as a whole.
However, the more relevant these applications became, the more obvious and relevant their limitations became, as users had to trust the companies behind them with their data and privacy.

##### Web2 Limitations
##### Web 2.0 limitations

Though Web 2.0 revolutionized how people positively used the web, a few of its characteristics led to certain disadvantages for users interacting with Web2 applications. For example:

Expand Down Expand Up @@ -100,10 +100,10 @@ To describe important steps in this innovation, websites, and apps are generally
</TabItem>
</Tabs>

### Further Reading
### Further reading
- [Introduction to Web3](https://ethereum.org/en/web3/) *by Ethereum*

## Getting Started with Web3 App Development
## Getting started with Web3 app development

### Platforms

Expand Down Expand Up @@ -154,7 +154,7 @@ So if you application requires a lot of computing power, and/or a very complex U
*/}
</Tabs>

### Onboarding Web2 Users to Web3
### Onboarding Web2 users to Web3

A significant challenge for Web3 applications is delivering a user experience that is as seamless as what users expect from Web2 applications.

Expand Down Expand Up @@ -194,7 +194,7 @@ Bundling is the process where a node/bundler collects multiple UserOperations an
- **Paymaster**(optional): a helper contract that agrees to pay for the transaction, instead of the sender itself.
Paymasters can cover gas costs for users, sponsor specific transactions, or implement custom fee models, opening doors for novel use cases.

##### Further Reading
##### Further reading
- [Account abstraction: A complete overview](https://blaize.tech/blog/account-abstraction-guide/) *by Blaize*
- [What is Account Abstraction (ERC-4337)?](https://www.alchemy.com/overviews/what-is-account-abstraction) *by Alchemy*
- [What is Account Abstraction? ERC-4337 Explained](https://blog.thirdweb.com/account-abstraction-erc4337/) *by thirdweb*
Expand All @@ -212,13 +212,13 @@ However, to fix bugs or add new features to an already deployed smart contract,
- Bug bounty programs
- handling user data */}

### Testing and Deployment
### Testing and deployment
When it comes to testing and deployment of Web3 apps, there are some additional aspects to consider compared to Web2 apps.
The intrinsic vulnerabilities of smart contracts, the immutability of blockchain data, and the interactions with a decentralized network, call for specific testing and security measures.
Gladly, many tools are already available to help developers ensure the security and reliability of their Web3 apps.
The list below provides a selection of popular tools and services used to test Web3 apps:

#### Smart Contract Test Suites
#### Smart contract test suites
Often, smart contract development frameworks come with built-in testing tools that simplify to create comprehensive tests for smart contracts.
This includes utilities to simplify writing of the tests, or the ability to spin up a local node for deploying and testing smart contracts in a local development network, i.e. Devnet.

Expand All @@ -242,7 +242,7 @@ Tests are written in JavaScript / Typescript.
- [Deploying a smart contract with Hardhat](/building-on-lisk/deploying-smart-contract/with-Hardhat.md)
- [Deploying a smart contract with Remix](/building-on-lisk/deploying-smart-contract/with-Remix.mdx)

#### Smart Contract Code Analysis
#### Smart contract code analysis
To ensure the security of smart contracts, it is essential to analyze the code for vulnerabilities.
There are several tools available that help developers to analyze their smart contracts for common security issues and vulnerabilities, for example:

Expand All @@ -254,15 +254,15 @@ There are several tools available that help developers to analyze their smart co
Testnets are public blockchains that are used for testing purposes.
They often have the same features as the mainnet, but the tokens on the testnet have no real value - this allows developers to test their smart contracts and Web3 apps in a real-world environment without risking real assets.
Before deploying a smart contract to the mainnet, it is highly recommended to test it on a testnet to ensure that it works as expected.
##### Public Testnets
##### Public testnets
The following testnets are available for testing smart contracts and Web3 apps on Lisk:
- [Lisk Sepolia](/about-lisk/network-info.md#lisk-sepolia-testnet)

:::tip
To get free testnet ETH and/or LSK, check out our [available faucets](/lisk-tools/faucets.md).
:::

##### Virtual Testnets
##### Virtual testnets
[Tenderly](https://tenderly.co/) recently introduced the possibility to spin up [Virtual Testnets](https://blog.tenderly.co/how-virtual-testnets-replace-public-testnets/).
Virtual Testnets are a new way to test your Web3 apps, bringing the onchain data of a mainnet and the flexibility of a local environment together.

Expand All @@ -275,7 +275,7 @@ Mint both native and ERC-20 tokens in any amount you need, impersonate accounts,
Virtual Testnets are easy to set up and configure, giving you full control and flexibility over your environments.
You can even manipulate the state of your forked chains with custom values, custom chain IDs, and more, making sure they fit your unique requirements.

#### E2E Testing
#### E2E testing
End-to-end (E2E) testing is a type of software testing that tests the complete flow of an application from start to finish.
This specifically includes testing the frontend of your application, which ensures that the user interface works as expected.
To deal with stuff like wallets, and other Web3-specific things, you might want to use specialized Web3 E2E testing tools.
Expand All @@ -302,7 +302,7 @@ Some popular monitoring tools are:
- [Prometheus](https://prometheus.io/) combined with [Grafana](https://grafana.com/)
- [Elastic Stack (ELK)](https://www.elastic.co/elastic-stack)

### Web2 vs Web3 App Development
### Web2 vs Web3 app development
#### Languages
Concerning frontend app development, there aren't many differences between Web2 and Web3 apps when it comes to programming languages.
All languages that are typically used for Web2 app development can also be used for Web3 app development.
Expand All @@ -312,7 +312,7 @@ However, the backend of Web3 apps is quite different, as it interacts with the b
Smart contracts are written in [Solidity](https://soliditylang.org/), therefore Web3 developers need to know Solidity to build the smart contracts they require for their app.
Luckily, for many use cases, there are already audited smart contracts available(see [OpenZeppelin](https://www.openzeppelin.com/solidity-contracts) or [thirdweb](https://thirdweb.com/explore)) that can be used, so developers don't need to write all of their smart contracts from scratch.

#### Tech Stack
#### Tech stack
As mentioned above, the Web2 and Web3 app frontend development is very similar.
Theoretically, you could build a Web3 app with nearly the same tech stack as a Web2 app, like Next.js, Vite, etc.
The only thing you need to add is a way for your application to interact with the blockchain, see [Data access](#data-access).
Expand All @@ -321,7 +321,7 @@ To support developers, many blockchain platforms offer their own SDKs and tools
There are also SDKs for Web3 app development, like [thirdweb](https://thirdweb.com/) or [Alchemy](https://www.alchemy.com/), which take away most of the complexity of blockchain development and provide a smooth developer experience.
thirdweb supports [Lisk](https://thirdweb.com/lisk) and many other EVM-compatible blockchains.

#### Data Storage
#### Data storage
In Web2 apps, data is typically stored in a centralized database.
In Web3 apps, some data is stored on the blockchain, i.e., a decentralized database.
How the data is stored is defined inside of smart contracts.
Expand All @@ -330,7 +330,7 @@ Especially sensitive and private user data should not be stored on the blockchai
In addition, storing large amounts of data onchain is both expensive and slow.
Therefore, Web3 apps sometimes use a combination of onchain storage and offchain storage.

#### Data Access
#### Data access
In Web2 apps, data from the database is accessed through APIs.
In Web3 apps, blockchain data is accessed through smart contracts.
They usually expose public functions that can be called by the app frontend to read and/or write data from/to the blockchain, similar to a classical API.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: API Providers
slug: /lisk-tools/api-providers
title: Node providers
slug: /lisk-tools/node-providers
description: Documentation for Node Providers for the Lisk network. Including details on their services, supported networks, and pricing plans.
keywords:
[
Expand All @@ -24,28 +24,21 @@ keywords:
]
---

# API Providers
# Node providers

Lisk nodes expose an RPC API that allows other parties to interact with the blockchain by invoking requests.

If you're just getting started and need an RPC URL, you can use our [free endpoints](#lisk-rpc).
If you're looking to strengthen your app and avoid rate-limiting for your users, please check out our available RPC node providers like [dRPC](#drpc).

## API reference

:::tip[API reference]
The available endpoints for Lisk nodes include all [Geth RPC endpoints](https://geth.ethereum.org/docs/interacting-with-geth/rpc), which also include all standard [JSON-RPC API endpoints](https://ethereum.github.io/execution-apis/api-documentation/) of Ethereum.

:::

## Lisk RPC

Free, rate limited RPC endpoints for the Lisk networks.


<!-- | | Lisk Sepolia Testnet |
| :------ | :------ |
|**HTTP RPC** | https://rpc.sepolia-api.lisk.com |
|**WS RPC** | `wss://ws.sepolia-api.lisk.com` | -->

| | Lisk Sepolia Testnet | Lisk |
| :------ | :------ | :----------------------- |
|**HTTP RPC** | https://rpc.sepolia-api.lisk.com | https://rpc.api.lisk.com |
Expand All @@ -65,7 +58,7 @@ They provide a free tier that allows for an unlimited amount of requests over pu

You can also check the available endpoints for Lisk directly under [https://drpc.org/public-endpoints/lisk](https://drpc.org/public-endpoints/lisk).

dRPC also provides a [faucet for Lisk Sepolia](faucets.md#drpc-faucet).
dRPC also provides a [faucet for Lisk Sepolia](./faucets.md#drpc-faucet).

:::note[How to create API keys for dRPC]
In order to use the provided endpoints, you need to [get the corresponding API keys](https://docs.drpc.org/gettingstarted/createaccount).
Expand All @@ -92,3 +85,11 @@ To use the Moralis RPC Nodes, follow these steps:
2. **Set up your node:** Visit the [Setting Up RPC Nodes](https://docs.moralis.com/get-your-node-api-key) guide to create and configure your RPC node.
3. **Make your first RPC call:** Once you have your node set up, follow the [tutorial](https://docs.moralis.com/make-your-first-rpc-call) to make your first JSON-RPC call using ethers.js.

## Tenderly

[Tenderly](https://tenderly.co/) is a Web3 development platform that offers its tools and infrastructure across 79+ networks. Some networks, like Lisk, also have node RPC support.

- [Lisk Mainnet nodes by Tenderly](https://docs.tenderly.co/node/rpc-reference/lisk)
- [Lisk Sepolia Testnet nodes by Tenderly](https://docs.tenderly.co/node/rpc-reference/lisk-sepolia)

Tenderly provides a [free trier](https://tenderly.co/pricing) to user their RPC nodes.
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ $( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Cont
```
[partners]: /lisk-tools/api-providers
[partners]: /lisk-tools/node-providers
[lisk node]: https://github.com/LiskHQ/lisk-node
Loading

0 comments on commit eab7799

Please sign in to comment.