github.com/MetalBlockchain/subnet-evm@v0.6.3/README.md (about)

     1  # Subnet EVM
     2  
     3  Metal is a network composed of multiple blockchains.
     4  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.
     5  That is, the VM defines the behavior of the blockchain.
     6  
     7  Subnet EVM is the Virtual Machine (VM) that defines the Subnet Contract Chains. Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/MetalBlockchain/coreth).
     8  
     9  This chain implements the Ethereum Virtual Machine and supports Solidity smart contracts as well as most other Ethereum client functionality.
    10  
    11  ## Building
    12  
    13  The Subnet EVM runs in a separate process from the main AvalancheGo process and communicates with it over a local gRPC connection.
    14  
    15  ### AvalancheGo Compatibility
    16  
    17  ```text
    18  [v0.1.0] AvalancheGo@v1.7.0-v1.7.4 (Protocol Version: 9)
    19  [v0.1.1-v0.1.2] AvalancheGo@v1.7.5-v1.7.6 (Protocol Version: 10)
    20  [v0.2.0] AvalancheGo@v1.7.7-v1.7.9 (Protocol Version: 11)
    21  [v0.2.1] AvalancheGo@v1.7.10 (Protocol Version: 12)
    22  [v0.2.2] AvalancheGo@v1.7.11-v1.7.12 (Protocol Version: 14)
    23  [v0.2.3] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    24  [v0.2.4] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    25  [v0.2.5] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    26  [v0.2.6] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    27  [v0.2.7] AvalancheGo@v1.7.13-v1.7.16 (Protocol Version: 15)
    28  [v0.2.8] AvalancheGo@v1.7.13-v1.7.18 (Protocol Version: 15)
    29  [v0.2.9] AvalancheGo@v1.7.13-v1.7.18 (Protocol Version: 15)
    30  [v0.3.0] AvalancheGo@v1.8.0-v1.8.6 (Protocol Version: 16)
    31  [v0.4.0] AvalancheGo@v1.9.0 (Protocol Version: 17)
    32  [v0.4.1] AvalancheGo@v1.9.1 (Protocol Version: 18)
    33  [v0.4.2] AvalancheGo@v1.9.1 (Protocol Version: 18)
    34  [v0.4.3] AvalancheGo@v1.9.2-v1.9.3 (Protocol Version: 19)
    35  [v0.4.4] AvalancheGo@v1.9.2-v1.9.3 (Protocol Version: 19)
    36  [v0.4.5] AvalancheGo@v1.9.4 (Protocol Version: 20)
    37  [v0.4.6] AvalancheGo@v1.9.4 (Protocol Version: 20)
    38  [v0.4.7] AvalancheGo@v1.9.5 (Protocol Version: 21)
    39  [v0.4.8] AvalancheGo@v1.9.6-v1.9.8 (Protocol Version: 22)
    40  [v0.4.9] AvalancheGo@v1.9.9 (Protocol Version: 23)
    41  [v0.4.10] AvalancheGo@v1.9.9 (Protocol Version: 23)
    42  [v0.4.11] AvalancheGo@v1.9.10-v1.9.16 (Protocol Version: 24)
    43  [v0.4.12] AvalancheGo@v1.9.10-v1.9.16 (Protocol Version: 24)
    44  [v0.5.0] AvalancheGo@v1.10.0 (Protocol Version: 25)
    45  [v0.5.1] AvalancheGo@v1.10.1-v1.10.4 (Protocol Version: 26)
    46  [v0.5.2] AvalancheGo@v1.10.1-v1.10.4 (Protocol Version: 26)
    47  [v0.5.3] AvalancheGo@v1.10.5-v1.10.8 (Protocol Version: 27)
    48  [v0.5.4] AvalancheGo@v1.10.9-v1.10.12 (Protocol Version: 28)
    49  [v0.5.5] AvalancheGo@v1.10.9-v1.10.12 (Protocol Version: 28)
    50  [v0.5.6] AvalancheGo@v1.10.9-v1.10.12 (Protocol Version: 28)
    51  [v0.5.7] AvalancheGo@v1.10.13-v1.10.14 (Protocol Version: 29)
    52  [v0.5.8] AvalancheGo@v1.10.13-v1.10.14 (Protocol Version: 29)
    53  [v0.5.9] AvalancheGo@v1.10.15-v1.10.17 (Protocol Version: 30)
    54  [v0.5.10] AvalancheGo@v1.10.15-v1.10.17 (Protocol Version: 30)
    55  [v0.5.11] AvalancheGo@v1.10.18-v1.10.19 (Protocol Version: 31)
    56  [v0.6.0] AvalancheGo@v1.11.0-v1.11.1 (Protocol Version: 33)
    57  [v0.6.1] AvalancheGo@v1.11.0-v1.11.1 (Protocol Version: 33)
    58  [v0.6.2] AvalancheGo@v1.11.2 (Protocol Version: 34)
    59  [v0.6.3] AvalancheGo@v1.11.3 (Protocol Version: 35)
    60  ```
    61  
    62  ## API
    63  
    64  The Subnet EVM supports the following API namespaces:
    65  
    66  - `eth`
    67  - `personal`
    68  - `txpool`
    69  - `debug`
    70  
    71  Only the `eth` namespace is enabled by default.
    72  
    73  ## Compatibility
    74  
    75  The Subnet EVM is compatible with almost all Ethereum tooling, including Remix, Metamask and Truffle.
    76  
    77  ## Differences Between Subnet EVM and Coreth
    78  
    79  - Added configurable fees and gas limits in genesis
    80  - Merged Metal hardforks into the single "Subnet EVM" hardfork
    81  - Removed Atomic Txs and Shared Memory
    82  - Removed Multicoin Contract and State
    83  
    84  ## Block Format
    85  
    86  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.
    87  
    88  ### Block Header
    89  
    90  - `BaseFee`: Added by EIP-1559 to represent the base fee of the block (present in Ethereum as of EIP-1559)
    91  - `BlockGasCost`: surcharge for producing a block faster than the target rate
    92  
    93  ## Create an EVM Subnet on a Local Network
    94  
    95  ### Clone Subnet-evm
    96  
    97  First install Go 1.21.7 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
    98  
    99  Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Please read [this](https://go.dev/doc/code) for details. You can verify by running `echo $GOPATH`.
   100  
   101  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.
   102  
   103  Download the `subnet-evm` repository into your `$GOPATH`:
   104  
   105  ```sh
   106  cd $GOPATH
   107  mkdir -p src/github.com/!metal!blockchain
   108  cd src/github.com/\!metal\!blockchain
   109  git clone git@github.com:MetalBlockchain/subnet-evm.git
   110  cd subnet-evm
   111  ```
   112  
   113  This will clone and checkout to `master` branch.
   114  
   115  ### Run Local Network
   116  
   117  To run a local network, it is recommended to use the [metal-cli](https://github.com/MetalBlockchain/metal-cli) to set up an instance of Subnet-EVM on a local Metal Network.