Skip to content

Commit

Permalink
Merge pull request #300 from neonlabsorg/main
Browse files Browse the repository at this point in the history
Align downsteam with production
  • Loading branch information
himaster authored Nov 28, 2023
2 parents dca9dbd + bdb214f commit e930cd6
Show file tree
Hide file tree
Showing 39 changed files with 711 additions and 1,024 deletions.
9 changes: 3 additions & 6 deletions docs/about/neon_ecosystem.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ approvedBy: YYY
links: The ecosystem image links to /docs/tokens/neon_token and /docs/tokens/gas_fees
comment: #2 TODO Tracer API needs internal linking to replace Medium article todo we have more wallets than just MetaMask -- perhaps add an FAQ and link there? TODO what was the outcome of Anton not wanting to use BPF?
---
import {ImgTheme} from '@site/src/components/ImageTheme';
import {QuickLookNeonImage} from '@site/src/components/QuickLookNeonImage';
import {NeonEcosystemView} from '@site/src/components/NeonEcosystemView';

<QuickLookNeonImage></QuickLookNeonImage>

[//]: # (<ImgTheme src='/img/doc-images/about/neon-ecosystem.svg' srcDark='/img/doc-images/about/neon-ecosystem_dark.svg' />)
<NeonEcosystemView></NeonEcosystemView>

**Neon EVM** is *the* solution that makes Solana's throughput, swift block speeds, and low gas prices available to Ethereum contracts. Neon EVM interacts directly with Solana nodes to carry out transactions on Solana. The service is made up of three main components:

Expand Down Expand Up @@ -87,7 +84,7 @@ Oracles enable the decentralized Web3 ecosystem to access price feeds and other
Neon EVM is supported by EVM-compatible wallets such as MetaMask's non-custodial wallet.

> This allows dApp devs to sign deployment transactions and mint tokens.
<!-- > Learn more about minting and wrapping tokens with Neon EVM. suggest adding link here as Phantom wallet is invovled for Solana-based mints -->
<!-- > Learn more about minting and wrapping tokens with Neon EVM. suggest adding link here as Phantom wallet is involved for Solana-based mints -->
### Protocols

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/eth_sol_solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Clients work on a different blockchain via the same interface by changing the ad

The Neon EVM runs inside BPF, which is run by Solana. The Neon EVM is a Solana contract, so it recognizes the transaction format from the received batch. Neon EVM extracts data from each transaction, therefore, it can retrieve all the original user information placed in the transaction.

<!-- I can't unpack the preceeding p todo -->
<!-- I can't unpack the preceding p todo -->

The Neon EVM also validates the N-tx signature. If the signature is authentic, the Neon EVM takes the contract code that the transaction is addressed to and starts to execute it. As soon as the contract code has been executed successfully, Neon EVM records a new state.

Expand Down
37 changes: 20 additions & 17 deletions docs/developing/connect_rpc.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
---
title: Connect to Neon RPC
proofedDate: 20230526
proofedDate: 20231101
iterationBy: na
includedInSite: true
approvedBy: na
comment:
comment:
---

import chainlist_raw from '@site/static/img/doc-images/developing/chainlist/chainlist-raw-2.png';
import chainlist_raw from '@site/static/img/doc-images/developing/chainlist/chainlist-raw-3.png';

## TL;DR
RPC endpoints are available on [Chainlist](https://chainlist.org/?chain=245022926&testnets=true&search=Neon+EVM).

RPC endpoints are available on [Chainlist](https://chainlist.org/?chain=245022926&testnets=true&search=Neon+EVM).

## Introduction
This tutorial explains how to connect to a Neon RPC via Chainlist. You may connect an EVM-compatible wallet to a network and accept the default Proxy. Alternatively, you can mannually setup your Proxy Operator.

This tutorial explains how to connect to a Neon RPC via Chainlist. You may connect an EVM-compatible wallet to a network and accept the default Proxy. Alternatively, you can manually set up your Proxy Operator.

> The [Proxy Operator you choose](#choose-a-remote-proxy) is responsible for settling your Neon transactions on Solana. Chainlist will assign a default, but you can edit this later.
## Connect via Chainlist
To connect an EVM-compatible wallet such as MetaMask to Neon EVM:

To connect an EVM-compatible wallet such as MetaMask to Neon EVM:

1.1 Visit [Neon's Chainlist](https://chainlist.org/?chain=245022926&testnets=true&search=Neon+EVM) page.

Expand All @@ -29,34 +31,35 @@ With most wallets, simply click "Approve" to connect your wallet.

> Chainlist assigns their default Proxy; you can reconfigure this.

## Choose a remote Proxy
Before sending a transaction to the Neon EVM, users should choose the Operator that's optimal for them to perform transactions.

Before sending a transaction to the Neon EVM, users should choose the Operator that's optimal for them to perform transactions.

> Selecting the RPC address an Operator provides assigns your transactions to that Operator.
One Proxy may be available on different networks (i.e. Devnet and Mainnet). The Proxy interacts with one EVM loader, which can be deployed in different Solana chains.
One Proxy may be available on different networks (i.e. Devnet and Mainnet). The Proxy interacts with one EVM loader, which can be deployed in different Solana chains.

To view the available RPC endpoints, expand the card details of the network of your choice.
To view the available RPC endpoints, expand the card details of the network of your choice.

> <img src={chainlist_raw} width="450" />
Notice that if several Proxy Operators offer public RPC endpoints, you have a choice over who to use.

If your chosen Proxy Operator isn't the default provided during the wallet connection step, you will need to [connect manually](#connect-manually).


## Connect manually

The preceding steps demonstrate how to connect to a Solana cluster via Chainlist. Alternatively, you can connect to the Neon EVM manually or edit your choice of Proxy. While steps may differ slightly according to your EVM-compatible wallet, the principles will closely match the tutorial on connecting [manually via MetaMask](wallet/metamask_setup.md#option-b-manual-configuration).

## Connect dev tools to Neon EVM
To connect to a Proxy using Remix, Truffle, or Hardhat, check out the following resources:
* [Using Remix](developing/deploy_facilities/using_remix.md)
* [Using Truffle](developing/deploy_facilities/using_truffle.md)
* [Using Hardhat](developing/deploy_facilities/using_hardhat.md)

Please note that, for Truffle and Hardhat, you need to set up the configuration file by setting either the `HDWalletProvider` provider (for Truffle) or the URL and the `network_id`/`chainId` to the RPC URL (and ID) selected from Chainlist. This is described in detail in the relevant tutorial sections.
To connect to a Proxy using Remix or Hardhat, check out the following resources:

- [Using Remix](developing/deploy_facilities/using_remix.md)
- [Using Hardhat](developing/deploy_facilities/using_hardhat.md)

Please note that, for Hardhat, you need to set up the configuration file by setting the URL and the `network_id`/`chainId` to the RPC URL (and ID) selected from Chainlist. This is described in detail in the relevant tutorial sections.

## What next?

If you wish to transact via your RPC, then checkout the [supported RPC API methods](/docs/evm_compatibility/json_rpc_api_methods).
If you wish to transact via your RPC, then check out the [supported RPC API methods](/docs/evm_compatibility/json_rpc_api_methods).
63 changes: 0 additions & 63 deletions docs/developing/deploy_facilities/configure_brownie.md

This file was deleted.

37 changes: 37 additions & 0 deletions docs/developing/deploy_facilities/configure_foundry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Configure Foundry"
proofedDate: 20231116
iterationBy: na
includedInSite: true
approvedBy: na
comment: Killing the ## What next? See the [tutorial on how to use Foundry](/docs/developing/deploy_facilities/using_foundry) to deploy to Neon EVM. as this is killing the build todo -- return this later
---

Foundry is a blazing fast, portable,modular toolkit for Ethereum application development written in Rust.

## Introduction

This page details several parameters required to configure Foundry. The Foundry framework isn't described here; find that in the [Foundry documentation](https://book.getfoundry.sh).

## Prerequisites
- cURL

## Foundry configuration

Unlike other toolkits, Foundry doesn't have a config file to hold the chain parameters, instead, parameters are passed into commands. For example, this comand deploys a smart contract:

```
forge create --rpc-url $RPC_URL_DEVNET \
--private-key $PRIVATE_KEY \
--constructor-args "Test ERC20 Token" "TERC20" --legacy \
src/TestERC20/TestERC20.sol:TestERC20
```

The parameters for `forge create` command include:
* `--rpc-url`: RPC URL
* `--private-key`: The private key of the transaction signer
* `--constructor-args`: The constructor arguments to be passed to the contract that is being deployed
* `--legacy`: This parameter is being passed to use legacy transactions _(Neon EVM currently [doesn't support EIP-1559 transactions](/docs/evm_compatibility/overview#shared-standards-and-features))_



75 changes: 0 additions & 75 deletions docs/developing/deploy_facilities/configure_hardhat.md

This file was deleted.

99 changes: 99 additions & 0 deletions docs/developing/deploy_facilities/configure_hardhat.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: "Configure Hardhat"
proofedDate: 20231116
iterationBy: na
includedInSite: true
approvedBy: na
comment:
---

import WhatHardHat from '../../single-source-snippets/_hardhat.mdx'

import ConfigHardHat from '../../single-source-snippets/_hardhat_config.mdx'


## Introduction

<WhatHardHat/>

The Hardhat framework isn't described here; find that in the [Hardhat documentation](https://hardhat.org/getting-started/#overview).

## Prerequisites
- `NodeJS`

## The Hardhat Configuration File

<ConfigHardHat/>

We provide a full example of the `hardhat.config.js` configuration file for connecting Hardhat to a Devnet Proxy using the one-way library on Node.js:

### hardhat.config.js

```js
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.21",
defaultNetwork: "neondevnet",
etherscan: {
apiKey: {
neonevm: "test"
},
customChains: [
{
network: "neonevm",
chainId: 245022926,
urls: {
apiURL: "https://devnet-api.neonscan.org/hardhat/verify",
browserURL: "https://devnet.neonscan.org"
}
},
{
network: "neonevm",
chainId: 245022934,
urls: {
apiURL: "https://api.neonscan.org/hardhat/verify",
browserURL: "https://neonscan.org"
}
}
]
},
networks: {
neondevnet: {
url: "https://devnet.neonevm.org",
accounts: [process.env.PRIVATE_KEY_OWNER],
chainId: 245022926
},
neonmainnet: {
url: "https://neon-proxy-mainnet.solana.p2p.org",
accounts: [process.env.PRIVATE_KEY_OWNER],
chainId: 245022934
}
}
};
```

The parameters for `module.exports` include:
* `solidity`: version of Solidity used
* `defaultNetwork`: default chain (for deploying or testing)
* `etherscan`: settings used to verify contracts on-chain [read more here](https://hardhat.org/hardhat-runner/docs/guides/verifying)
* `networks`: the list of the supported networks
* `neondevnet`:
* `url`: RPC URL
* `accounts`: an array of deployer's private keys; in the current example, PRIVATE_KEY_OWNER is stored inside .env file
* `chainId`: the network's chain ID

Note that `url` and `chainId` can be retrieved from the RPC endpoints table and/or [Chainlist](https://chainlist.org/?search=Neon+EVM&testnets=true).

## What next?

See the [tutorial on how to use Hardhat to deploy to Neon EVM](/docs/developing/deploy_facilities/using_hardhat).

## Gotchas

:::info
Remember, the deployer wallet address needs to have enough tokens to cover the gas cost of a deployment.
> Get [NEON for Devnet](developing/utilities/faucet.md).
:::
Loading

0 comments on commit e930cd6

Please sign in to comment.