github.com/cgcardona/r-subnet-evm@v0.1.5/README.md (about)

     1  # Subnet EVM
     2  
     3  [![Build + Test + Release](https://github.com/cgcardona/r-subnet-evm/actions/workflows/lint-tests-release.yml/badge.svg)](https://github.com/cgcardona/r-subnet-evm/actions/workflows/lint-tests-release.yml)
     4  [![CodeQL](https://github.com/cgcardona/r-subnet-evm/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/cgcardona/r-subnet-evm/actions/workflows/codeql-analysis.yml)
     5  
     6  [Avalanche](https://docs.avax.network/overview/getting-started/avalanche-platform) is a network composed of multiple blockchains.
     7  Each blockchain is an instance of a Virtual Machine (VM), much like an object in an object-oriented language is an instance of a class.
     8  That is, the VM defines the behavior of the blockchain.
     9  
    10  Subnet EVM is the [Virtual Machine (VM)](https://docs.avax.network/learn/avalanche/virtual-machines) that defines the Subnet Contract Chains. Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/ava-labs/coreth).
    11  
    12  This chain implements the Ethereum Virtual Machine and supports Solidity smart contracts as well as most other Ethereum client functionality.
    13  
    14  ## Building
    15  
    16  The Subnet EVM runs in a separate process from the main AvalancheGo process and communicates with it over a local gRPC connection.
    17  
    18  ### AvalancheGo Compatibility
    19  
    20  ```text
    21  [v0.1.0] AvalancheGo@v1.7.0-v1.7.4 (Protocol Version: 9)
    22  [v0.1.1-v0.1.2] AvalancheGo@v1.7.5-v1.7.6 (Protocol Version: 10)
    23  [v0.2.0] AvalancheGo@v1.7.7-v1.7.9 (Protocol Version: 11)
    24  [v0.2.1] AvalancheGo@v1.7.10 (Protocol Version: 12)
    25  [v0.2.2] AvalancheGo@v1.7.11-v1.7.12 (Protocol Version: 14)
    26  [v0.2.3] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    27  [v0.2.4] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    28  [v0.2.5] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    29  [v0.2.6] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    30  [v0.2.7] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    31  [v0.2.8] AvalancheGo@v1.7.13-v1.7.18 (Protocol Version: 15)
    32  [v0.2.9] AvalancheGo@v1.7.13-v1.7.18 (Protocol Version: 15)
    33  [v0.3.0] AvalancheGo@v1.8.0-v1.8.6 (Protocol Version: 16)
    34  [v0.4.0] AvalancheGo@v1.9.0 (Protocol Version: 17)
    35  [v0.4.1] AvalancheGo@v1.9.1 (Protocol Version: 18)
    36  [v0.4.2] AvalancheGo@v1.9.1 (Protocol Version: 18)
    37  [v0.4.3] AvalancheGo@v1.9.2-v1.9.3 (Protocol Version: 19)
    38  [v0.4.4] AvalancheGo@v1.9.2-v1.9.3 (Protocol Version: 19)
    39  [v0.4.5] AvalancheGo@v1.9.4 (Protocol Version: 20)
    40  [v0.4.6] AvalancheGo@v1.9.4 (Protocol Version: 20)
    41  [v0.4.7] AvalancheGo@v1.9.5 (Protocol Version: 21)
    42  [v0.4.8] AvalancheGo@v1.9.6-v1.9.8 (Protocol Version: 22)
    43  [v0.4.9] AvalancheGo@v1.9.9 (Protocol Version: 23)
    44  [v0.4.10] AvalancheGo@v1.9.9 (Protocol Version: 23)
    45  [v0.4.11] AvalancheGo@v1.9.10-v1.9.16 (Protocol Version: 24)
    46  [v0.4.12] AvalancheGo@v1.9.10-v1.9.16 (Protocol Version: 24)
    47  [v0.5.0] AvalancheGo@v1.10.0 (Protocol Version: 25)
    48  [v0.5.1] AvalancheGo@v1.10.1-v1.10.3 (Protocol Version: 26)
    49  [v0.5.2] AvalancheGo@v1.10.1-v1.10.3 (Protocol Version: 26)
    50  ```
    51  
    52  ## API
    53  
    54  The Subnet EVM supports the following API namespaces:
    55  
    56  - `eth`
    57  - `personal`
    58  - `txpool`
    59  - `debug`
    60  
    61  Only the `eth` namespace is enabled by default.
    62  Full documentation for the C-Chain's API can be found [here.](https://docs.avax.network/apis/avalanchego/apis/c-chain)
    63  
    64  ## Compatibility
    65  
    66  The Subnet EVM is compatible with almost all Ethereum tooling, including [Remix](https://docs.avax.network/dapps/smart-contracts/deploy-a-smart-contract-on-avalanche-using-remix-and-metamask/), [Metamask](https://docs.avax.network/dapps/smart-contracts/deploy-a-smart-contract-on-avalanche-using-remix-and-metamask/) and [Truffle](https://docs.avax.network/dapps/smart-contracts/using-truffle-with-the-avalanche-c-chain/).
    67  
    68  ## Differences Between Subnet EVM and Coreth
    69  
    70  - Added configurable fees and gas limits in genesis
    71  - Merged Avalanche hardforks into the single "Subnet EVM" hardfork
    72  - Removed Atomic Txs and Shared Memory
    73  - Removed Multicoin Contract and State
    74  
    75  ## Block Format
    76  
    77  To support these changes, there have been a number of changes to the SubnetEVM block format compared to what exists on the C-Chain and Ethereum. Here we list the changes to the block format as compared to Ethereum.
    78  
    79  ### Block Header
    80  
    81  - `BaseFee`: Added by EIP-1559 to represent the base fee of the block (present in Ethereum as of EIP-1559)
    82  - `BlockGasCost`: surcharge for producing a block faster than the target rate
    83  
    84  ## Create an EVM Subnet on a Local Network
    85  
    86  ### Clone Subnet-evm
    87  
    88  First install Go 1.19.6 or later. Follow the instructions [here](https://golang.org/doc/install). You can verify by running `go version`.
    89  
    90  Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Please read [this](https://go.dev/doc/gopath_code) for details. You can verify by running `echo $GOPATH`.
    91  
    92  As a few software will be installed into `$GOPATH/bin`, please make sure that `$GOPATH/bin` is in your `$PATH`, otherwise, you may get error running the commands below.
    93  
    94  Download the `subnet-evm` repository into your `$GOPATH`:
    95  
    96  ```sh
    97  cd $GOPATH
    98  mkdir -p src/github.com/ava-labs
    99  cd src/github.com/ava-labs
   100  git clone git@github.com:cgcardona/r-subnet-evm.git
   101  cd subnet-evm
   102  ```
   103  
   104  This will clone and checkout to `master` branch.
   105  
   106  ### Run Local Network
   107  
   108  To run a local network, it is recommended to use the [avalanche-cli](https://github.com/ava-labs/avalanche-cli#avalanche-cli) to set up an instance of Subnet-EVM on an local Avalanche Network.
   109  
   110  There are two options when using the Avalanche-CLI:
   111  
   112  1. Use an official Subnet-EVM release: https://docs.avax.network/subnets/build-first-subnet
   113  2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: https://docs.avax.network/subnets/create-custom-subnet