Skip to content

Commit

Permalink
# 160 actualize docs after proof reading (#162)
Browse files Browse the repository at this point in the history
* Update using_truffle.md
* Update headers in sidebars.js
* Update using_remix.md
* Update using_hardhat.md
* Update getting_started.md
* Update operator_guide.md
* Update metamask_setup.md
  • Loading branch information
rozhkovdmitrii authored Mar 31, 2022
1 parent c4722d4 commit 45298e1
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 98 deletions.
13 changes: 7 additions & 6 deletions docs/developing/deploy_facilities/using_hardhat.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Using the Hardhat
title: Using Hardhat
---

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. It helps developers manage and automate the recurring tasks that are inherent to the process of building smart contracts and dApps, as well as easily introducing more functionality around this workflow. This means compiling, running and testing smart contracts at the very core.
Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. It helps developers manage and automate the recurring tasks that are inherent to the process of building smart contracts and dApps, as well as easily introduce more functionality around this workflow. This means compiling, running, and testing smart contracts at the very core.

We will not describe details on using Hardhat framework here. You can find all necessary documenation by following link https://hardhat.org/getting-started/#overview
We will not describe the details of using the Hardhat framework here. You can find all necessary documentation by following this link: https://hardhat.org/getting-started/#overview.

As Neon is an Ethereum-compatible virtual machine and RPC, one can easily migrate existing Hardhat projects to it. The only thing needed is correct **hardhat.config.js** file. You can refer to code below as an example of config-file content:
As Neon is an Ethereum-compatible virtual machine and RPC, you can easily migrate existing Hardhat projects to it. The only thing required is the correct **hardhat.config.js** file. You can refer to the code below as an example of config-file content:

```js
require("@nomiclabs/hardhat-waffle");
Expand Down Expand Up @@ -35,5 +35,6 @@ module.exports = {
};
```

## Example project
You can obtain example Hardhat project from here - https://github.com/neonlabsorg/examples/tree/main/simple-erc20-hardhat
## Example Hardhat Project

You can obtain an example Hardhat project from here: https://github.com/neonlabsorg/examples/tree/main/simple-erc20-hardhat.
26 changes: 13 additions & 13 deletions docs/developing/deploy_facilities/using_remix.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: Using the Remix
title: Using Remix
---

*This tutorial will show you step by step how to use [Remix](about/terminology.md#remix) and [Metamask](about/terminology.md#metamask) to create and deploy a simple smart contract on Solana. Although the instructions use Solana's [Testnet](https://docs.solana.com/clusters#testnet), they may also be applicable to Solana's [Devnet](https://docs.solana.com/clusters#devnet) or Solana's [Mainnet Beta](https://docs.solana.com/clusters#mainnet-beta).*
*This tutorial will show you step by step how to use [Remix](about/terminology.md#remix) and [MetaMask](about/terminology.md#metamask) to create and deploy a simple smart contract on Solana. Although the instructions use Solana's [Testnet](https://docs.solana.com/clusters#testnet), they may also be applicable to Solana's [Devnet](https://docs.solana.com/clusters#devnet) or Solana's [Mainnet Beta](https://docs.solana.com/clusters#mainnet-beta).*

## Requirements
Before you start, make sure of the following:
* MetaMask is installed on your device.
* You have provided online access to remix.ethereum.org to use the `Remix - Ethereum IDE` open source web application.
* MetaMask is configured for both proxy and Neon EVM (regardless of how proxy and Neon EVM run, MetaMask wallet must always be configured for them).
* MetaMask is configured for both proxy and Neon EVM. (Regardless of how proxy and Neon EVM run, MetaMask wallet must always be configured for them.)

**The network configuration:**
* [Solana cluster](https://docs.solana.com/clusters) is accessed via a proxy.
* Solana works in test mode and the proxy interacts with it through Neon EVM.

## Steps to complete
## Steps to Complete

### Step 1. Set the Remix environment

Expand All @@ -29,10 +29,10 @@ Fig. 1 β€” Connecting to localhost

</div>

### Step 2. Create a simple smart contract at Remix
### Step 2. Create a simple smart contract in Remix

Click on the icon `Create New File` and type the file name in the field that appears below it. For example helloWorld.sol
For now, it is an empty file. To fill it with content, click on the created file name and type the text on the right side of the explorer (or copy your pre-prepared text there)(Fig. 2).
Click on the icon `Create New File` and type the file name in the field that appears below it. For example, helloWorld.sol
For now, it is an empty file. To fill it with content, click on the created file name and type the text on the right side of the explorer (or copy your pre-prepared text there) (Fig. 2).

<div class='neon-img-width-600' style={{textAlign: 'center'}}>

Expand All @@ -44,7 +44,7 @@ Fig. 2 β€” Loading the helloWorld smart contract

### Step 3. Compile a smart contract

In the left side menu select the `Solidity compiler`. The `SOLIDITY COMPILER` menu will be active.
In the left side menu, select the `Solidity compiler`. The `SOLIDITY COMPILER` menu will be active.
Click on the `Compile helloWorld.sol` button to compile the loaded smart contract helloWorld (Fig. 3).

<div class='neon-img-width-600' style={{textAlign: 'center'}}>
Expand All @@ -62,7 +62,7 @@ You can also get detailed information about the compilation process by clicking

![](img/remix-4.png)

Fig. 4 β€” Compilation Details
Fig. 4 β€” Compilation details

</div>

Expand All @@ -78,7 +78,7 @@ Fig. 5 β€” Injected Web3 connects Remix with an active account in Metamask

</div>

The MetaMask window should appear. It should display a list of available accounts (in our case, only one account will be displayed). Choose this account and click `Next` (Fig. 6).
The MetaMask window should appear. It should display a list of available accounts. (In our case, only one account will be displayed.) Choose this account and click `Next` (Fig. 6).

<div class='neon-img-box-300' style={{textAlign: 'center'}}>

Expand All @@ -102,7 +102,7 @@ Fig. 7

In the left side menu, select `Deploy & run transactions`. The `DEPLOY & RUN TRANSACTIONS` menu will become active.

In our case there is only one smart contract to deploy. Therefore, it is automatically selected from the dropdown and Remix will automatically generate a transaction.
In our case there is only one smart contract to deploy, therefore it is automatically selected from the dropdown and Remix will automatically generate a transaction.

The `Account` field will display the amount in the wallet account. This data is taken from MetaMask.

Expand Down Expand Up @@ -156,7 +156,7 @@ Fig. 12 β€” Final view of the Remix panel

</div>

Congratulations! You can now call methods of the helloWorld smart contract deployed on the Solana network (Fig. 13 shows the result of your smart contract β€” the text string "Hello World!").
Congratulations! You can now call methods of the helloWorld smart contract deployed on the Solana network. (Fig. 13 shows the result of your smart contract β€” the text string "Hello World!".)

<div class='neon-img-width-300' style={{textAlign: 'center'}}>

Expand All @@ -166,7 +166,7 @@ Fig. 13 β€” Calling the smart contract methods

</div>

----
----

> **Useful links**
> https://ethereum.org/en/developers/tutorials/deploying-your-first-smart-contract/
46 changes: 23 additions & 23 deletions docs/developing/deploy_facilities/using_truffle.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
---
title: Using the Truffle
title: Using Truffle
---

*This page outlines a methodology for deploying and testing contracts in Neon EVM using the Truffle tool. This technique can be useful for personnel involved in the development and maintenance of Neon EVM.*

It should be noted that Ethereum contracts can also be successfully deployed in Neon EVM using Remix in manual mode. Since Remix has not so many capabilities, it turned out to be not very convenient in software development, and therefore we provide developers a more advanced methodology using Truffle.
It should be noted that Ethereum contracts can also be successfully deployed in Neon EVM using Remix in manual mode. However, since Remix does not have as many capabilities, it turned out to be not as convenient for software development, and therefore we wanted to provide developers with a more advanced methodology using Truffle.

## The Goal
Our main goal with Truffle is to make it easier for developers to deploy and debug contacts in Neon EVM.
Our main goal with Truffle is to make it easier for developers to deploy and debug contracts in Neon EVM.

With Truffle, you get:
* Simple setting of configuration parameters.
* An easy process of deploying and debugging contacts in the network.
* Automated deploying and running tests.
* A simple setting of configuration parameters.
* An easy process of deploying and debugging contracts in the network.
* Automated deployment and running of tests.

## Installation

### Requirements for your device
The following softwares must be installed on your device:
The following software must be installed on your device:
* NodeJS v8.9.4 or later
* Web3 v1.2.0 or later

> **Note:** Although this tutorial uses the Ubuntu platform, the instructions provided can be applied to other Linux platforms.
### Installation of Truffle
### Installing Truffle

If Truffle is already installed on your device, you can skip this section and move on to the next one. For those just getting started, you need to go through this section.

> **Note:** This page is just a quickstart. To go into much detail here, you can see the *[Truffle documentation](https://www.trufflesuite.com/docs/truffle/getting-started/installation)*.
> **Note:** This page is just a quickstart. To go into more detail, you can read the *[Truffle documentation](https://www.trufflesuite.com/docs/truffle/getting-started/installation)*.
Create a new directory for your Truffle project:
```sh
Expand All @@ -46,18 +46,18 @@ $ truffle init
```

Once this operation is completed, you will have a project structure with the following items:
* `contracts/` β€” Directory for Solidity contracts.
* `migrations/` β€” Directory for scriptable deployment files.
* `test/` β€” Directory for test files for testing your contracts.
* `truffle-config.js` β€” Truffle configuration file.
* `contracts/` β€” Directory for Solidity contracts
* `migrations/` β€” Directory for scriptable deployment files
* `test/` β€” Directory for test files for testing your contracts
* `truffle-config.js` β€” Truffle configuration file

You can run `truffle compile`, `truffle migrate` and `truffle test` to compile your contracts, deploy them to the network, and run their associated unit tests.

### Installation of the HDWalletProvider library

HD Wallet-enabled Web3 provider (HDWalletProvider) is a standalone library. One of its functions is signing transactions with private keys. Since the Neon EVM proxy does not store private keys, it cannot sign transactions. Therefore, during debugging contracts, the HDWalletProvider library is used to sign transactions for addresses derived from a *12* or *24* word mnemonic.

By default, the Truffle installation does not provide the HDWalletProvider library. If during the installation of Truffle none of the applications also required the HDWalletProvider library to be installed, you need to install it separately.
By default, the Truffle installation does not provide the HDWalletProvider library. If during the installation of Truffle none of the applications required the HDWalletProvider library to be installed, you need to install it separately.

Install the HDWalletProvider library:
```sh
Expand All @@ -68,13 +68,13 @@ $ npm install @truffle/hdwallet-provider
## Connecting Truffle to a Proxy

To connect Truffle to a proxy on `node.js`, the `eth_accounts` method from the [Ethereum JSON RPC API](https://eth.wiki/json-rpc/API) set is required. This method allows serving a list of *20* Bytes-addresses owned by a client. Since the Neon EVM proxy does not support the `eth_accounts` method required to connect Truffle , the HDWalletProvider library is used to function as this method. The connection is configured in `truffle-config.js`.
To connect Truffle to a proxy on `node.js`, the `eth_accounts` method from the [Ethereum JSON RPC API](https://eth.wiki/json-rpc/API) set is required. This method allows serving a list of *20* byte addresses owned by a client. Since the Neon EVM proxy does not support the `eth_accounts` method required to connect Truffle, the HDWalletProvider library is used to function as this method. The connection is configured in `truffle-config.js`.

The configuration file is publicly available and therefore, `word mnemonic` and `private key` contained in the file are also publicly available. This makes it possible to use this data by the library. HDWalletProvider obtains `word mnemonic` or `private key` from the configuration file and uses this data to sign transactions before sending them to the proxy.
The configuration file is publicly available, and therefore the `word mnemonic` and `private key` contained in the file are also publicly available. This makes it possible for the library to use this data. HDWalletProvider obtains `word mnemonic` or `private key` from the configuration file and uses this data to sign transactions before sending them to the proxy.

This method of configuration is convenient for debug mode, but not suitable for work in real conditions. Since the development process uses "test" wallets, this data is not of any value.

> **Note:** We strongly recommend to use Truffle in Neon EVM only for developing or testing contracts.
> **Note:** We strongly recommend using Truffle in Neon EVM only for developing or testing contracts.
## Configuration
Your configuration file is called `truffle-config.js` and is located at the root of your project directory. This file is a JavaScript file and can execute any code necessary to create your configuration.
Expand All @@ -85,7 +85,7 @@ All of your contracts are located in your project's `contracts/` directory. To c
$ truffle compile
```

Upon first run, all contracts will be compiled. Upon subsequent runs, only those contracts will be compiled that have changed since the last compilation.
Upon first run, all contracts will be compiled. Upon subsequent runs, only contracts that have changed since the last compilation will be compiled again.

If you want to re-compile all contracts, run the above command with the `--all` option:
```sh
Expand Down Expand Up @@ -121,10 +121,10 @@ To run only one file from the entire test suite or a specific file that is not i
$ truffle test <./path/file.js>
```

The full set of options that you can use during testing are listed in the page with [truffle test](https://www.trufflesuite.com/docs/truffle/reference/truffle-commands#test) command.
The full set of options that you can use during testing are listed in the page with the [truffle test](https://www.trufflesuite.com/docs/truffle/reference/truffle-commands#test) command.


## Example of configuration file settings
## Example of Configuration File Settings
The example of the configuration file for connecting Truffle to a devnet-proxy using the one-way library on Node.js:
```js
const Web3 = require("web3");
Expand Down Expand Up @@ -156,10 +156,10 @@ module.exports = {

> **Note:** If both mnemonic and private keys are provided, the mnemonic is used.
Use next comand to deploy contracts using **neonlabs** network:
Use next command to deploy contracts using **neonlabs** network:
```sh
truffle migrate --network neonlabs
```

## Example project
You can obtain example Truffle project from here - https://github.com/neonlabsorg/examples/tree/main/simple-erc20-truffle
## Example Project
You can obtain example Truffle project from here: https://github.com/neonlabsorg/examples/tree/main/simple-erc20-truffle
24 changes: 14 additions & 10 deletions docs/developing/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@ title: Getting Started

*The purpose of this guide is to familiarize you with the structure of Neon EVM, and to provide step-by-step instructions to set up your local Neon EVM development environment.*

## Setting up the development environment
## Setting Up the Development Environment

As a developer, you should begin by exploring the Neon EVM framework and setting up your local development environment.
Depending on your purposes, there are several ways how to do it:
Depending on your purposes, there are several ways to do it:

[πŸ”˜ Choosing a Neon Proxy](developing/dev_environment/choosing_proxy.md) β€” Describes how to connect to existing Neon Proxy.
[πŸ”˜ Connecting to the Neon Proxy](developing/dev_environment/connect_to_solana_via_proxy.md) β€” Describes how to Connect to the Solana cluster via local or remote proxy server.
[πŸ”˜ Setting up local Solana Cluster](developing/dev_environment/solana_cluster/cluster_installation.md) β€” Describes how to install, configure and test the local Solana cluster with Neon EVM on-board.
[πŸ”˜ Choosing a Neon Proxy](developing/dev_environment/choosing_proxy.md) β€” Describes how to connect to an existing Neon Proxy.
[πŸ”˜ Connecting to the Neon Proxy](developing/dev_environment/connect_to_solana_via_proxy.md) β€” Describes how to connect to the Solana cluster via a local or remote proxy server.
[πŸ”˜ Setting up a local Solana cluster](developing/dev_environment/solana_cluster/cluster_installation.md) β€” Describes how to install, configure, and test the local Solana cluster with Neon EVM onboard.

## Deploying dApps
[πŸ”˜ Using Remix](developing/deploy_facilities/using_remix.md) β€” Example of deploying smart contract using Remix.
[πŸ”˜ Using Truffle](developing/deploy_facilities/using_truffle.md) β€” Example of deploying smart contract using Truffle.
[πŸ”˜ Using Hardhat](developing/deploy_facilities/using_hardhat.md) β€” Example of deploying smart contract using Hardhat.

[πŸ”˜ Using Remix](developing/deploy_facilities/using_remix.md) β€” Example of deploying smart contracts using Remix.
[πŸ”˜ Using Truffle](developing/deploy_facilities/using_truffle.md) β€” Example of deploying smart contracts using Truffle.
[πŸ”˜ Using Hardhat](developing/deploy_facilities/using_hardhat.md) β€” Example of deploying smart contracts using Hardhat.

## Neon EVM Architecture

[πŸ”˜ Ethereum and Solana capabilities in a single solution](architecture/eth_sol_solution.md) β€” Describes a unique solution that allows Ethereum users to use the key features of Solana and vice versa.
[πŸ”˜ Overview of Neon EVM Architecture](architecture/neon_evm_arch.md) β€” Describes the architectural solutions built into Neon EVM that enable fast transaction processing for Ethereum users.
[πŸ”˜ Overview of Neon EVM architecture](architecture/neon_evm_arch.md) β€” Describes the architectural solutions built into Neon EVM that enable fast transaction processing for Ethereum users.

## Fundamental Topics

## Fundamental topics
If you are new to Neon EVM development, we recommend starting from the very beginning and moving forward in order through each of the topics.

[πŸ”˜ Web2 versus Web3](architecture/core_aspects/web3.md) β€” Describes the fundamental differences between Web2 and Web3.
Expand Down
Loading

0 comments on commit 45298e1

Please sign in to comment.