From e81d95bc8108c85a92918a12611c0fa191cc8176 Mon Sep 17 00:00:00 2001 From: Lane Rettig Date: Wed, 14 Nov 2018 18:30:31 -0500 Subject: [PATCH 1/3] More misc cleanup Merging geth sections WIP --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8f31a7f..d3eb1cb 100644 --- a/README.md +++ b/README.md @@ -99,17 +99,8 @@ If you're interested in adding support for another language, framework, or tools The testnet currently only supports the [go-ethereum](https://github.com/ethereum/go-ethereum) (geth) client. Support for aleth (formerly, cpp-ethereum) is a work in progress and more information may be found [here](aleth.md). -## Adding a node to the testnet - ### Geth -You may install and configure geth in the following ways: - -- manually, from source -- using this preconfigured Docker image - -#### Manual configuration - Manually configuring geth requires installing prerequisites, downloading and compiling geth from source with [EVMC](https://github.com/ethereum/evmc) support, downloading and building [Hera](https://github.com/ewasm/hera/) (the Ewasm virtual machine connector), then launching geth with Hera set as its EVMC engine. 1. Make sure the prerequisites are installed (Go version 1.7 or later, `cmake` 3.5 or later, and a C/C++ compiler). @@ -129,7 +120,7 @@ Manually configuring geth requires installing prerequisites, downloading and com > sudo apt-get install build-essential make cmake golang ``` -## geth + Hera +### geth + Hera The genesis is in [ewasm-testnet-geth-config.json](ewasm-testnet-geth-config.json) @@ -217,7 +208,7 @@ Aleth supports EVMC out of the box, but geth not yet. ``` -## geth + Wagon +### geth + Wagon **NOTE: this client currently is not supported fully and the instructions here may be wrong.** @@ -264,6 +255,9 @@ This section describes how to run geth node with the [Wagon](http://github.com/g Support for aleth (formerly, cpp-ethereum) is a work in progress and more information may be found [here](aleth.md). +## Syncing to the testnet + + ### Enabling ethstats Ethstats is a pretty UI for monitoring network state, which allows individual nodes to communicate their state to a centralized server via WebSockets. (See for instance the page for the [Ethereum mainnet](https://ethstats.net/).) Nodes must be added manually. The Ewasm team maintains an [ethstats page for the testnet](http://ewasm.ethereum.org/ethstats). If you'd like your node to be added, follow these steps: From 09d8418d9cd99f2bdf277ee91284e5b8d45430f1 Mon Sep 17 00:00:00 2001 From: Lane Rettig Date: Wed, 14 Nov 2018 21:39:08 -0500 Subject: [PATCH 2/3] Separate out instructions on syncing the testnet --- README.md | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d3eb1cb..ef6016a 100644 --- a/README.md +++ b/README.md @@ -159,55 +159,37 @@ Aleth supports EVMC out of the box, but geth not yet. > cmake --build . ``` -1. Download the [genesis file](ewasm-testnet-geth-config.json) and use it to initialize geth: - - ```sh - > wget https://raw.githubusercontent.com/ewasm/testnet/ewasm-testnet-milestone1/ewasm-testnet-geth-config.json - > ./build/bin/geth --datadir /tmp/ewasm-node/4201/ init ewasm-testnet-geth-config.json - ``` - - Note that the `/tmp/ewasm-node/4201` directory name above is arbitrary. It just needs to be unique. - -1. Run geth with Hera and connect to the testnet: +1. Run geth with Hera: Use `--vm.ewasm` flag in `geth` to plug in an EVMC VM shared library. Point it to the Hera shared library that you built a moment ago. Additional EVMC options can be provided after a comma. Hera options are documented [here](https://github.com/ewasm/hera). - Note also the `--etherbase`, `--networkid`, and `--bootnodes` commands, below, and copy them verbatim as these are required to connect to and sync with the Ewasm testnet. - The `--vmodule` argument sets the verbosity for the `eth` and `p2p` modules, which will provide lots of juicy debugging information on your node's connection to the other testnet peers, and on its mining, accepting, and propagating blocks. Feel free to reduce verbosity or turn this off. - Finally, if you want your node to participate in mining, add the arguments `--mine --miner.threads 1`. + Finally, if you want your node to mine, add the arguments `--mine --miner.threads 1`. Check out the geth [CLI wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) for more information on these commands, or just run `geth --help`. - Here's the recommended configuration for connecting your node to the Ewasm testnet: + Here's the recommended configuration for running a node locally: ```sh > ./build/bin/geth \ --vm.ewasm="/path/to/libhera.so,metering=true,fallback=true" \ --datadir /tmp/ewasm-node/4201/ \ - --etherbase 031159dF845ADe415202e6DA299223cb640B9DB0 \ --rpc --rpcapi "web3,net,eth,debug" \ --rpcvhosts="*" --rpcaddr "0.0.0.0" \ --rpccorsdomain "*" \ - --vmodule "miner=12,rpc=12" \ - --mine --miner.threads 1 \ - --nodiscover \ - --networkid 66 \ - --bootnodes "enode://53458e6bf0353f3378e115034cf6c6039b9faed52548da9030b37b4672de4a8fd09f869c48d16f9f10937e7398ae0dbe8b9d271408da7a0cf47f42a09e662827@23.101.78.254:30303" + --vmodule "eth=12,p2p=12" \ + --nodiscover ``` - *NOTE*: don't forget to specify `networkId` with the same value as the value of `chainID` in the genesis configuration, this is to avoid [Metamask error `Invalid Sender`](https://github.com/MetaMask/metamask-extension/issues/3673). - Note that if you want your node to be automatically restarted if it dies, and to survive system reboots, you'll want to use a tool such as [pm2](http://pm2.keymetrics.io/): ```sh > npm install -g pm2 ``` - ### geth + Wagon **NOTE: this client currently is not supported fully and the instructions here may be wrong.** @@ -247,7 +229,6 @@ This section describes how to run geth node with the [Wagon](http://github.com/g --bootnodes "enode://53458e6bf0353f3378e115034cf6c6039b9faed52548da9030b37b4672de4a8fd09f869c48d16f9f10937e7398ae0dbe8b9d271408da7a0cf47f42a09e662827@23.101.78.254:30303" ``` - ### Aleth (cpp-ethereum) + Hera **NOTE: this client currently is not supported fully and the instructions here may be wrong.** @@ -257,6 +238,31 @@ Support for aleth (formerly, cpp-ethereum) is a work in progress and more inform ## Syncing to the testnet +In order to sync to the testnet, you'll need the proper genesis configuration. + +1. Follow the steps above to download and build geth+Hera. + +1. Download the [genesis file](ewasm-testnet-geth-config.json) and use it to initialize geth: + + ```sh + > wget https://raw.githubusercontent.com/ewasm/testnet/ewasm-testnet-milestone1/ewasm-testnet-geth-config.json + > ./build/bin/geth --datadir /tmp/ewasm-node/4201/ init ewasm-testnet-geth-config.json + ``` + + Note that the `/tmp/ewasm-node/4201` directory name above is arbitrary. It just needs to be unique. + + Note also the `--etherbase`, `--networkid`, and `--bootnodes` commands, below, and copy them verbatim as these are required to connect to and sync with the Ewasm testnet. + + Don't forget to specify `networkId` with the same value as the value of `chainID` in the genesis configuration to avoid [Metamask error `Invalid Sender`](https://github.com/MetaMask/metamask-extension/issues/3673). + + Run geth as above, but add the following commandline args: + + ```sh + --etherbase a8c3eeb2915373139bcfc287d4ae9e660d734881 \ + --networkid 66 \ + --bootnodes "enode://53458e6bf0353f3378e115034cf6c6039b9faed52548da9030b37b4672de4a8fd09f869c48d16f9f10937e7398ae0dbe8b9d271408da7a0cf47f42a09e662827@23.101.78.254:30303" + ``` + ### Enabling ethstats From eb139360d9603ef54082008fa48c48f4aa6047b9 Mon Sep 17 00:00:00 2001 From: Lane Rettig Date: Wed, 14 Nov 2018 21:41:35 -0500 Subject: [PATCH 3/3] Break out geth+wagon docs --- README.md | 37 +------------------------------------ wagon.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 36 deletions(-) create mode 100644 wagon.md diff --git a/README.md b/README.md index ef6016a..8dcf041 100644 --- a/README.md +++ b/README.md @@ -192,42 +192,7 @@ Aleth supports EVMC out of the box, but geth not yet. ### geth + Wagon -**NOTE: this client currently is not supported fully and the instructions here may be wrong.** - -This section describes how to run geth node with the [Wagon](http://github.com/go-interpreter/wagon) VM. - -1. Get the code from the PR - - ```sh - > go get github.com/ethereum/go-ethereum - > cd $GOROOT/src/github.com/ethereum/go-ethereum - > git remote add gballet git@github.com:gballet/go-ethereum.git - > git fetch gballet add-ewasm - > git checkout add-ewasm - ``` - -2. Build geth - - ```sh - > go build ./cmd/geth/... - ``` - -3. Run geth - - The Ewasm interpreter will be activated by default as long as you do not specify a `--vm.ewasm=...` on the command line option. - - ```sh - > ./geth \ - --datadir /tmp/ewasm-node/4201/ \ - --etherbase 031159dF845ADe415202e6DA299223cb640B9DB0 \ - --rpc --rpcapi "web3,net,eth,debug" \ - --rpcvhosts="*" --rpcaddr "0.0.0.0" \ - --rpccorsdomain "*" \ - --mine --miner.threads 1 \ - --nodiscover \ - --networkid 66 \ - --bootnodes "enode://53458e6bf0353f3378e115034cf6c6039b9faed52548da9030b37b4672de4a8fd09f869c48d16f9f10937e7398ae0dbe8b9d271408da7a0cf47f42a09e662827@23.101.78.254:30303" - ``` +The testnet has experimental support for running a geth node with the [Wagon](http://github.com/go-interpreter/wagon) third-party VM. Instructions may be found [here](wagon.md). ### Aleth (cpp-ethereum) + Hera diff --git a/wagon.md b/wagon.md new file mode 100644 index 0000000..ebdfbbb --- /dev/null +++ b/wagon.md @@ -0,0 +1,29 @@ +# geth + Wagon + +**NOTE: this client currently is not supported fully and the instructions here may be wrong.** + +[Wagon](http://github.com/go-interpreter/wagon) is a third-party WebAssembly VM written natively in Go. Support for geth + Wagon on the Ewasm testnet is experimental. This document describes how to run geth node with geth and the Wagon VM. + +1. Get the code from the PR + + ```sh + > go get github.com/ethereum/go-ethereum + > cd $GOROOT/src/github.com/ethereum/go-ethereum + > git remote add gballet git@github.com:gballet/go-ethereum.git + > git fetch gballet add-ewasm + > git checkout add-ewasm + ``` + +1. Build geth + + ```sh + > go build ./cmd/geth/... + ``` + +1. Run geth + + The Ewasm interpreter will be activated by default as long as you do not specify a `--vm.ewasm=...` on the command line option. + + ```sh + > TMPDIR=/tmp/ewasm-node/ ./geth --datadir $TMPDIR --etherbase 031159dF845ADe415202e6DA299223cb640B9DB0 --rpc --rpcapi "web3,net,eth,debug" --rpcvhosts="*" --rpcaddr "0.0.0.0" --rpccorsdomain "*" --mine --miner.threads 1 --nodiscover --networkid 66 + ```