From d5c101f2aa2294f76b785bcfcdac81103482c347 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Mon, 26 Aug 2019 07:34:07 +0200 Subject: [PATCH 1/2] First draft --- docs/_install-and-build/Build-from-Source.md | 27 +++++ .../Installation-Instructions-for-Mac.md | 8 +- .../Installation-Instructions-for-Ubuntu.md | 6 ++ docs/_install-and-build/Running-in-Docker.md | 31 ++++++ docs/getting-started.md | 102 ++++++++++++++++++ 5 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 docs/_install-and-build/Build-from-Source.md create mode 100644 docs/_install-and-build/Installation-Instructions-for-Ubuntu.md create mode 100644 docs/getting-started.md diff --git a/docs/_install-and-build/Build-from-Source.md b/docs/_install-and-build/Build-from-Source.md new file mode 100644 index 0000000000..7075b2e1d2 --- /dev/null +++ b/docs/_install-and-build/Build-from-Source.md @@ -0,0 +1,27 @@ + + +## Build from source + +Go Ethereum (as its name implies) is written in [Go](https://golang.org), and as such to build from source code you need to have at least Go 1.7 installed (preferably the latest version, currently at 1.9.2). This guide does not go into details on how to install Go itself, for that please read the [Go installation instructions](https://golang.org/doc/install). + +Assuming you have Go installed, you can download our project via: + +```shell +go get -d github.com/ethereum/go-ethereum +``` + +The above command will checkout the default version of Go Ethereum into your local `GOPATH` work space, but it will not build any executables for you. To do that you can either build one specifically: + + go install github.com/ethereum/go-ethereum/cmd/geth + +Or you can also build the entire project and install `geth` along with all developer tools by running `go install ./...` in the repository root inside your `GOPATH` work space. + +### Building without a Go workflow + +If you do not want to set up Go work spaces on your machine, only build `geth` and forget about the build process, you can clone our repository directly into a folder of your choosing and invoke `make`, which will configure everything for a temporary build and clean up after itself: + + git clone https://github.com/ethereum/go-ethereum.git + cd go-ethereum + make geth + +This will create a `geth` (or `geth.exe` on Windows) executable file in the `go-ethereum/build/bin` folder that you can move wherever you want to run from. The binary is standalone and doesn't require any additional files. diff --git a/docs/_install-and-build/Installation-Instructions-for-Mac.md b/docs/_install-and-build/Installation-Instructions-for-Mac.md index b3b1c7ce7d..ccc25d0b8c 100644 --- a/docs/_install-and-build/Installation-Instructions-for-Mac.md +++ b/docs/_install-and-build/Installation-Instructions-for-Mac.md @@ -1,6 +1,7 @@ --- -title: Installation instructions for Mac +title: Installation instructions for macOS --- + ## Installing with Homebrew By far the easiest way to install go-ethereum is to use our @@ -13,7 +14,7 @@ brew tap ethereum/ethereum brew install ethereum ``` -You can install the develop branch by running `--devel`: +You can install the develop branch using the `--devel` parameter: ```shell brew install ethereum --devel @@ -25,7 +26,7 @@ You should now be able to run `geth` and connect to the network. Make sure to check the different options and commands with `geth --help` -For options and patches, see: https://github.com/ethereum/homebrew-ethereum +For options and patches, see: ## Building from source @@ -44,6 +45,7 @@ brew install go ``` Finally, build the `geth` program using the following command. + ```shell cd go-ethereum make geth diff --git a/docs/_install-and-build/Installation-Instructions-for-Ubuntu.md b/docs/_install-and-build/Installation-Instructions-for-Ubuntu.md new file mode 100644 index 0000000000..0fd55a1ee7 --- /dev/null +++ b/docs/_install-and-build/Installation-Instructions-for-Ubuntu.md @@ -0,0 +1,6 @@ +Or the development version with: + +```shell +sudo apt-get update +sudo apt-get install ethereum-unstable +``` diff --git a/docs/_install-and-build/Running-in-Docker.md b/docs/_install-and-build/Running-in-Docker.md index 9dfc5e26bd..6e905dd889 100644 --- a/docs/_install-and-build/Running-in-Docker.md +++ b/docs/_install-and-build/Running-in-Docker.md @@ -21,6 +21,7 @@ To start a node that runs the JSON-RPC interface on port **8545**, run: ```shell docker run -it -p 8545:8545 -p 30303:30303 ethereum/client-go --rpc --rpcaddr "0.0.0.0" ``` + **WARNING: This opens your container to external calls. "0.0.0.0" should _not_ be used when exposed to public networks** To use the interactive JavaScript console, run: @@ -35,3 +36,33 @@ To persist downloaded blockchain data between container starts, use Docker [data docker run -it -p 30303:30303 -v /path/on/host:/root/.ethereum ethereum/client-go +* * * + +We maintain four different docker images for running the latest stable or development versions of Geth. + +- `ethereum/client-go:latest` is the latest development version of Geth +- `ethereum/client-go:stable` is the latest stable version of Geth +- `ethereum/client-go:{version}` is the stable version of Geth at a specific version number +- `ethereum/client-go:release-{version}` is the latest stable version of Geth at a specific version family + + + +We also maintain four different docker images for running the latest stable or development versions of miscellaneous Ethereum tools. + +- `ethereum/client-go:alltools-latest` is the latest develop version of the Ethereum tools +- `ethereum/client-go:alltools-stable` is the latest stable version of the Ethereum tools +- `ethereum/client-go:alltools-{version}` is the stable version of the Ethereum tools at a specific version number +- `ethereum/client-go:alltools-release-{version}` is the latest stable version of the Ethereum tools at a specific version family + + + +The image has the following ports automatically exposed: + +- `8545` TCP, used by the HTTP based JSON RPC API +- `8546` TCP, used by the WebSocket based JSON RPC API +- `30303` TCP and UDP, used by the P2P protocol running the network +- `30304` UDP, used by the P2P protocol's new peer discovery overlay + + + +_Note, if you are running an Ethereum client inside a docker container, you might want to mount in a data volume as the client's data directory (located at `/root/.ethereum` inside the container) to ensure that downloaded data is preserved between restarts and/or container life-cycles._ diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000000..39336788c6 --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,102 @@ +--- +title: Getting Started with Geth +--- + +## Installing + +You can install the Go implementation of Ethereum in a variety of ways. These include installing it via your favorite package manager; downloading a standalone pre-built binary; running as a docker container; or building it yourself. This section highlights the common options, in the left hand menu, or in the [install and build](/install-and-build/Installing-Geth) section. + +### Install on macOS via Homebrew + +You can install go-ethereum on macOS using [our Homebrew tap](https://github.com/ethereum/homebrew-ethereum). If you don't have Homebrew, [install it first](http://brew.sh/). + +Then run the following commands to add the tap and install geth: + +```shell +brew tap ethereum/ethereum +brew install ethereum +``` + +_[Read this guide](/install-and-build/Installation-Instructions-for-Mac) further Homebrew options._ + +### Install on Ubuntu via PPAs + +You can install go-ethereum on Ubuntu-based distributions using the built-in launchpad PPAs (Personal Package Archives). We provide a single PPA repository with both our stable and our development releases for Ubuntu versions `trusty`, `xenial`, `zesty` and `artful`. + +Install dependencies first: + +```shell +sudo apt-get install software-properties-common +``` + +To enable our launchpad repository run: + +```shell +sudo add-apt-repository -y ppa:ethereum/ethereum +``` + +After that you can install the stable version of Go Ethereum: + +```shell +sudo apt-get update +sudo apt-get install ethereum +``` + +_[Read this guide](/install-and-build/Installation-Instructions-for-Ubuntu) for further Ubuntu options._ + +### Install on Windows + +_Although we were shipping Chocolatey packages for a time after the Frontier release, the constant manual approval process led to us stopping distribution. We will try to negotiate trusted package status for go-ethereum so the Chocolatey option is available again._ + +Until then grab a Windows installer from our [downloads](https://geth.ethereum.org/downloads) page. + +### Download standalone bundle + +We distribute all our stable releases and development builds as standalone binaries. These are useful for scenarios where you'd like to: a) install a specific version of our code (e.g., for reproducible environments); b) install on machines without internet access (e.g., air gapped computers); or c) do not like automatic updates and would rather manually install software. + +We create the following standalone binaries: + +- 32bit, 64bit, ARMv5, ARMv6, ARMv7 and ARM64 archives (`.tar.gz`) on Linux +- 64bit archives (`.tar.gz`) on macOS +- 32bit and 64bit archives (`.zip`) and installers (`.exe`) on Windows + +For all binaries we provide two options, one containing only Geth, and another containing Geth along with all the developer tools from our repository (`abigen`, `bootnode`, `disasm`, `evm`, `rlpdump`). Read our [`README`](https://github.com/ethereum/go-ethereum#executables) for more information about these executables. + +To download these binaries, head to the [Go Ethereum Downloads](https://geth.ethereum.org/downloads) page. + +### Run inside docker container + +We maintain a Docker image with recent snapshot builds from our `develop` branch on DockerHub. In addition to the container based on Ubuntu (158 MB), there is a smaller image using Alpine Linux (35 MB). To use the alpine [tag](https://hub.docker.com/r/ethereum/client-go/tags), replace `ethereum/client-go` with `ethereum/client-go:alpine` in the examples below. + +To pull the image and start a node, run these commands: + +```shell +docker pull ethereum/client-go +docker run -it -p 30303:30303 ethereum/client-go +``` + +_[Read this guide](/install-and-build/Installation-Instructions-for-Docker) for further Docker options._ + +## Running ETC + +Before starting Geth you first need to create an account that represents a key pair. Use the following command to create a new account and set a password for that account: + +```shell +geth account new +``` + +[Read this guide](/interface/Managing-your-accounts) for more details on importing existing Ethereum accounts and other uses of the `account` command. + +Running Geth starts an Ethereum node that can join any existing network, or create a new one. You can start Geth in one of three different sync modes using the `--syncmode "{mode}"` argument that determines what sort of node it is in the network. + +These are: + +- **Full**: Downloads all block headers, block data, and validates all transactions +- **Fast** (Default): Downloads block headers and block data of the most recent transactions (1024) and validates them. +- **Light**: Downloads all block headers, block data, but does not validate transactions. + +* * * + +Sync modes + +What a full node is From 042ddbbdf2a2169dfaca75937c2d982de0282966 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Wed, 28 Aug 2019 11:01:33 +0200 Subject: [PATCH 2/2] Reorg --- .../index.md} | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) rename docs/{getting-started.md => getting-started/index.md} (82%) diff --git a/docs/getting-started.md b/docs/getting-started/index.md similarity index 82% rename from docs/getting-started.md rename to docs/getting-started/index.md index 39336788c6..a91d2cbc32 100644 --- a/docs/getting-started.md +++ b/docs/getting-started/index.md @@ -4,7 +4,7 @@ title: Getting Started with Geth ## Installing -You can install the Go implementation of Ethereum in a variety of ways. These include installing it via your favorite package manager; downloading a standalone pre-built binary; running as a docker container; or building it yourself. This section highlights the common options, in the left hand menu, or in the [install and build](/install-and-build/Installing-Geth) section. +You can install the Go implementation of Ethereum in a variety of ways. These include installing it via your favorite package manager; downloading a standalone pre-built binary; running as a docker container; or building it yourself. This section highlights the common options, but you can find others in the left hand menu, or in the [install and build](/install-and-build/Installing-Geth) section. ### Install on macOS via Homebrew @@ -35,7 +35,7 @@ To enable our launchpad repository run: sudo add-apt-repository -y ppa:ethereum/ethereum ``` -After that you can install the stable version of Go Ethereum: +After that you can install the stable version of go-ethereum: ```shell sudo apt-get update @@ -50,7 +50,7 @@ _Although we were shipping Chocolatey packages for a time after the Frontier rel Until then grab a Windows installer from our [downloads](https://geth.ethereum.org/downloads) page. -### Download standalone bundle +### Download standalone binary We distribute all our stable releases and development builds as standalone binaries. These are useful for scenarios where you'd like to: a) install a specific version of our code (e.g., for reproducible environments); b) install on machines without internet access (e.g., air gapped computers); or c) do not like automatic updates and would rather manually install software. @@ -77,7 +77,9 @@ docker run -it -p 30303:30303 ethereum/client-go _[Read this guide](/install-and-build/Installation-Instructions-for-Docker) for further Docker options._ -## Running ETC +## Starting a node + +### Create an account Before starting Geth you first need to create an account that represents a key pair. Use the following command to create a new account and set a password for that account: @@ -85,7 +87,9 @@ Before starting Geth you first need to create an account that represents a key p geth account new ``` -[Read this guide](/interface/Managing-your-accounts) for more details on importing existing Ethereum accounts and other uses of the `account` command. +_[Read this guide](/interface/Managing-your-accounts) for more details on importing existing Ethereum accounts and other uses of the `account` command._ + +### Sync modes Running Geth starts an Ethereum node that can join any existing network, or create a new one. You can start Geth in one of three different sync modes using the `--syncmode "{mode}"` argument that determines what sort of node it is in the network. @@ -95,8 +99,26 @@ These are: - **Fast** (Default): Downloads block headers and block data of the most recent transactions (1024) and validates them. - **Light**: Downloads all block headers, block data, but does not validate transactions. -* * * +For example: + +```shell +geth --syncmode "light" +``` + +### Connect to node + +Once you have an account and Geth is running, you can interact with it by opening another terminal and using the following command to open a JavaScript console: + +```shell +geth attach +``` + +In the console you can issue any of the Geth commands, for example, to list all the accounts on the node, use: + +```shell +eth.accounts +``` -Sync modes + -What a full node is +## Next steps