Skip to content

Commit

Permalink
Merge branch 'main' into togamamora-patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
meganskye committed Aug 19, 2023
2 parents 13f77ef + 35270b2 commit 586dcbd
Show file tree
Hide file tree
Showing 40 changed files with 288 additions and 256 deletions.
2 changes: 1 addition & 1 deletion docs/build/EVM/evm-debug-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Spinning up a debug or tracing node is similar to running a full node. However,

:::info

EVM tracing node installation manual available on this page (INSERT_LINK).
EVM tracing node installation manual available on [this page](/docs/build/nodes/evm-tracing-node).

:::

Expand Down
33 changes: 33 additions & 0 deletions docs/build/EVM/precompiles/batch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Batch Precompile

The batch precompiled contract enables developers to consolidate several EVM calls into a single action. Previously, if users need to engage with multiple contracts, they would need to confirm multiple transactions in their wallet. For instance, this could involve approving a token's access for a smart contract and then performing a transfer or claiming staking rewards on DappsStaking for every era.Through the batch precompile feature, developers can enhance the user experience by condensing these transactions into a batch, thereby reducing the number of confirmations needed to just one. This approach also holds the potential to lower gas fees, as batching avoids incurring multiple base gas fees.

The precompile directly interacts with Substrate's EVM pallet. The caller of the batch function will have their address serve as the `msg.sender` for all subtransactions. However, unlike delegate calls, the target contract will still impact its own storage. Essentially, this process mirrors the effect of a user signing multiple transactions, but with the requirement for only a single confirmation.

| Precompile | Address |
| -------- | -------- |
| `Batch` | 0x0000000000000000000000000000000000005006 |

## The Batch Solidity Interface

Batch.sol is a Solidity interface that allows developers to interact with the precompile's three methods.

The interface includes the following functions:

* **batchSome(address[] to, uint256[] value, bytes[] callData, uint64[] gasLimit)** — performs multiple calls, where the same index of each array combine into the information required for a single subcall. If a subcall reverts, following subcalls will still be attempted

* **batchSomeUntilFailure(address[] to, uint256[] value, bytes[] callData, uint64[] gasLimit)** — performs multiple calls, where the same index of each array combine into the information required for a single subcall. If a subcall reverts, no following subcalls will be executed

* **batchAll(address[] to, uint256[] value, bytes[] callData, uint64[] gasLimit)** — performs multiple calls atomically, where the same index of each array combine into the information required for a single subcall. If a subcall reverts, all subcalls will revert

### Each of these functions have the following parameters:

* **address[] to** - an array of addresses to direct subtransactions to, where each entry is a subtransaction

* **uint256[] value** - an array of native currency values to send in the subtransactions, where the index corresponds to the subtransaction of the same index in the to array. If this array is shorter than the to array, all the following subtransactions will default to a value of 0

* **bytes[] callData** - an array of call data to include in the subtransactions, where the index corresponds to the subtransaction of the same index in the to array. If this array is shorter than the to array, all of the following subtransactions will include no call data

* **uint64[] gasLimit** - an array of gas limits in the subtransactions, where the index corresponds to the subtransaction of the same index in the to array. Values of 0 are interpreted as unlimited and will have all remaining gas of the batch transaction forwarded. If this array is shorter than the to array, all of the following subtransactions will have all remaining gas forwarded

For more information checkout [batch](https://github.com/AstarNetwork/Astar/blob/master/precompiles/batch/Batch.sol) on [astar](https://github.com/AstarNetwork/Astar)
3 changes: 2 additions & 1 deletion docs/build/EVM/precompiles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ The Frontier EVM used on Astar network provides several useful precompiled contr
| [Sr25519](sr25519.md) | 0x0000000000000000000000000000000000005002 |
| [SubstrateEcdsa](substrate-ecdsa.md) | 0x0000000000000000000000000000000000005003 |
| [XCM](xcm.md) | 0x0000000000000000000000000000000000005004 |
| [assets-erc20](xc20.md) | ASSET_PRECOMPILE_ADDRESS_PREFIX |
| [XVM](xvm.md) | 0x0000000000000000000000000000000000005005 |
| [Batch](batch.md) | 0x0000000000000000000000000000000000005006 |
| [assets-erc20](xc20.md) | ASSET_PRECOMPILE_ADDRESS_PREFIX |

The interface descriptions for these precompiles can be found in the `precompiles` folder: [astar-frame repo](https://github.com/AstarNetwork/astar-frame/).
The Addresses can be checked in the [Astar repo](https://github.com/AstarNetwork/Astar/tree/master/runtime) for each runtime in `precompile.rs` files.
Expand Down
2 changes: 1 addition & 1 deletion docs/build/EVM/precompiles/xc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

XC20 standard, created by the Moonbeam team, ensures compatibility between the EVM and Substrate framework that powers Polkadot via precompiles — special built-in smart contracts made to look like ERC20s. Calling functions on an XC20 invokes underlying Substrate functionality, which could be instructions to move tokens to another chain, or send them to another local address. This compatibility layer connects the world of EVM and smart contracts to advanced Substrate-based interoperability scenarios.

For XC20 overview see the following page (INSERT_LINK).
For XC20 overview see the following page (/docs/learn/xcm/building-with-xcm/create-xc20-assets).

# See also

Expand Down
6 changes: 3 additions & 3 deletions docs/build/EVM/precompiles/xcm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ The XCM Precompile provides the following functions to handle specific XCM opera

| Function | Description |
| -------- | -------- |
| `assets_withdraw` (INSERT_LINK) | Withdraw previously transferred assets |
| `assets_reserve_transfer` (INSERT_LINK) | Transfer assets to a remote chain |
| `remote_transact` (INSERT_LINK) | Execute a transaction on a remote chain |
| `assets_withdraw` (/docs/learn/xcm/building-with-xcm/xc-assets-withdraw) | Withdraw previously transferred assets |
| `assets_reserve_transfer` (/docs/learn/xcm/building-with-xcm/xc-reserve-transfer/) | Transfer assets to a remote chain |
| `remote_transact` (/docs/learn/xcm/building-with-xcm/xc-remote-transact/) | Execute a transaction on a remote chain |
2 changes: 1 addition & 1 deletion docs/build/Introduction/create_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sidebar_position: 3
---

# Create Account
If you never created a native Astar account, please follow the instructions in User Guide (INSERT_LINK).
If you never created a native Astar account, please follow the instructions in the [User Guide](/docs/use/user-guides/create-wallet).

If you are building EVM smart contracts you will need Metamask. Watch this short video to learn how.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ In order to confirm receiving the asset on EVM, we need to add the specific asse
- Convert the `asset ID` from hexadecimal to decimal
- Add the prefix of `0xffffffff`
- for example, our Cookbook Token, CKT, has `asset ID` of `229`. Following the step above, we will have the converted address of `0xffffffff000000000000000000000000000000E5`.
- More information can be found in the following guide: Send XC20 Assets to EVM (INSERT_LINK)
- More information can be found in the following guide: [Send XC20 Assets to EVM](/docs/build/builder-guides/leverage_parachains/interact_with_xc20.md#send-the-asset-to-evm)

![Untitled](mintable-xc20-cookbook/Untitled%207.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/build/environment/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The free endpoints below are dedicated to end users, they can be used to interac
<b>They limit the rate of API calls</b>, so they are not suitable for high demand, such as a dApp UI constantly scraping blockchain data or an indexer.
:::
:::tip
To meet the demands of a production dApp you can run an archive node (INSERT_LINK) **or** get your own API key from one of our infra partners (INSERT_LINK).
To meet the demands of a production dApp you can run an [archive node](/docs/build/nodes/archive-node/) **or** get your own API key from one of our [infrastructure partners](/docs/build/integrations/node-providers).
:::

<Tabs>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/environment/zombienet-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ For all steps, encoded call data will be provided to simplify the process for th
After completing the previous steps, cross-chain SDN and SBY wrappers are configured as payable and sufficient assets.
The following steps will explain how to execute a cross-chain remote call. `Alice` will send an instruction from `Shiden` to execute `System::remark_with_event` on `Shibuya`.

`Alice` isn't able to directly control `Alice` on the destination chain, instead a new account will be derived. More information can be found here (INSERT_LINK).
`Alice` isn't able to directly control `Alice` on the destination chain, instead a new account will be derived. More information can be found [here](/docs/learn/xcm/building-with-xcm/xc-remote-transact.md#derived-remote-accounts).

1. Calculate `Alice's` derived account on `Shibuya` when sending instructions from `Shiden`.
```
Expand Down
4 changes: 2 additions & 2 deletions docs/build/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ The shared security of Polkadot, coupled with Astar XVM, allows developers to de
Wasm smart contracts empower developers, and bridge the gap between blockchain and traditional software development, allowing them to build complex dApps with tools and languages they already know. Wasm provides direct access to the runtime in a number of ways, so developers can build dApps that aren't possible on the Ethereum Virtual Machine. Any programming language that compiles to Wasm may eventually be supported, making Astar network a secure and versatile environment for deployment of highly-optimized smart contracts. See the [Wasm chapter](/docs/build/wasm) for more information.

## EVM smart contracts
Solidity developers will feel right at home building on Astar EVM, as it provides an equivalent environment, and simultaneously allows them to fragment smart contracts and offload logic selectively to the Wasm Virtual Machine for applications that have different operating requirements. See the [EVM chapter.](/docs/build/evm) for more information.
Solidity developers will feel right at home building on Astar EVM, as it provides an equivalent environment, and simultaneously allows them to fragment smart contracts and offload logic selectively to the Wasm Virtual Machine for applications that have different operating requirements. See the [EVM chapter](/docs/build/evm) for more information.

## Build2Earn
Astar network's innovative Build2Earn program allows developers to earn a basic income while they build out their products and communities. Users are able to support projects by staking on them, which adds to the passive income developers earn. Build2Earn encourages projects to stand out, and provide value directly to the end-users. See the dApp staking (INSERT_LINK) section for more information.
Astar network's innovative Build2Earn program allows developers to earn a basic income while they build out their products and communities. Users are able to support projects by staking on them, which adds to the passive income developers earn. Build2Earn encourages projects to stand out, and provide value directly to the end-users. See the [dApp staking section](/docs/build/dapp-staking/) for more information.

## XVM - The cross virtual machine
The Cross Virtual Machine allows developers to call smart contracts from one VM to another (e.g. Wasm to EVM), and `XVM`, the innovative protocol that makes creation of these hybrid cross-VM dApps possible, is *only* available on Astar network.
Expand Down
2 changes: 1 addition & 1 deletion docs/build/integrations/indexers/subsquid.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 1

# Subsquid

[Subsquid](https://subsquid.io) is an indexing framework supporting both Substrate (INSERT_LINK) and EVM (INSERT_LINK)-based chains. It is [extremely flexible and offers high syncing speeds](https://docs.subsquid.io/migrate/subsquid-vs-thegraph/). Subsquid comes with a set of code generation tools that make ready-to-use, customizable indexer projects ("squids") out of contracts' ABIs. WASM/ink! and EVM/Solidity contracts are supported. Once scraped, the contract data can be served over a GraphQL API or stored as a dataset.
[Subsquid](https://subsquid.io) is an indexing framework supporting both [Substrate](/docs/build/wasm) and [EVM](/docs/build/EVM)-based chains. It is extremely flexible and offers [high syncing speeds](https://docs.subsquid.io/migrate/subsquid-vs-thegraph/). Subsquid comes with a set of code generation tools that make ready-to-use, customizable indexer projects ("squids") out of contracts' ABIs. WASM/ink! and EVM/Solidity contracts are supported. Once scraped, the contract data can be served over a GraphQL API or stored as a dataset.

Squids can run either locally or in a Subsquid-provided a cloud service called Aquarium. The service has and will always have a free tier. For more demanding applications it offers a premium subscription.

Expand Down
2 changes: 1 addition & 1 deletion docs/build/integrations/indexers/thegraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In this guide, we will demonstrate how to run an Astar node for getting more ins

## Running a Graph Node

After successfully running an [RPC node](https://docs.astar.network/docs/nodes/archive-node/), the Graph node will need to be installed and configured to connect to a separate computer. If you are running a self-signed RPC node, you will need to set up an extra environment variable for allowance.
After successfully running an [RPC node](https://docs.astar.network/docs/build/nodes/archive-node/), the Graph node will need to be installed and configured to connect to a separate computer. If you are running a self-signed RPC node, you will need to set up an extra environment variable for allowance.

The first step is to clone the [Graph Node repository](https://github.com/graphprotocol/graph-node/):

Expand Down
5 changes: 3 additions & 2 deletions docs/build/integrations/node-providers/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Node Providers

The free endpoints mentioned in the [Build Environment section](/docs/build/environment/endpoints.md) are rate limited and designed for end users to be able to interact with dApps, or deploy/call smart contracts. They are not suitable for usage by dApp UIs that scrape blockchain data continuously, or indexers (like the Graph).
The free endpoints mentioned in the [Build Environment section](/docs/build/environment/endpoints) are rate limited and designed for end users to be able to interact with dApps, or deploy/call smart contracts. They are not suitable for usage by dApp UIs that scrape blockchain data continuously, or indexers (like the Graph).


If you are an active developer you should consider creating your own endpoint, and it is mandatory to do so for production deployments. Refer to how run an archive node (INSERT_LINK) for more information, or obtain an API key from one of our infrastructure providers, listed below:
If you are an active developer you should consider creating your own endpoint, and it is mandatory to do so for production deployments. Refer to how run an [archive node](/docs/nodes
/archive-node/) for more information, or obtain an API key from one of our infrastructure providers, listed below:


```mdx-code-block
Expand Down
2 changes: 1 addition & 1 deletion docs/build/integrations/wallets/ledger/ledger-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Ledger NanoS users should install the Astar XL version of the app, shown in the
<img src={ledger8} style={{width: 600}} />
</div>

For detailed information about dApp staking or how to stake on the EVM side of Astar Portal using a Ledger device, please refer to the Astar documentation (INSERT_LINK) or [Ledger EVM staking guide](./ledger-evm.md)
For detailed information about dApp staking or how to stake on the EVM side of Astar Portal using a Ledger device, please refer to the [Astar official documentation](/docs/build/dapp-staking/for-stakers/) or [Ledger EVM staking guide](./ledger-evm.md)

:::tip
If you receive a **Ledger error: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface** message during the dApp staking claim process, ensure you are performing the operation using a Chromium-based browser such as Chrome or Brave, and the Ledger device connection method is WebHID, as outlined in the previous step.
Expand Down
8 changes: 4 additions & 4 deletions docs/build/nodes/archive-node/binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ curl -H "Content-Type: application/json" --data '{ "jsonrpc":"2.0", "method":"sy

## Next steps

For any usage, wait for the chain to be fully sync by checking the node log (INSERT_LINK).
For any usage, wait for the chain to be fully sync by checking the [node log](/docs/build/nodes/archive-node/binary#get-node-logs).

It all depends on what you plan to do with your archive node.

- In most cases, you will want to access node from outside. In this case, nginx server (INSERT_LINK) is the recommended option.
- In most cases, you will want to access node from outside. In this case, [nginx server](/docs/build/nodes/archive-node/nginx) is the recommended option.
- If you run your dApp on the same server as the node, then you can access it directly with the `localhost` address. This setup is recommended for testing purpose only.
- If you run the node locally for testing purpose, you can switch the network in [Polkadot.js portal](https://polkadot.js.org/apps) and explore the chain:

Expand All @@ -214,7 +214,7 @@ To access data from indexers (e.g. The Graph) or Oracles (e.g. Chainlink), you n

### Upgrade node

When an upgrade is necessary, node operators are be notified in our Discord (INSERT_LINK) and Element (INSERT_LINK) group.
When an upgrade is necessary, node operators are be notified in our Discord and Element group.

Download the [latest release](https://github.com/AstarNetwork/Astar/releases/latest) from Github

Expand Down Expand Up @@ -243,5 +243,5 @@ sudo systemctl start astar.service

### Snapshot

Please refer to the **snapshot page** (INSERT_LINK).
Please refer to the [**snapshot page**](/docs/build/nodes/snapshots).
:::
10 changes: 5 additions & 5 deletions docs/build/nodes/archive-node/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ curl -H "Content-Type: application/json" --data '{ "jsonrpc":"2.0", "method":"sy

## Next steps

In any case, wait for the chain to be fully synchronized by checking the node log (INSERT_LINK).
In any case, wait for the chain to be fully synchronized by checking the [node log](/docs/build/nodes/archive-node/binary#get-node-logs).

How the archive node will be used will largely determine what steps to follow next:
- If accessing the node publicly, running an nginx server (INSERT_LINK) is the recommended option.
- If accessing the node publicly, running an [nginx server](/docs/build/nodes/archive-node/nginx) is the recommended option.
- If the dApp is running on the same server as the node, then it can be accessed directly with the `localhost` address. This setup is recommended for testing purposes only.
- If running the node locally for testing purposes, switch networks in [Polkadot.js portal](https://polkadot.js.org/apps) to explore the chain:

Expand Down Expand Up @@ -151,7 +151,7 @@ To access data from indexers (like The Graph) or Oracles (like Chainlink), add t

## Upgrade node

When a node upgrade is necessary, node operators are notified with instructions in the [Astar Dev Announcement Telegram](https://t.me/+cL4tGZiFAsJhMGJk), Astar Discord (INSERT_LINK), and [Astar Node Upgrade Element channel](https://matrix.to/#/#shiden-runtime-ann:matrix.org). Join and follow any of these channels to receive news about node updates and node upgrades.
When a node upgrade is necessary, node operators are notified with instructions in the [Astar Dev Announcement Telegram](https://t.me/+cL4tGZiFAsJhMGJk), [Astar Discord](https://discord.gg/Z3nC9U4), and [Astar Node Upgrade Element channel](https://matrix.to/#/#shiden-runtime-ann:matrix.org). Join and follow any of these channels to receive news about node updates and node upgrades.

To upgrade to the latest node version, stop and remove the actual container:

Expand All @@ -177,9 +177,9 @@ sudo rm -R /var/lib/astar/*

where `CHAIN` is `astar`, `shiden`, or `shibuya`.

Then start a new container by following the instructions under the Start Docker node (INSERT_LINK) section.
Then start a new container by following the instructions under the [Start Docker node](/docs/build/nodes/archive-node/docker#start-docker-node) section.

### Snapshot

Please refer to **snapshot page** (INSERT_LINK).
Please refer to [**snapshot page**](/docs/build/nodes/snapshots/).
:::
Loading

0 comments on commit 586dcbd

Please sign in to comment.