├── .env.local.example ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .prettierignore ├── .prettierrc ├── README.md ├── docs ├── developers │ ├── dapp-developer │ │ ├── dev-mode.md │ │ ├── mobile.md │ │ ├── native-accounts.md │ │ ├── native-bindings.md │ │ └── native.md │ ├── evm-tracing │ │ ├── basic-traces.md │ │ ├── built-in-tracers.md │ │ ├── custom-tracer.md │ │ ├── index.md │ │ └── javascript-tutorial.md │ ├── geth-developer │ │ ├── code-review-guidelines.md │ │ ├── contributing.md │ │ ├── dev-guide.md │ │ ├── disclosures.md │ │ └── dns-discovery-setup.md │ └── index.md ├── faq.md ├── fundamentals │ ├── account-management.md │ ├── backup-restore.md │ ├── command-line-options.md │ ├── index.md │ ├── les.md │ ├── logs.md │ ├── mining.md │ ├── node-architecture.md │ ├── peer-to-peer.md │ ├── private-network.md │ ├── pruning.md │ ├── security.md │ └── sync-modes.md ├── getting-started │ ├── consensus-clients.md │ ├── hardware-requirements.md │ ├── index.md │ └── installing-geth.md ├── index.md ├── interacting-with-geth │ ├── javascript-console-contracts.md │ ├── javascript-console.md │ └── rpc │ │ ├── batch.md │ │ ├── graphql.md │ │ ├── index.md │ │ ├── ns-admin.md │ │ ├── ns-clique.md │ │ ├── ns-debug.md │ │ ├── ns-eth.md │ │ ├── ns-les.md │ │ ├── ns-miner.md │ │ ├── ns-net.md │ │ ├── ns-personal-deprecation.md │ │ ├── ns-personal.md │ │ ├── ns-txpool.md │ │ └── pubsub.md ├── monitoring │ ├── dashboards.md │ ├── ethstats.md │ └── metrics.md ├── resources.md └── tools │ ├── abigen.md │ ├── clef │ ├── apis.md │ ├── clique-signing.md │ ├── datatypes.md │ ├── introduction.md │ ├── rules.md │ ├── setup.md │ └── tutorial.md │ ├── devp2p.md │ └── puppeth.md ├── netlify.toml ├── next-sitemap.config.js ├── next.config.js ├── package.json ├── public ├── code │ ├── qubes-client.py │ └── qubes.Clefsign ├── docs │ └── vulnerabilities │ │ ├── vulnerabilities.json │ │ └── vulnerabilities.json.minisig ├── favicon.ico ├── images │ ├── docs │ │ ├── clef_qubes_http.png │ │ ├── clef_qubes_qrexec.png │ │ ├── clef_ruleset.png │ │ ├── clef_sign_flow.png │ │ ├── devcon2_labelled.webp │ │ ├── ethstats-mainnet.png │ │ ├── grafana.png │ │ ├── node-architecture-text-background.png │ │ ├── node_architecture.png │ │ ├── node_basic.png │ │ ├── qrexec-example.png │ │ ├── qubes_newaccount-1.png │ │ ├── qubes_newaccount-2.png │ │ ├── remix-compiler.png │ │ ├── remix-deploy.png │ │ ├── remix-func.png │ │ ├── remix.png │ │ ├── state-pruning.png │ │ ├── wireframe1.png │ │ ├── wireframe2.png │ │ ├── wireframe3.png │ │ ├── wireframe4.png │ │ └── wireframe5.png │ └── metadata-gopher.png └── robots.txt ├── redirects.js ├── src ├── components │ ├── UI │ │ ├── ButtonLinkSecondary.tsx │ │ ├── DataTable.tsx │ │ ├── Header.tsx │ │ ├── HeaderButtons.tsx │ │ ├── PageMetadata.tsx │ │ ├── Search.tsx │ │ ├── docs │ │ │ ├── Breadcrumbs.tsx │ │ │ ├── Code.tsx │ │ │ ├── DocsLinks.tsx │ │ │ ├── DocsNav.tsx │ │ │ ├── DocumentNav.tsx │ │ │ ├── LinksList.tsx │ │ │ ├── MDComponents.tsx │ │ │ ├── Note.tsx │ │ │ └── index.ts │ │ ├── downloads │ │ │ ├── DownloadsHero.tsx │ │ │ ├── DownloadsSection.tsx │ │ │ ├── DownloadsTable.tsx │ │ │ ├── SpecificVersionsSection.tsx │ │ │ └── index.ts │ │ ├── homepage │ │ │ ├── HomeHero.tsx │ │ │ ├── HomeSection.tsx │ │ │ ├── QuickLinks.tsx │ │ │ ├── WhatIsEthereum.tsx │ │ │ ├── WhyRunANode.tsx │ │ │ └── index.ts │ │ ├── icons │ │ │ ├── DiscordIcon.tsx │ │ │ ├── GitHubIcon.tsx │ │ │ ├── HamburgerIcon.tsx │ │ │ ├── LensIcon.tsx │ │ │ ├── LinuxPenguin.tsx │ │ │ ├── MacosLogo.tsx │ │ │ ├── MoonIcon.tsx │ │ │ ├── SourceBranch.tsx │ │ │ ├── SunIcon.tsx │ │ │ ├── TwitterIcon.tsx │ │ │ ├── WindowsLogo.tsx │ │ │ └── index.ts │ │ ├── index.ts │ │ └── svgs │ │ │ ├── AddIcon.tsx │ │ │ ├── GlyphHome.tsx │ │ │ ├── GopherDownloads.tsx │ │ │ ├── GopherHomeFront.tsx │ │ │ ├── GopherHomeLinks.tsx │ │ │ ├── GopherHomeNodes.tsx │ │ │ ├── MinusIcon.tsx │ │ │ └── index.ts │ └── layouts │ │ ├── Footer.tsx │ │ ├── Layout.tsx │ │ ├── MobileMenu.tsx │ │ └── index.ts ├── constants.ts ├── data │ └── documentation-links.yaml ├── hooks │ ├── .delete-me │ └── useActiveHash.ts ├── pages │ ├── 404.tsx │ ├── [...slug].tsx │ ├── _app.tsx │ ├── _document.tsx │ ├── about.mdx │ ├── api │ │ └── hello.ts │ ├── downloads.tsx │ └── index.tsx ├── theme │ ├── components │ │ ├── Button.ts │ │ ├── Link.ts │ │ └── index.ts │ ├── foundations │ │ ├── colors.ts │ │ ├── config.ts │ │ ├── fonts.ts │ │ ├── index.ts │ │ ├── shadows.ts │ │ ├── sizes.ts │ │ └── textStyles.ts │ ├── index.ts │ └── search.css ├── types.ts └── utils │ ├── checkNavLinks.ts │ ├── compareReleasesFn.ts │ ├── fetchLatestReleaseCommit.ts │ ├── fetchLatestReleaseVersionAndName.ts │ ├── fetchXMLData.ts │ ├── getChecksum.ts │ ├── getFileList.ts │ ├── getKebabCaseFromName.ts │ ├── getLastModifiedDate.ts │ ├── getLatestBinaryURL.ts │ ├── getOS.ts │ ├── getParsedDate.ts │ ├── getProgrammingLanguageName.ts │ ├── getReleaseArch.ts │ ├── getReleaseCommitHash.ts │ ├── getReleaseCommitURL.ts │ ├── getReleaseKind.ts │ ├── getReleaseName.ts │ ├── getReleaseSize.ts │ ├── getReleaseURL.ts │ ├── getSignatureURL.ts │ ├── getSortedReleases.ts │ ├── index.ts │ ├── isDarwinPrimaryRelease.ts │ ├── isLinuxPrimaryRelease.ts │ ├── isMobilePrimaryRelease.ts │ ├── isWindowsPrimaryRelease.ts │ ├── mapReleasesData.ts │ └── parseHeadingId.ts ├── tsconfig.json ├── url-list.csv └── yarn.lock /.env.local.example: -------------------------------------------------------------------------------- 1 | # Algolia 2 | NEXT_PUBLIC_ALGOLIA_APP_ID= 3 | NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY= 4 | NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME= 5 | 6 | # GitHub API 7 | # check fine-grained tokens https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#about-personal-access-tokens 8 | GITHUB_TOKEN_READ_ONLY= 9 | 10 | # Matomo 11 | NEXT_PUBLIC_MATOMO_URL= 12 | NEXT_PUBLIC_MATOMO_SITE_ID= 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .next 2 | dist 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "prettier"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env 30 | .env*.local 31 | 32 | # vercel 33 | .vercel 34 | 35 | # typescript 36 | *.tsbuildinfo 37 | next-env.d.ts 38 | 39 | # Sitemaps 40 | sitemap*.xml 41 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules 3 | yarn.lock 4 | package-lock.json 5 | public 6 | build 7 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "trailingComma": "none", 4 | "semi": true, 5 | "arrowParens": "avoid", 6 | "singleQuote": true, 7 | "jsxSingleQuote": true, 8 | "tabWidth": 2, 9 | "useTabs": false 10 | } 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Geth website 2 | 3 | This repository is no longer active and was archived. 4 | 5 | Development of the [go-ethereum website](https://geth.ethereum.org) continues on the `website` branch of the [go-ethereum Github repository](https://github.com/ethereum/go-ethereum/tree/website). 6 | 7 | Please see contribution guidelines [here](https://github.com/ethereum/go-ethereum/tree/website#welcome-to-the-go-ethereum-website). 8 | 9 | Thanks! 10 | -------------------------------------------------------------------------------- /docs/developers/evm-tracing/basic-traces.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Basic traces 3 | description: Introduction to basic EVM traces 4 | --- 5 | 6 | The simplest type of transaction trace that Geth can generate are raw EVM opcode traces. For every VM instruction the transaction executes, a structured log entry is emitted, containing all contextual metadata deemed useful. This includes the _program counter_, _opcode name_, _opcode cost_, _remaining gas_, _execution depth_ and any _occurred error_. The structured logs can optionally also contain the content of the _execution stack_, _execution memory_ and _contract storage_. 7 | 8 | The entire output of a raw EVM opcode trace is a JSON object having a few metadata fields: _consumed gas_, _failure status_, _return value_; and a list of _opcode entries_: 9 | 10 | ```json 11 | { 12 | "gas": 25523, 13 | "failed": false, 14 | "returnValue": "", 15 | "structLogs": [] 16 | } 17 | ``` 18 | 19 | An example log for a single opcode entry has the following format: 20 | 21 | ```json 22 | { 23 | "pc": 48, 24 | "op": "DIV", 25 | "gasCost": 5, 26 | "gas": 64532, 27 | "depth": 1, 28 | "error": null, 29 | "stack": [ 30 | "00000000000000000000000000000000000000000000000000000000ffffffff", 31 | "0000000100000000000000000000000000000000000000000000000000000000", 32 | "2df07fbaabbe40e3244445af30759352e348ec8bebd4dd75467a9f29ec55d98d" 33 | ], 34 | "memory": [ 35 | "0000000000000000000000000000000000000000000000000000000000000000", 36 | "0000000000000000000000000000000000000000000000000000000000000000", 37 | "0000000000000000000000000000000000000000000000000000000000000060" 38 | ], 39 | "storage": {} 40 | } 41 | ``` 42 | 43 | ### Generating basic traces {#generating-basic-traces} 44 | 45 | To generate a raw EVM opcode trace, Geth provides a few [RPC API endpoints](/docs/interacting-with-geth/rpc/ns-debug). The most commonly used is [`debug_traceTransaction`](/docs/interacting-with-geth/rpc/ns-debug#debug_tracetransaction). 46 | 47 | In its simplest form, `traceTransaction` accepts a transaction hash as its only argument. It then traces the transaction, aggregates all the generated 48 | data and returns it as a **large** JSON object. A sample invocation from the Geth console would be: 49 | 50 | ```js 51 | debug.traceTransaction('0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f'); 52 | ``` 53 | 54 | The same call can also be invoked from outside the node too via HTTP RPC (e.g. using Curl). In this case, the HTTP endpoint must be enabled in Geth using the `--http` command and the `debug` API namespace must be exposed using `--http.api=debug`. 55 | 56 | ```sh 57 | $ curl -H "Content-Type: application/json" -d '{"id": 1, "method": "debug_traceTransaction", "params": ["0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f"]}' localhost:8545 58 | ``` 59 | 60 | To follow along with this tutorial, transaction hashes can be found from a local Geth node (e.g. by attaching a [Javascript console](/docs/interacting-with-geth/javascript-console) and running `eth.getBlock('latest')` then passing a transaction hash from the returned block to `debug.traceTransaction()`) or from a block explorer (for [Mainnet](https://etherscan.io/) or a [testnet](https://goerli.etherscan.io/)). 61 | 62 | It is also possible to configure the trace by passing Boolean (true/false) values for four parameters that tweak the verbosity of the trace. By default, the _EVM memory_ and _Return data_ are not reported but the _EVM stack_ and _EVM storage_ are. To report the maximum amount of data: 63 | 64 | ```sh 65 | enableMemory: true 66 | disableStack: false 67 | disableStorage: false 68 | enableReturnData: true 69 | ``` 70 | 71 | An example call, made in the Geth Javascript console, configured to report the maximum amount of data looks as follows: 72 | 73 | ```js 74 | debug.traceTransaction('0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f', { 75 | enableMemory: true, 76 | disableStack: false, 77 | disableStorage: false, 78 | enableReturnData: true 79 | }); 80 | ``` 81 | 82 | The above operation was run on the (now-deprecated) Rinkeby network (with a node retaining enough history), resulting in this [trace dump](https://gist.github.com/karalabe/c91f95ac57f5e57f8b950ec65ecc697f). 83 | 84 | Alternatively, disabling _EVM Stack_, _EVM Memory_, _Storage_ and _Return data_ (as demonstrated in the Curl request below) results in the following, much shorter, [trace dump](https://gist.github.com/karalabe/d74a7cb33a70f2af75e7824fc772c5b4). 85 | 86 | ```sh 87 | $ curl -H "Content-Type: application/json" -d '{"id": 1, "method": "debug_traceTransaction", "params": ["0xfc9359e49278b7ba99f59edac0e3de49956e46e530a53c15aa71226b7aa92c6f", {"disableStack": true, "disableStorage": true}]}' localhost:8545 88 | ``` 89 | 90 | ### Limits of basic traces {#list-of-basic-traces} 91 | 92 | Although the raw opcode traces generated above are useful, having an individual log entry for every single opcode is too low level for most use cases, 93 | and will require developers to create additional tools to post-process the traces. Additionally, a full opcode trace can easily go into the hundreds of megabytes, making them very resource intensive to get out of the node and process externally. 94 | 95 | To avoid those issues, Geth supports running custom JavaScript tracers _within_ the Ethereum node, which have full access to the EVM stack, memory and contract storage. This means developers only have to gather the data they actually need, and do any processing at the source. 96 | 97 | ## Summary {#summary} 98 | 99 | This page described how to do basic traces in Geth. Basic traces are very low level and can generate lots of data that might not all be useful. Therefore, it is also possible to use a set of built-in tracers or write custom ones in Javascript or Go. 100 | 101 | Read more about [built-in](/docs/developers/evm-tracing/built-in-tracers) and [custom](/docs/developers/evm-tracing/custom-tracer) traces. 102 | -------------------------------------------------------------------------------- /docs/developers/geth-developer/code-review-guidelines.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Code Review Guidelines 3 | description: Explanation of how code PRs are reviewed 4 | --- 5 | 6 | The only way to get code into Geth is to submit a pull request (PR). Those pull requests need to be reviewed by someone. This document is a guide that explains our expectations around PRs for both authors and reviewers. 7 | 8 | ## Terminology {#terminology} 9 | 10 | - The **author** of a pull request is the entity who wrote the diff and submitted it to GitHub. 11 | - The **team** consists of people with commit rights on the go-ethereum repository. 12 | - The **reviewer** is the person assigned to review the diff. The reviewer must be a team member. 13 | - The **code owner** is the person responsible for the subsystem being modified by the PR. 14 | 15 | ## The Process {#process} 16 | 17 | The first decision to make for any PR is whether it's worth including at all. This decision lies primarily with the code owner, but may be negotiated with team members. 18 | 19 | To make the decision we must understand what the PR is about. If there isn't enough description content or the diff is too large, request an explanation. Anyone can do this part. 20 | 21 | We expect that reviewers check the style and functionality of the PR, providing comments to the author using the GitHub review system. Reviewers should follow up with the PR until it is in good shape, then **approve** the PR. Approved PRs can be merged by any code owner. 22 | 23 | When communicating with authors, be polite and respectful. 24 | 25 | ### Code Style {#code-style} 26 | 27 | We expect `gofmt`ed code. For contributions of significant size, we expect authors to understand and use the guidelines in [Effective Go](https://golang.org/doc/effective_go.html). Authors should avoid common mistakes explained in the [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) page. 28 | 29 | ### Functional Checks {#functional-checks} 30 | 31 | For PRs that fix an issue, reviewers should try reproduce the issue and verify that the pull request actually fixes it. Authors can help with this by including a unit test that fails without (and passes with) the change. 32 | 33 | For PRs adding new features, reviewers should attempt to use the feature and comment on how it feels to use it. Example: if a PR adds a new command line flag, use the program with the flag and comment on whether the flag feels useful. 34 | 35 | We expect appropriate unit test coverage. Reviewers should verify that new code is covered by unit tests. 36 | 37 | ### CI {#ci} 38 | 39 | Code submitted must pass all unit tests and static analysis ("lint") checks. We use Travis CI to test code on Linux, macOS and AppVeyor to test code on Microsoft Windows. 40 | 41 | For failing CI builds, the issue may not be related to the PR itself. Such failures are usually related to flakey tests. These failures can be ignored (authors don't need to fix unrelated issues), but please file a GH issue so the test gets fixed eventually. 42 | 43 | ### Commit Messages {#commit-messages} 44 | 45 | Commit messages on the master branch should follow the rule below. PR authors are not required to use any particular style because the message can be modified at merge time. Enforcing commit message style is the responsibility of the person merging the PR. 46 | 47 | The commit message style we use is similar to the style used by the Go project: 48 | 49 | The first line of the change description is conventionally a one-line summary of the change, prefixed by the primary affected Go package. It should complete the sentence "This change modifies go-ethereum to **\_**." The rest of the description elaborates and should provide context for the change and explain what it does. 50 | 51 | Template: 52 | 53 | ```text 54 | package/path: change XYZ 55 | 56 | Longer explanation of the change in the commit. You can use multiple sentences here. It's usually best to include content from the PR description in the final commit message. 57 | 58 | issue notices, e.g. "Fixes #42353". 59 | ``` 60 | 61 | ### Special Situations And How To Deal With Them {#special-situations} 62 | 63 | Reviewers may find themselves in one of the sitations below. Here's how to deal with them: 64 | 65 | - The author doesn't follow up: ping them after a while (i.e. after a few days). If there is no further response, close the PR or complete the work yourself. 66 | 67 | - Author insists on including refactoring changes alongside bug fix: We can tolerate small refactorings alongside any change. If you feel lost in the diff, ask the author to submit the refactoring as an independent PR, or at least as an independent commit in the same PR. 68 | 69 | - Author keeps rejecting feedback: reviewers have authority to reject any change for technical reasons. If you're unsure, ask the team for a second opinion. The PR can be closed if no consensus can be reached. 70 | -------------------------------------------------------------------------------- /docs/developers/geth-developer/contributing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contributing 3 | description: Guidelines for contributing to Geth 4 | --- 5 | 6 | We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! 7 | 8 | ## Contributing to the Geth source code {#contributing-to-source-code} 9 | 10 | If you'd like to contribute to the Geth source code, please fork the [GitHub repository](https://github.com/ethereum/go-ethereum), fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on our Discord Server to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple. 11 | 12 | Please make sure your contributions adhere to our coding guidelines: 13 | 14 | - Code must adhere to the official Go formatting guidelines (i.e. uses gofmt). 15 | - Code must be documented adhering to the official Go commentary guidelines. 16 | - Pull requests need to be based on and opened against the master branch. 17 | - Commit messages should be prefixed with the package(s) they modify. 18 | E.g. "eth, rpc: make trace configs optional" 19 | 20 | Pull requests generally need to be based on and opened against the `master` branch, unless by explicit agreement because the work is contributing to some more complex feature branch. 21 | 22 | All pull requests will be reviewed according to the [Code Review guidelines](/docs/developers/geth-developer/code-review-guidelines). 23 | 24 | We encourage an early pull request approach, meaning pull requests are created as early as possible even without the completed fix/feature. This will let core devs and other volunteers know you picked up an issue. These early PRs should indicate 'in progress' status. 25 | 26 | ## Contributing to the Geth website {#contributing-to-website} 27 | 28 | The Geth website is hosted separately from Geth itself. The contribution guidelines are the same. Please check out the [website repository](https://github.com/ethereum/geth-website) and raise pull requests for the maintainers to review and merge. 29 | 30 | ## License {#license} 31 | 32 | The go-ethereum library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file. 33 | 34 | The go-ethereum binaries (i.e. all code inside of the cmd directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file. 35 | -------------------------------------------------------------------------------- /docs/developers/geth-developer/disclosures.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vulnerability disclosure 3 | description: Instructions for disclosing vulnerabilities to the Geth team 4 | --- 5 | 6 | In the software world, it is expected for security vulnerabilities to be immediately announced, thus giving operators an opportunity to take protective measure against attackers. 7 | 8 | Vulnerabilies typically take two forms: 9 | 10 | 1. Vulnerabilies that, if exploited, would harm the software operator. In the case of Geth, examples would be: 11 | - A bug that would allow remote reading or writing of OS files, or 12 | - Remote command execution, or 13 | - Bugs that would leak cryptographic keys 14 | 2. Vulnerabilies that, if exploited, would harm the Ethereum mainnet. In the case of Geth, examples would be: 15 | - Consensus vulnerabilities, which would cause a chain split, 16 | - Denial-of-service during block processing, whereby a malicious transaction could cause the geth-portion of the network to crash. 17 | - Denial-of-service via p2p networking, whereby portions of the network could be made 18 | inaccessible due to crashes or resource consumption. 19 | 20 | In most cases so far, vulnerabilities in Geth have been of the second type, where the health of the network is a concern, rather than individual node operators. For such issues, Geth reserves the right to silently patch and ship fixes in new releases. 21 | 22 | ### Why silent patches {#why-slient-patches} 23 | 24 | In the case of Ethereum, it takes a lot of time (weeks, months) to get node operators to update even to a scheduled hard fork. If we were to highlight that a release contains important consensus or DoS fixes, there is always a risk of someone trying to beat node operators to the punch, and exploit the vulnerability. Delaying a potential attack sufficiently to make the majority of node operators immune may be worth the temporary loss of transparency. 25 | 26 | The primary goal for the Geth team is the health of the Ethereum network as a whole, and the decision whether or not to publish details about a serious vulnerability boils down to minimizing the risk and/or impact of discovery and exploitation. 27 | 28 | At certain times, it's better to remain silent. This practice is also followed by other projects such as [Monero](https://www.getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html), [ZCash](https://electriccoin.co/blog/zcash-counterfeiting-vulnerability-successfully-remediated/) and [Bitcoin](https://www.coindesk.com/the-latest-bitcoin-bug-was-so-bad-developers-kept-its-full-details-a-secret). 29 | 30 | ### Public transparency {#public-transparency} 31 | 32 | As of November 2020, our policy going forward is: 33 | 34 | - If we silently fix a vulnerability and include the fix in release `X`, then, 35 | - After 4-8 weeks, we will disclose that `X` contained a security-fix. 36 | - After an additional 4-8 weeks, we will publish the details about the vulnerability. 37 | 38 | We hope that this provides sufficient balance between transparency versus the need for secrecy, and aids node operators and downstream projects in keeping up to date with what versions to run on their infrastructure. 39 | 40 | In keeping with this policy, we have taken inspiration from [Solidity bug disclosure](https://solidity.readthedocs.io/en/develop/bugs.html) - see below. 41 | 42 | ## Disclosed vulnerabilities {#disclosed-vulnerabilities} 43 | 44 | There is a JSON-formatted list ([`vulnerabilities.json`](/public/docs/vulnerabilities/vulnerabilities.json)) of some of the known security-relevant vulnerabilities concerning Geth. 45 | 46 | As of version `1.9.25`, Geth has a built-in command to check whether it is affected by any publically disclosed vulnerability, using the command `geth version-check`. This command will fetch the latest json file (and the accompanying [signature-file](/public/docs/vulnerabilities/vulnerabilities.json.minisig), and cross-check the data against it's own version number. 47 | 48 | The list of vulnerabilities was started in November 2020, and covers mainly `v1.9.7` and forward. 49 | 50 | The JSON file of known vulnerabilities below is a list of objects, one for each vulnerability, with the following keys: 51 | 52 | - `name` 53 | - Unique name given to the vulnerability. 54 | - `uid` 55 | - Unique identifier of the vulnerability. Format `GETH--` 56 | - `summary` 57 | - Short description of the vulnerability. 58 | - `description` 59 | - Detailed description of the vulnerability. 60 | - `links` 61 | - List of relevant URLs with more detailed information (optional). 62 | - `introduced` 63 | - The first published Geth version that contained the vulnerability (optional). 64 | - `fixed` 65 | - The first published Geth version that did not contain the vulnerability anymore. 66 | - `published` 67 | - The date at which the vulnerability became known publicly (optional). 68 | - `severity` 69 | - Severity of the vulnerability: `low`, `medium`, `high`, `critical`. 70 | - Takes into account the severity of impact and likelihood of exploitation. 71 | - `check` 72 | - This field contains a regular expression, which can be used against the reported `web3_clientVersion` of a node. If the check 73 | matches, the node is with a high likelyhood affected by the vulnerability. 74 | - `CVE` 75 | - The assigned `CVE` identifier, if available (optional) 76 | 77 | ### What about GitHub security advisories {#github-security-advisories} 78 | 79 | We prefer to not rely on GitHub as the only/primary publishing protocol for security advisories, but we plan to use the GitHub-advisory process as a second channel for disseminating vulnerability-information. 80 | 81 | Advisories published via GitHub can be accessed [here](https://github.com/ethereum/go-ethereum/security/advisories?state=published). 82 | 83 | ## Bug Bounties {#bug-bounties} 84 | 85 | The Ethereum Foundation run a bug bounty program to reward responsible disclosures of bugs in client software and specs. The details are provided on [ethereum.org](https://ethereum.org/en/bug-bounty/). 86 | -------------------------------------------------------------------------------- /docs/developers/geth-developer/dns-discovery-setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: DNS Discovery Setup Guide 3 | description: Instructions for setting up DNS discovery 4 | --- 5 | 6 | This document explains how to set up an [EIP 1459](https://eips.ethereum.org/EIPS/eip-1459) node list using the devp2p developer tool. The focus of this guide is creating a public list for the Ethereum mainnet and public testnets, but it may also be helpful for setting up DNS-based discovery for a private network. 7 | 8 | DNS-based node lists can serve as a fallback option when connectivity to the discovery DHT is unavailable. In this guide, node lists will be reated by crawling the discovery DHT, then publishing the resulting node sets under chosen DNS names. 9 | 10 | ## Installing the devp2p command {#installing-devp2p} 11 | 12 | `cmd/devp2p` is a developer utility and is not included in the Geth distribution. You can install this command using `go get`: 13 | 14 | ```sh 15 | go get github.com/ethereum/go-ethereum/cmd/devp2p 16 | ``` 17 | 18 | To create a signing key, the `ethkey` utility is needed. 19 | 20 | ```sh 21 | go get github.com/ethereum/go-ethereum/cmd/ethkey 22 | ``` 23 | 24 | ## Crawling the v4 DHT {#crawling-v4-dht} 25 | 26 | Our first step is to compile a list of all reachable nodes. The DHT crawler in cmd/devp2p is a batch process which runs for a set amount of time. You should should schedule this command to run at a regular interval. To create a node list, run 27 | 28 | ```sh 29 | devp2p discv4 crawl -timeout 30m all-nodes.json 30 | ``` 31 | 32 | This walks the DHT and stores the set of all found nodes in the `all-nodes.json` file. 33 | Subsequent runs of the same command will revalidate previously discovered node records, 34 | add newly-found nodes to the set, and remove nodes which are no longer alive. The quality 35 | of the node set improves with each run because the number of revalidations is tracked 36 | alongside each node in the set. 37 | 38 | ## Creating sub-lists through filtering {#creating-sublists} 39 | 40 | Once `all-nodes.json` has been created and the set contains a sizeable number of nodes, 41 | useful sub-sets of nodes can be extracted using the `devp2p nodeset filter` command. This 42 | command takes a node set file as argument and applies filters given as command-line flags. 43 | 44 | To create a filtered node set, first create a new directory to hold the output set. You 45 | can use any directory name, though it's good practice to use the DNS domain name as the 46 | name of this directory. 47 | 48 | ```sh 49 | mkdir mainnet.nodes.example.org 50 | ``` 51 | 52 | Then, to create the output set containing Ethereum mainnet nodes only, run 53 | 54 | ```sh 55 | devp2p nodeset filter all-nodes.json -eth-network mainnet > mainnet.nodes.example.org/nodes.json 56 | ``` 57 | 58 | The following filter flags are available: 59 | 60 | - `-eth-network ( mainnet | sepolia | goerli )` selects an Ethereum network. 61 | - `-les-server` selects LES server nodes. 62 | - `-ip ` restricts nodes to the given IP range. 63 | - `-min-age ` restricts the result to nodes which have been live for the 64 | given duration. 65 | 66 | ## Creating DNS trees {#creating-dns-trees} 67 | 68 | To turn a node list into a DNS node tree, the list needs to be signed. To do this, a key pair is required. To create the key file in the correct format, the cmd/ethkey utility should be used. Choose a strong password to encrypt the key on disk! 69 | 70 | ```sh 71 | ethkey generate dnskey.json 72 | ``` 73 | 74 | Now use `devp2p dns sign` to update the signature of the node list. If the list's directory name differs from the name it will be published at,specify the DNS name the using the `-domain` flag. This command will prompt for the key file password and update the tree signature. 75 | 76 | ```sh 77 | devp2p dns sign mainnet.nodes.example.org dnskey.json 78 | ``` 79 | 80 | The resulting DNS tree metadata is stored in the `mainnet.nodes.example.org/enrtree-info.json` file. 81 | 82 | ## Publishing DNS trees {#publishing-dns-trees} 83 | 84 | Now that the tree is signed, it can be published to a DNS provider. cmd/devp2p currently supports publishing to CloudFlare DNS and Amazon Route53.TXT records can also be exported as a JSON file and published independently. 85 | 86 | To publish to CloudFlare, first create an API token in the management console. cmd/devp2p expects the API token in the `CLOUDFLARE_API_TOKEN` environment variable. Now use the following command to upload DNS TXT records via the CloudFlare API: 87 | 88 | ```sh 89 | devp2p dns to-cloudflare mainnet.nodes.example.org 90 | ``` 91 | 92 | Note that this command uses the domain name specified during signing. Any existing records below this name will be erased by cmd/devp2p. 93 | 94 | ## Using DNS trees with Geth {#using-dns-trees} 95 | 96 | Once a tree is available through a DNS name, Geth can use it with the `--discovery.dns` command line flag. Node trees are referenced using the `enrtree://` URL scheme. The URL of the tree can be found in the `enrtree-info.json` file created by `devp2p dns sign`. Pass the URL as an argument to the flag in order to make use of the published tree. 97 | 98 | ```sh 99 | geth --discovery.dns "enrtree://AMBMWDM3J6UY3M32TMMROUNLX6Y3YTLVC3DC6HN2AVG5NHNSAXDW6@mainnet.nodes.example.org" 100 | ``` 101 | -------------------------------------------------------------------------------- /docs/developers/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Developer docs 3 | description: Documentation for Geth developers and dapp developers 4 | --- 5 | 6 | Welcome to the Geth Developer docs! 7 | 8 | This section includes information for builders. If you are building decentralized apps on top of Geth, head to the `dapp-developer` docs. If you are developing Geth itself, explore the `geth-developer` docs. 9 | 10 | ## Dapp developers {#dapp-developers} 11 | 12 | Geth has many features that support dapp developers. There are many built-in tracers implemented in Go or Javascript that allow developers to monitor what is happening in Geth from inside an app, and users can build their own custom tracers too. Geth also includes a suite of tools for interacting with Ethereum smart contracts using Geth functions using Go functions inside Go native applications. There is also information for Geth mobile developers. 13 | 14 | - [Developer mode](/docs/developers/dapp-developer/dev-mode) 15 | - [Developing for mobile](/docs/developers/dapp-developer/mobile) 16 | - [Geth in Go apps](/docs/developers/dapp-developer/native) 17 | - [Go contract bindings](/docs/developers/dapp-developer/native-bindings) 18 | - [Account management in Go apps](/docs/developers/dapp-developer/native-accounts) 19 | 20 | ## Geth developers {#geth-developers} 21 | 22 | Geth developers add/remove features and fix bugs in Geth. The `geth-developer` section includes contribution guidelines and documentation relating to testing and disclosing vulnerabilities that willhep you get started with working on Geth. 23 | 24 | - [Code review guidelines](/docs/developers/geth-developer/code-review-guidelines) 25 | - [Contributing to Geth](/docs/developers/geth-developer/contributing) 26 | - [Developer guide](/docs/developers/geth-developer/dev-guide) 27 | - [Disclosures](/docs/developers/geth-developer/disclosures) 28 | - [DNS discovery setup guide](/docs/developers/geth-developer/dns-discovery-setup) 29 | 30 | ## EVM tracing 31 | 32 | Tracing allows developers to analyze precisely what the EVM has done or will do given a certain set of commands. This section outlines the various ways tracing can be implemented in Geth. 33 | 34 | - [Introduction](/docs/developers/evm-tracing/) 35 | - [Basic tracers](/docs/developers/evm-tracing/basic-traces) 36 | - [Built-in tracers](/docs/developers/evm-tracing/built-in-tracers) 37 | - [Custom tracers](/docs/developers/evm-tracing/custom-tracer) 38 | - [Javascript tracing tutorial](/docs/developers/evm-tracing/javascript-tutorial) 39 | -------------------------------------------------------------------------------- /docs/fundamentals/backup-restore.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Backup & Restore 3 | description: How to backup and restore keyfiles and blockchain data 4 | --- 5 | 6 | **Keep secure backups of your keystore and password!** 7 | 8 | ## Data Directory {#data-directory} 9 | 10 | All data relating to a specific Geth instance gets written inside a data directory. The default data directory locations are platform specific: 11 | 12 | - Mac: `~/Library/Ethereum` 13 | - Linux: `~/.ethereum` 14 | - Windows: `%LOCALAPPDATA%\Ethereum` 15 | 16 | Accounts are stored in the `keystore` subdirectory. The contents of this directories should be transportable between nodes, platforms, and client implementations. 17 | 18 | To configure the location of the data directory, the `--datadir` parameter can be specified. See [CLI Options](/docs/fundamentals/command-line-options) for more details. There may exist multiple data directories for multiple networks (e.g. a separate directory for Ethereum Mainnet and the Goerli testnet). Each would have subdirectories for their blockchain data and keystore. 19 | 20 | It is important to backup the files in the keystore securely. These files are encrypted using an account password. This needs to be securely backed up too. There is no way to decrypt the keys without the password! 21 | 22 | ## Cleanup {#cleanup} 23 | 24 | Geth's blockchain and state databases can be removed with: 25 | 26 | ```sh 27 | geth removedb 28 | ``` 29 | 30 | This is useful for deleting an old chain and sync'ing to a new one. It only affects data directories that can be re-created on synchronisation and does not touch the keystore. 31 | 32 | ## Blockchain Import/Export {#blockchain-import-export} 33 | 34 | Export the blockchain in binary format with: 35 | 36 | ```sh 37 | geth export 38 | ``` 39 | 40 | Or if you want to back up portions of the chain over time, a first and last block can be specified. For example, to back up the first epoch: 41 | 42 | ```sh 43 | geth export 0 29999 44 | ``` 45 | 46 | Note that when backing up a partial chain, the file will be appended rather than truncated. 47 | 48 | Import binary-format blockchain exports with: 49 | 50 | ```sh 51 | geth import 52 | ``` 53 | 54 | And finally: **REMEMBER YOUR PASSWORD** and **BACKUP YOUR KEYSTORE** 55 | -------------------------------------------------------------------------------- /docs/fundamentals/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Geth fundamentals 3 | description: Documentation for foundational Geth topics 4 | --- 5 | 6 | This section includes documentation for foundational topics in Geth. The pages here will help you to understand how Geth works from a user perspective and under the hood. 7 | 8 | This is where you will find information about how to manage a Geth node and understand how it functions. 9 | 10 | For example, the pages here will help you to understand the underlying architecture of your Geth node, how to start it in different configurations using command line options, how to sync the blockchain and how to manage accounts. There is a page on security practices that will help you to keep your Geth node safe from adversaries. 11 | 12 | Note also that there is a page explaining common log messages that are often queried on the Geth discord and GitHub - this will help users to interpret the messages displayed to the console and know what actions to take. 13 | 14 | ## In this section 15 | 16 | - [Node architecture](/docs/fundamentals/node-architecture): learn about the three components of an Ethereum node and how they fit together 17 | - [Command line options](/docs/fundamentals/command-line-options): see the various command line options that can be used to configure Geth 18 | - [Security](/docs/fundamentals/security): learn about basic security best-practises for Geth 19 | - [Sync-modes](/docs/fundamentals/sync-modes): learn about the different ways Geth can sync the blockchain 20 | - [Account management](/docs/fundamentals/account-management): read about how to manage accounts using Clef and Geth 21 | - [Backup and restore](/docs/fundamentals/backup-restore): learn how to backup and restore data for a Geth instance 22 | - [Logs](/docs/fundamentals/logs): learn how to interpret the main log messages Geth displays in the console 23 | - [Peer-to-peer](/docs/fundamentals/peer-to-peer): learn about Geth's peer-to-peer networking 24 | - [Pruning](/docs/fundamentals/pruning): read about Geth's data pruning options 25 | - [Private networks](/docs/fundamentals/private-network): learn hoe to set up a private network of multiple Geth nodes 26 | - [Light clients](/docs/fundamentals/les): read about Geth's light mode. 27 | - [Mining](/docs/fundamentals/mining): read about the minign algorithms Geth used to use to secure Ethereum before the network switched to proof-of-stake. 28 | -------------------------------------------------------------------------------- /docs/fundamentals/node-architecture.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Node architecture 3 | description: Introduction to how Ethereum nodes are organized and where Geth fits. 4 | --- 5 | 6 | An Ethereum node is composed of two clients: an [execution client](https://ethereum.org/en/developers/docs/nodes-and-clients/#execution-clients) and a [consensus client](https://ethereum.org/en/developers/docs/nodes-and-clients/#consensus-clients). Geth is an [execution client](https://ethereum.org/en/developers/docs/nodes-and-clients/#execution-clients). Originally, an execution client alone was enough to run a full Ethereum node. However, ever since Ethereum turned off [proof-of-work](https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/) and implemented [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/), Geth has needed to be coupled to another piece of software called a [“consensus client”](https://ethereum.org/en/developers/docs/nodes-and-clients/#consensus-clients) in order to keep track of the Ethereum blockchain. 7 | 8 | The execution client (Geth) is responsible for transaction handling, transaction gossip, state management and supporting the Ethereum Virtual Machine [EVM](https://ethereum.org/en/developers/docs/evm/). However, Geth is **not** responsible for block building, block gossiping or handling consensus logic. These are in the remit of the consensus client. 9 | 10 | The relationship between the two Ethereum clients is shown in the schematic below. The two clients each connect to their own respective peer-to-peer (P2P) networks. This is because the execution clients gossip transactions over their P2P network enabling them to manage their local transaction pool. The consensus clients gossip blocks over their P2P network, enabling consensus and chain growth. 11 | 12 | ![node-architecture](/images/docs/node-architecture-text-background.png) 13 | 14 | For this two-client structure to work, consensus clients must be able to pass bundles of transactions to Geth to be executed. Executing the transactions locally is how the client validates that the transactions do not violate any Ethereum rules and that the proposed update to Ethereum’s state is correct. Likewise, when the node is selected to be a block producer the consensus client must be able to request bundles of transactions from Geth to include in the new block. This inter-client communication is handled by a local RPC connection using the [engine API](https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md). 15 | 16 | ## What does Geth do? {#what-does-geth-do} 17 | 18 | As an execution client, Geth is responsible for creating the execution payloads - the list of transactions, updated state trie plus other execution related data - that consensus clients include in their blocks. Geth is also responsible for re-executing transactions that arrive in new blocks to ensure they are valid. Executing transactions is done on Geth's embedded computer, known as the Ethereum Virtual Machine (EVM). 19 | 20 | Geth also offers a user-interface to Ethereum by exposing a set of [RPC methods](/docs/interacting-with-geth/rpc/) that enable users to query the Ethereum blockchain, submit transactions and deploy smart contracts. Often, the RPC calls are abstracted by a library such as [Web3js](https://web3js.readthedocs.io/en/v1.8.0/) or [Web3py](https://web3py.readthedocs.io/en/v5/) for example in Geth's built-in Javascript console, development frameworks or web-apps. 21 | 22 | ## What does the consensus client do? {#consensus-client} 23 | 24 | The consensus client deals with all the logic that enables a node to stay in sync with the Ethereum network. This includes receiving blocks from peers and running a fork choice algorithm to ensure the node always follows the chain with the greatest accumulation of attestations (weighted by validator effective balances). The consensus client has its own peer-to-peer network, separate from the network that connects execution clients to each other. The consensus clients share blocks and attestations over their peer-to-peer network. The consensus client itself does not participate in attesting to or proposing blocks - this is done by a validator which is an optional add-on to a consensus client. A consensus client without a validator only keeps up with the head of the chain, allowing the node to stay synced. This enables a user to transact with Ethereum using their execution client, confident that they are on the right chain. 25 | 26 | ## Validators {#validators} 27 | 28 | Validators can be added to consensus clients if 32 ETH have been sent to the deposit contract. The validator client comes bundled with the consensus client and can be added to a node at any time. The validator handles attestations and block proposals. They enable a node to accrue rewards or lose ETH via penalties or slashing. Running the validator software also makes a node eligible to be selected to propose a new block. 29 | 30 | Read more about [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/). 31 | -------------------------------------------------------------------------------- /docs/fundamentals/pruning.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Pruning 3 | description: Instructions for pruning a Geth node 4 | --- 5 | 6 | Offline pruning is only for the hash-based state scheme. Soon, we will have a path-based state scheme which enables the pruning by default. Once the hash-based state scheme is no longer supported, offline pruning will be deprecated. 7 | 8 | A snap-sync'd Geth node currently requires more than 650 GB of disk space to store the historic blockchain data. With default cache size the database grows by about 14 GB/week. This means that Geth users will rapidly run out of space on 1TB hard drives. To solve this problem without needing to purchase additional hardware, Geth can be pruned. Pruning is the process of erasing older data to save disk space. Since Geth `v1.10`, users have been able to trigger a snapshot offline prune to bring the total storage back down to the original ~650 GB in about 4-5 hours. This has to be done periodically to keep the total disk storage 9 | within the bounds of the local hardware (e.g. every month or so for a 1TB disk). 10 | 11 | To prune a Geth node at least 40 GB of free disk space is recommended. This means pruning cannot be used to save a hard drive that has been completely filled. A good rule of thumb is to prune before the node fills ~80% of the available disk space. 12 | 13 | ## Pruning rules {#pruning-rules} 14 | 15 | 1. Do not try to prune an archive node. Archive nodes need to maintain ALL historic data by definition. 16 | 2. Ensure there is at least 40 GB of storage space still available on the disk that will be pruned. Failures have been reported with ~25GB of free space. 17 | 3. Geth is at least `v1.10` ideally > `v1.10.3` 18 | 4. Geth is fully sync'd 19 | 5. Geth has finished creating a snapshot that is at least 128 blocks old. This is true when "state snapshot generation" is no longer reported in the logs. 20 | 21 | With these rules satisfied, Geth's database can be pruned. 22 | 23 | ## How pruning works {#how-pruning-works} 24 | 25 | Pruning uses snapshots of the state database as an indicator to determine which nodes in the state trie can be kept and which ones are stale and can be discarded. Geth identifies the target state trie based on a stored snapshot layer which has at least 128 block confirmations on top (for surviving reorgs) data that isn't part of the target state trie or genesis state. 26 | 27 | Geth prunes the database in three stages: 28 | 29 | 1. Iterating state snapshot: Geth iterates the bottom-most snapshot layer and constructs a bloom filter set for identifying the target trie nodes. 30 | 2. Pruning state data: Geth deletes stale trie nodes from the database which are not in the bloom filter set. 31 | 3. Compacting database: Geth tidies up the new database to reclaim free space. 32 | 33 | There may be a period of >1 hour during the Compacting Database stage with no log messages at all. This is normal, and the pruning should be left to run until finally a log message containing the phrase `State pruning successful` appears (i.e. do not restart Geth yet!). That message indicates that the pruning is complete and Geth can be started. 34 | 35 | ## Pruning command {#pruning-command} 36 | 37 | For a normal Geth node, Geth should be stopped and the following command executed to start a offline state prune: 38 | 39 | ```sh 40 | geth snapshot prune-state 41 | ``` 42 | 43 | For a Geth node run using `systemd`: 44 | 45 | ```sh 46 | sudo systemctl stop geth # stop geth, wait >3mins to ensure clean shutdown 47 | tmux # tmux enables pruning to keep running even if you disconnect 48 | sudo -u geth --datadir snapshot prune-state # wait for pruning to finish 49 | sudo systemctl start geth # restart geth 50 | ``` 51 | 52 | The pruning could take 4-5 hours to complete. Once finished, restart Geth. 53 | 54 | ## Troubleshooting {#troubleshooting} 55 | 56 | Messages about "state snapshot generation" indicate that a snapshot is not fully generated. This suggests either the `--datadir` is not correct or Geth ran out of time to complete the snapshot generation and the pruning began before the snapshot was completed. In either case, the best course of action is to stop Geth, run it normally again (no pruning) until the snapshot is definitely complete and at least 128 blocks exist on top of it, then try pruning again. 57 | 58 | ## Further Reading {#further-reading} 59 | 60 | [Ethereum Foundation blog post for Geth v1.10.0](https://blog.ethereum.org/2021/03/03/geth-v1-10-0/) 61 | 62 | [Pruning Geth guide (@yorickdowne)](https://gist.github.com/yorickdowne/3323759b4cbf2022e191ab058a4276b2) 63 | 64 | [Pruning Geth in a RocketPool node](https://docs.rocketpool.net/guides/node/geth-pruning.html) 65 | -------------------------------------------------------------------------------- /docs/fundamentals/security.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Security 3 | description: A primer on Geth security best practice. 4 | --- 5 | 6 | ## Downloading Geth {#downloading-geth} 7 | 8 | Download Geth using the links on the [Downloads](/downloads) page. The SHA256 hashes of the downloaded files can be used to confirm precise consistency with our releases. This protects against malicious code being inadvertently downloaded from an adversarial source. The same measures should also be taken to download trusted consensus client software. 9 | 10 | ## Networking security {#networking-security} 11 | 12 | The local machine's firewall settings should: 13 | 14 | - Block all traffic to `8545`, or whatever custom port has been defined for JSON-RPC requests to the node, except for traffic from explicitly defined trusted machines. 15 | - Allow traffic on `TCP 30303` or whichever custom port has been defined for peer-to-peer communications. This allows the node to connect to peers. 16 | - Allow traffic on `UDP 30303` or whichever custom port has been defined for peer-to-peer communications. This allows node discovery. 17 | 18 | ## Account security {#account-security} 19 | 20 | Account security comes down to keeping private keys and account passwords backed up and inaccessible to adversaries. This is something that users take responsibility for. Geth provides an encrypted store for keys that are unlocked using an account password. If the key files or the passwors are lost, the account is impossible to access and the funds are effectively lost forever. If access to the unencrypted keys is obtained by an adversary they gain control of any funds associated with the account. 21 | 22 | Geth has built-in account management tools. However, Clef is recommended as an external account management and signing tool. It can be run decoupled from Geth and can even be run on dedicated secure external hardware such as a VM or a secure USB drive. This is considered best practise because the user is required to manually review all actions that touch sensitive data, except where specific predefined rules are implemented. Signing is done locally to Clef rather than giving key access to a node. Geth's built-in management tools are intended to be deprecated in the near future. 23 | 24 | **Back up your keystore and passwords safely and securely!** 25 | 26 | ## Other security considerations {#other-security} 27 | 28 | Even with a perfectly secure node, users can still be manipulated by attackers into exposing security weaknesses or inadvertently interact with insecure smart contracts. For an overview, please see the Ethereum [security best practice webpage](https://ethereum.org/en/security) and this introduction to [smart contract security](https://ethereum.org/en/developers/docs/smart-contracts/security). 29 | -------------------------------------------------------------------------------- /docs/getting-started/hardware-requirements.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Hardware requirements 3 | description: Overview of the hardware needed to run an Ethereum node 4 | --- 5 | 6 | The hardware requirements for running a Geth node depend upon the node configuration and can change over time as upgrades to the network are implemented. Ethereum nodes can be run on low power, resource-constrained devices such as Raspberry Pi's. Prebuilt, dedicated staking machines are available from several companies - these might be good choices for users who want plug-and-play hardware specifically designed for Ethereum. However, many users will choose to run nodes on laptop or desktop computers. 7 | 8 | ## Processor {#processor} 9 | 10 | It is preferable to use a quad-core (or dual-core hyperthreaded) CPU. Geth is released for a wide range of architectures. 11 | 12 | ## Memory {#memory} 13 | 14 | It is recommended to use at least 16GB RAM. 15 | 16 | ## Disk space {#disk-space} 17 | 18 | Disk space is usually the primary bottleneck for node operators. At the time of writing (September 2022) a 2TB SSD is recommended for a full node running Geth and a consensus client. Geth itself requires >650GB of disk space for a snap-synced full node and, with the default cache size, grows about 14GB/week. Pruning brings the total storage back down to the original 650GB. 19 | Archive nodes require additional space. A "full" archive node that keeps all state back to genesis requires more than 12TB of space. Partial archive nodes can also be created by turning off the garbage collector after some initial sync - the storage requirement depends how much state is saved. 20 | 21 | As well as storage capacity, Geth nodes rely on fast read and write operations. This means HDDs and cheaper HDDS can sometimes struggle to sync the blockchain. A list of SSD models that users report being able and unable to sync Geth is available in this [GitHub Gist](https://gist.github.com/yorickdowne/f3a3e79a573bf35767cd002cc977b038). Please note that the list has _not_ been verified by the Geth team. 22 | 23 | ## Bandwidth {#bandwidth} 24 | 25 | It is important to have a stable and reliable internet connection, especially for running a validator because downtime can result in missed rewards or penalties. It is recommended to have at least 25Mbps download speed to run a node. Running a node also requires a lot of data to be uploaded and downloaded so it is better to use an ISP that does not have a capped data allowance. 26 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Welcome to go-ethereum 3 | description: Documentation for the go-ethereum client 4 | --- 5 | 6 | Go-ethereum (aka Geth) is an Ethereum client built in [Go](https://go.dev). It is one of the original and most popular Ethereum clients. 7 | These documentation pages are intended to help users download, install and use Geth. 8 | 9 | ## Where to go from here {#where-to-go} 10 | 11 | First, make sure you have sufficient [hardware](/docs/getting-started/hardware-requirements), then [download](/downloads) and [install](/docs/getting-started/installing-geth) Geth. Make sure you are familiar with the [security considerations](/docs/fundamentals/security) and have your firewall set up. 12 | 13 | If you are just starting out with Geth, head to the [Getting started](/docs/getting-started/) page. That page guides new users through some basic functions of Geth such as creating and securing accounts and making a transaction. 14 | 15 | Then, it is recommended to read the material in the [Fundamentals](/docs/fundamentals) section - these pages will help build a foundational understanding of how Geth works from a user perspective and under the hood. 16 | 17 | More advanced topics are also available - explore them using the sidebar! 18 | 19 | ## Developers and contributors {#developers-and-contributors} 20 | 21 | If you want to help develop Geth or build decentralized apps on top of it, head to our [Developer](/docs/developers) documentation. 22 | 23 | ## More resources {#more-resources} 24 | 25 | We have a library of videos and articles on our [Resources](/docs/resources) page and answers to common questions on the [FAQs](/docs/faq) page. 26 | -------------------------------------------------------------------------------- /docs/interacting-with-geth/rpc/batch.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Batch requests 3 | description: How to make batch requests using JSON-RPC API 4 | --- 5 | 6 | The JSON-RPC [specification](https://www.jsonrpc.org/specification#batch) outlines how clients can send multiple requests at the same time by filling the request objects in an array. This feature is implemented by Geth's API and can be used to cut network delays. Batching offers visible speed-ups specially when used for fetching larger amounts of mostly independent data objects. Below is an example for fetching a list of blocks in JS: 7 | 8 | ```js 9 | import fetch from 'node-fetch'; 10 | 11 | async function main() { 12 | const endpoint = 'http://127.0.0.1:8545'; 13 | const from = parseInt(process.argv[2]); 14 | const to = parseInt(process.argv[3]); 15 | 16 | const reqs = []; 17 | for (let i = from; i < to; i++) { 18 | reqs.push({ 19 | method: 'eth_getBlockByNumber', 20 | params: [`0x${i.toString(16)}`, false], 21 | id: i - from, 22 | jsonrpc: '2.0' 23 | }); 24 | } 25 | 26 | const res = await fetch(endpoint, { 27 | method: 'POST', 28 | body: JSON.stringify(reqs), 29 | headers: { 'Content-Type': 'application/json' } 30 | }); 31 | const data = await res.json(); 32 | } 33 | 34 | main() 35 | .then() 36 | .catch(err => console.log(err)); 37 | ``` 38 | 39 | In this case there's no dependency between the requests. Often the retrieved data from one request is needed to issue a second one. Let's take the example of fetching all the receipts for a range of blocks. The JSON-RPC API provides `eth_getTransactionReceipt` which takes in a transaction hash and returns the corresponding receipt object, but no method to fetch receipt objects for a whole block. We need to get the list of transactions in a block, and then call `eth_getTransactionReceipt` for each of them. We can break this into 2 batch requests: 40 | 41 | - First to download the list of transaction hashes for all of the blocks in our desired range 42 | - And then to download the list of receipts objects for all of the transaction hashes 43 | 44 | For use-cases which depend on several JSON-RPC endpoints the batching approach can get easily complicated. In that case Geth offers a [GraphQL API](/docs/interacting-with-geth/rpc/graphql) which is more suitable. 45 | -------------------------------------------------------------------------------- /docs/interacting-with-geth/rpc/graphql.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: GraphQL Server 3 | description: Documentation for Geth's GraphQL API 4 | --- 5 | 6 | In addition to the [JSON-RPC APIs](/docs/interacting-with-geth/rpc/), Geth supports the GraphQL API as specified by [EIP-1767](https://eips.ethereum.org/EIPS/eip-1767). GraphQL lets you specify which fields of an objects you need as part of the query, eliminating the extra load on the client for filling in fields which are not needed. It also allows for combining several traditional JSON-RPC requests into one query which translates into less overhead and more performance. 7 | 8 | The GraphQL endpoint piggybacks on the HTTP transport used by JSON-RPC. Hence the relevant `--http` flags and the `--graphql` flag should be passed to Geth: 9 | 10 | ```sh 11 | geth --http --graphql 12 | ``` 13 | 14 | Now queries can be raised against `http://localhost:8545/graphql`. To change the port, provide a custom port number to `--http.port`, e.g.: 15 | 16 | ```sh 17 | geth --http --http.port 9545 --graphql 18 | ``` 19 | 20 | ## GraphiQL {#graphiql} 21 | 22 | An easy way to try out queries is the GraphiQL interface shipped with Geth. To open it visit `http://localhost:8545/graphql/ui`. To see how this works let's read the sender, recipient and value of all transactions in block number 6000000. In GraphiQL: 23 | 24 | ```graphql 25 | query txInfo { 26 | block(number: 6000000) { 27 | transactions { 28 | hash 29 | from { 30 | address 31 | } 32 | to { 33 | address 34 | } 35 | value 36 | } 37 | } 38 | } 39 | ``` 40 | 41 | GraphiQL also provides a way to explore the schema Geth provides to help you formulate your queries, which you can see on the right sidebar. Under the title `Root Types` click on `Query` to see the high-level types and their fields. 42 | 43 | ## Query {#query} 44 | 45 | Reading out data from Geth is the biggest use-case for GraphQL. In addition to using the UI queries can also be sent programmatically. The official GraphQL[docs](https://graphql.org/code/) explain how to find bindings for many languages, or send http requests from the terminal using tools such as Curl. 46 | 47 | For example, the code snippet below shows how to obtain the latest block number using Curl. Note the use of a JSON object for the data section: 48 | 49 | ```sh 50 | ❯ curl -X POST http://localhost:8545/graphql -H "Content-Type: application/json" --data '{ "query": "query { block { number } }" }' 51 | {"data":{"block":{"number":6004069}}} 52 | ``` 53 | 54 | Alternatively store the JSON-ified query in a file (let's call it `block-num.query`) and do: 55 | 56 | ```sh 57 | ❯ curl -X POST http://localhost:8545/graphql -H "Content-Type: application/json" --data '@block-num.query' 58 | ``` 59 | 60 | Executing a simple query in JS looks as follows. Here the lightweight library `graphql-request` is used to perform the request. Note the use of variables instead of hardcoding the block number in the query: 61 | 62 | ```js 63 | const { request, gql } = require('graphql-request'); 64 | 65 | const query = gql` 66 | query blockInfo($number: Long) { 67 | block(number: $number) { 68 | hash 69 | stateRoot 70 | } 71 | } 72 | `; 73 | request('http://localhost:8545/graphql', query, { number: '6004067' }) 74 | .then(res => { 75 | console.log(res); 76 | }) 77 | .catch(err => { 78 | console.log(err); 79 | }); 80 | ``` 81 | -------------------------------------------------------------------------------- /docs/interacting-with-geth/rpc/ns-clique.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: clique Namespace 3 | description: Documentation for the JSON-RPC API "clique" namespace 4 | --- 5 | 6 | The `clique` API provides access to the state of the clique consensus engine. This API cna be used to manage signer votes and to check the health of a private network. 7 | 8 | ## clique_getSnapshot {#clique-getsnapshot} 9 | 10 | Retrieves a snapshot of all clique state at a given block. 11 | 12 | | Client | Method invocation | 13 | | :------ | ----------------------------------------------------------- | 14 | | Console | `clique.getSnapshot(blockNumber)` | 15 | | RPC | `{"method": "clique_getSnapshot", "params": [blockNumber]}` | 16 | 17 | Example: 18 | 19 | ```js 20 | > clique.getSnapshot(5463755) 21 | { 22 | hash: "0x018194fc50ca62d973e2f85cffef1e6811278ffd2040a4460537f8dbec3d5efc", 23 | number: 5463755, 24 | recents: { 25 | 5463752: "0x42eb768f2244c8811c63729a21a3569731535f06", 26 | 5463753: "0x6635f83421bf059cd8111f180f0727128685bae4", 27 | 5463754: "0x7ffc57839b00206d1ad20c69a1981b489f772031", 28 | 5463755: "0xb279182d99e65703f0076e4812653aab85fca0f0" 29 | }, 30 | signers: { 31 | 0x42eb768f2244c8811c63729a21a3569731535f06: {}, 32 | 0x6635f83421bf059cd8111f180f0727128685bae4: {}, 33 | 0x7ffc57839b00206d1ad20c69a1981b489f772031: {}, 34 | 0xb279182d99e65703f0076e4812653aab85fca0f0: {}, 35 | 0xd6ae8250b8348c94847280928c79fb3b63ca453e: {}, 36 | 0xda35dee8eddeaa556e4c26268463e26fb91ff74f: {}, 37 | 0xfc18cbc391de84dbd87db83b20935d3e89f5dd91: {} 38 | }, 39 | tally: {}, 40 | votes: [] 41 | } 42 | ``` 43 | 44 | ## clique_getSnapshotAtHash {#clique-getsnapshotathash} 45 | 46 | Retrieves the state snapshot at a given block. 47 | 48 | | Client | Method invocation | 49 | | :------ | --------------------------------------------------------------- | 50 | | Console | `clique.getSnapshotAtHash(blockHash)` | 51 | | RPC | `{"method": "clique_getSnapshotAtHash", "params": [blockHash]}` | 52 | 53 | ## clique_getSigner {#clique-getsigner} 54 | 55 | Returns the signer for a specific clique block. Can be called with either a blocknumber, blockhash or an rlp encoded blob. The RLP encoded blob can either be a block or a header. 56 | 57 | | Client | Method invocation | 58 | | :------ | ---------------------------------------------------- | 59 | | Console | `clique.getSigner(blockNrOrHashOrRlp)` | 60 | | RPC | `{"method": "clique_getSigner", "params": [string]}` | 61 | 62 | ## clique_getSigners {#clique-getsigners} 63 | 64 | Retrieves the list of authorized signers at the specified block number. 65 | 66 | | Client | Method invocation | 67 | | :------ | ---------------------------------------------------------- | 68 | | Console | `clique.getSigners(blockNumber)` | 69 | | RPC | `{"method": "clique_getSigners", "params": [blockNumber]}` | 70 | 71 | ## clique_getSignersAtHash {#clique-getsignersathash} 72 | 73 | Retrieves the list of authorized signers at the specified block hash. 74 | 75 | | Client | Method invocation | 76 | | :------ | ----------------------------------------------------------- | 77 | | Console | `clique.getSignersAtHash(blockHash)` | 78 | | RPC | `{"method": "clique_getSignersAtHash", "params": [string]}` | 79 | 80 | ## clique_proposals {#clique-proposals} 81 | 82 | Returns the current proposals the node is voting on. 83 | 84 | | Client | Method invocation | 85 | | :------ | ---------------------------------------------- | 86 | | Console | `clique.proposals()` | 87 | | RPC | `{"method": "clique_proposals", "params": []}` | 88 | 89 | ## clique_propose {#clique-propose} 90 | 91 | Adds a new authorization proposal that the signer will attempt to push through. If the `auth` parameter is true, the local signer votes for the given address to be included in the set of authorized signers. With `auth` set to `false`, the vote is against the address. 92 | 93 | | Client | Method invocation | 94 | | :------ | --------------------------------------------------------- | 95 | | Console | `clique.propose(address, auth)` | 96 | | RPC | `{"method": "clique_propose", "params": [address, auth]}` | 97 | 98 | ## clique_discard {#clique-discard} 99 | 100 | This method drops a currently running proposal. The signer will not cast further votes (either for or against) the address. 101 | 102 | | Client | Method invocation | 103 | | :------ | --------------------------------------------------- | 104 | | Console | `clique.discard(address)` | 105 | | RPC | `{"method": "clique_discard", "params": [address]}` | 106 | 107 | ## clique_status {#clique-status} 108 | 109 | This is a debugging method which returns statistics about signer activity for the last 64 blocks. The returned object contains the following fields: 110 | 111 | - `inturnPercent`: percentage of blocks signed in-turn 112 | - `sealerActivity`: object containing signer addresses and the number 113 | of blocks signed by them 114 | - `numBlocks`: number of blocks analyzed 115 | 116 | | Client | Method invocation | 117 | | :------ | ------------------------------------------- | 118 | | Console | `clique.status()` | 119 | | RPC | `{"method": "clique_status", "params": []}` | 120 | 121 | Example: 122 | 123 | ```js 124 | > clique.status() 125 | { 126 | inturnPercent: 100, 127 | numBlocks: 64, 128 | sealerActivity: { 129 | 0x42eb768f2244c8811c63729a21a3569731535f06: 9, 130 | 0x6635f83421bf059cd8111f180f0727128685bae4: 9, 131 | 0x7ffc57839b00206d1ad20c69a1981b489f772031: 9, 132 | 0xb279182d99e65703f0076e4812653aab85fca0f0: 10, 133 | 0xd6ae8250b8348c94847280928c79fb3b63ca453e: 9, 134 | 0xda35dee8eddeaa556e4c26268463e26fb91ff74f: 9, 135 | 0xfc18cbc391de84dbd87db83b20935d3e89f5dd91: 9 136 | } 137 | } 138 | ``` 139 | -------------------------------------------------------------------------------- /docs/interacting-with-geth/rpc/ns-miner.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: miner Namespace 3 | description: Documentation for the JSON-RPC API "miner" namespace 4 | --- 5 | 6 | The `miner` API is **now deprecated** because mining was switched off at the transition to proof-of-stake. It existed to provide remote control the node's mining operation and set various mining specific settings. It is provided here for historical interest! 7 | 8 | ## miner_getHashrate {#miner-hashrate} 9 | 10 | Get hashrate in H/s (Hash operations per second). 11 | 12 | | Client | Method invocation | 13 | | :------ | ----------------------------------------------- | 14 | | Console | `miner.getHashrate()` | 15 | | RPC | `{"method": "miner_getHashrate", "params": []}` | 16 | 17 | ## miner_setExtra {#miner-setextra} 18 | 19 | Sets the extra data a miner can include when miner blocks. This is capped at 32 bytes. 20 | 21 | | Client | Method invocation | 22 | | :------ | -------------------------------------------------- | 23 | | Go | `miner.setExtra(extra string) (bool, error)` | 24 | | Console | `miner.setExtra(string)` | 25 | | RPC | `{"method": "miner_setExtra", "params": [string]}` | 26 | 27 | ## miner_setGasPrice {#miner-setgasprice} 28 | 29 | Sets the minimal accepted gas price when mining transactions. Any transactions that are below this limit are excluded from the mining process. 30 | 31 | | Client | Method invocation | 32 | | :------ | ----------------------------------------------------- | 33 | | Go | `miner.setGasPrice(number *rpc.HexNumber) bool` | 34 | | Console | `miner.setGasPrice(number)` | 35 | | RPC | `{"method": "miner_setGasPrice", "params": [number]}` | 36 | 37 | ## miner_setRecommitInterval {#miner-setrecommitinterval} 38 | 39 | Updates the interval for recomitting the miner sealing work. 40 | 41 | | Client | Method invocation | 42 | | :------ | ------------------------------------------------------------- | 43 | | Console | `miner.setRecommitInterval(interval int)` | 44 | | RPC | `{"method": "miner_setRecommitInterval", "params": [number]}` | 45 | 46 | ## miner_start {#miner-start} 47 | 48 | Start the CPU mining process with the given number of threads and generate a new DAG if need be. 49 | 50 | | Client | Method invocation | 51 | | :------ | --------------------------------------------------- | 52 | | Go | `miner.Start(threads *rpc.HexNumber) (bool, error)` | 53 | | Console | `miner.start(number)` | 54 | | RPC | `{"method": "miner_start", "params": [number]}` | 55 | 56 | ## miner_stop {#miner-stop} 57 | 58 | Stop the CPU mining operation. 59 | 60 | | Client | Method invocation | 61 | | :------ | ---------------------------------------- | 62 | | Go | `miner.Stop() bool` | 63 | | Console | `miner.stop()` | 64 | | RPC | `{"method": "miner_stop", "params": []}` | 65 | 66 | ## miner_setEtherbase {#miner-setetherbase} 67 | 68 | Sets the etherbase, where mining rewards will go. 69 | 70 | | Client | Method invocation | 71 | | :------ | ------------------------------------------------------- | 72 | | Go | `miner.SetEtherbase(common.Address) bool` | 73 | | Console | `miner.setEtherbase(address)` | 74 | | RPC | `{"method": "miner_setEtherbase", "params": [address]}` | 75 | 76 | ## miner_setGasLimit {#miner-setgaslimit} 77 | 78 | Sets the gas limit the miner will target when mining. Note: on networks where EIP-1559 is activated, this should be set to twice the gas target (i.e. the effective gas used on average per block) to be. 79 | 80 | | Client | Method invocation | 81 | | :------ | ----------------------------------------------------- | 82 | | Go | `miner.SetGasLimit(number *rpc.HexNumber) bool` | 83 | | Console | `miner.SetGasLimit(number)` | 84 | | RPC | `{"method": "miner_setGasLimit", "params": [number]}` | 85 | -------------------------------------------------------------------------------- /docs/interacting-with-geth/rpc/ns-net.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: net Namespace 3 | description: Documentation for the JSON-RPC API "net" namespace 4 | --- 5 | 6 | The `net` API provides insight about the networking aspect of the client. 7 | 8 | ## net_listening {#net-listening} 9 | 10 | Returns an indication if the node is listening for network connections. 11 | 12 | | Client | Method invocation | 13 | | :------ | ----------------------------- | 14 | | Console | `net.listening` | 15 | | RPC | `{"method": "net_listening"}` | 16 | 17 | ## net_peerCount {#net-peercount} 18 | 19 | Returns the number of connected peers. 20 | 21 | | Client | Method invocation | 22 | | :------ | ----------------------------- | 23 | | Console | `net.peerCount` | 24 | | RPC | `{"method": "net_peerCount"}` | 25 | 26 | ## net_version {#net-version} 27 | 28 | Returns the devp2p network ID (e.g. 1 for mainnet, 5 for goerli). 29 | 30 | | Client | Method invocation | 31 | | :------ | --------------------------- | 32 | | Console | `net.version` | 33 | | RPC | `{"method": "net_version"}` | 34 | -------------------------------------------------------------------------------- /docs/monitoring/ethstats.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Monitoring with Ethstats 3 | description: Setting up an Ethstats server 4 | --- 5 | 6 | Ethstats is a service that displays real time and historical statistics about individual 7 | nodes connected to a network and about the network itself. Individual node statistics include 8 | the last received block, block time, propagation time, connected peers, latency etc. Network 9 | metrics include the number of nodes, average block times, node geolocation, 10 | transaction counts etc. 11 | 12 | These statistics are presented to the user in the form of a dashboard served to a web browser. 13 | This can be configured using the public Ethstats server for Ethereum mainnet or some 14 | public testnets, or using a local copy of Ethstats for private networks. This page will 15 | demonstrate how to set up an Ethstats dashboard for private and public networks. 16 | 17 | ## Prerequisites {#prerequisites} 18 | 19 | To follow the instructions on this page the following are required: 20 | 21 | - Geth 22 | - Node 23 | - NPM 24 | - Git 25 | 26 | ## Ethstats {#ethstats} 27 | 28 | Ethstats has three components: 29 | 30 | - a server that consumes data sent to it by each individual node on a network and serves 31 | statistics generated from that data. 32 | 33 | - a client that queries a node and sends its data to the server 34 | 35 | - a dashboard that displays the statistics generated by the server 36 | 37 | The summary dashboard for Ethereum Mainnet can be viewed at [ethstats.net](https://ethstats.net/). 38 | 39 | ![Ethstats](/images/docs/ethstats-mainnet.png) 40 | 41 | Note that the Ethstats dashboard is not a reliable source of information about the entire Ethereum 42 | network because submitting data to the Ethstats server is voluntary and has to be configured by 43 | individual nodes. Therefore, many nodes are omitted from the summary statistics. 44 | 45 | ## How to use {#how-to-use} 46 | 47 | To report statistics about the local node to Ethstats, an Ethstats server and Ethstats client both have 48 | to be installed alongside Geth. There are several options for installing Ethstats clients and servers, 49 | each with detailed installation instructions. They all share the common trait that an Ethstats service is 50 | started with a specific URL that can be passed to Geth. 51 | 52 | [EthNetStats "Classic"](https://github.com/ethereum/eth-netstats) 53 | 54 | [EthNet Intelligence API](https://github.com/ethereum/eth-net-intelligence-api) 55 | 56 | [Goerli Ethstats client](https://github.com/goerli/ethstats-client) 57 | 58 | [Goerli Ethstats server](https://github.com/goerli/ethstats-server) 59 | 60 | If enabled, Geth spins up a minimal Ethstats reporting daemon that pushes statistics about the 61 | local node to the Ethstats server. 62 | 63 | To enable this, start Geth with the `ethstats` flag, passing the Ethstats service (nodename:secret@host:port) URL. 64 | 65 | ```sh 66 | geth --ethstats node1:secret:127.0.0.1:9000 67 | ``` 68 | 69 | The local node will then report to Ethstats, and the statistics will be displayed in a dashboard that can be 70 | accessed via the web browser. 71 | 72 | ## Note on WS_secret {#note-on-ws-secret} 73 | 74 | The `WS_secret` parameter is required for connecting to an Ethstats server. For a local network this can be user-defined 75 | on startup by providing it as an environment variable. However, for Ethereum mainnet and the public testnets predefined 76 | values must be known. Historically these have been made available on Gitter and Skype channels or of a forum, but these are 77 | no longer in use. The user will have to track down existing Ethstats users to request the `WS_secret`. 78 | -------------------------------------------------------------------------------- /docs/resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Resources 3 | description: Read, watch and listen more about Geth and Ethereum 4 | --- 5 | 6 | Here are more resources for a deeper understanding of Geth and related topics. 7 | 8 | ## Read {#read} 9 | 10 | [Geth team AMA: August 2022](https://www.reddit.com/r/cryptoall/comments/wpr6dk/ama_we_are_the_go_ethereum_geth_team_18_august/) 11 | 12 | [Ethereum stack exchange](https://ethereum.stackexchange.com/) 13 | 14 | ## Watch {#watch} 15 | 16 | [Geth team AMA at Devcon 6, Bogota](https://youtu.be/Wr_SHOmz4lc?t=10714) 17 | 18 | [Sina's EVM tracing workshop at Devcon 6, Bogota](https://youtu.be/b8RdmGsilfU) 19 | 20 | [Péter at ETH Prage 2022: Ethereum in numbers: where TPS meets physics](https://www.youtube.com/watch?v=TdsaVoJiy3g) 21 | 22 | [Marius at ETH Amsterdam 2022: Deep dive into Geth](https://www.youtube.com/watch?v=c4N79UXZqSc) 23 | 24 | [Péter interview at ETH Prage 2022:](https://www.youtube.com/watch?v=cfxGzZZ_uOI) 25 | 26 | [Guillame at Devconnect 2022: Stateless Ethereum](https://www.youtube.com/watch?v=XkzJncPYj0M&list=PLJijNYoOwnsuqDH9ITSvbqDOaUdA1vp2O&index=9) 27 | 28 | [lightclients at Devconnect 2022: Future of Ethereum accounts](https://www.youtube.com/watch?v=pS5asEp6ry8&list=PLJijNYoOwnsuqDH9ITSvbqDOaUdA1vp2O&index=7) 29 | 30 | [Zsolt at Devconnect 2022: Geth in the pos light client ecosystem](https://www.youtube.com/watch?v=EPZeFXau-RE&list=PLJijNYoOwnst-feT7PsCLaSdiFYzWtf7j&index=2) 31 | 32 | [Jared at Devconnect 2022: Removing SELFDESTRUCT](https://www.youtube.com/watch?v=pDr-h334-Cs&list=PLJijNYoOwnsuqDH9ITSvbqDOaUdA1vp2O&index=5) 33 | 34 | [Marius interview at ETH Prague 2022](https://www.youtube.com/watch?v=QKr3KHTjbjQ) 35 | 36 | [Marius at ETHOnline 2021: The Megre from the perspective of the execution layer](https://www.youtube.com/watch?v=3DDjfUvQ2TE) 37 | 38 | [Péter's 2020 online Geth AMA](https://www.youtube.com/watch?v=gVMDw66atr4) 39 | 40 | [Martin at Devcon 5: Protecting the base layer](https://www.youtube.com/watch?v=wLcyIgblIxE) 41 | 42 | [Péter at DevCon 5: Monitoring Ethereum infrastructure](https://www.youtube.com/watch?v=2I_Cfr-OUp4) 43 | 44 | [Péter at DevCon 4: Plugging metadata leaks in Ethereum](https://www.youtube.com/watch?v=J1JenTo7oLE) 45 | 46 | [Péter at DevCon 2: Import Geth in Go](https://www.youtube.com/watch?v=R0Ia1U9Gxjg) 47 | 48 | [Péter at dotGo 2016: Immutability in Go](https://www.youtube.com/watch?v=fNUx4jHTaIc) 49 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | # https://docs.netlify.com/integrations/frameworks/next-js/incremental-static-regeneration/ 2 | 3 | [functions] 4 | included_files = ["src/**"] 5 | 6 | [[headers]] 7 | for = "/*" 8 | [headers.values] 9 | Access-Control-Allow-Origin = "https://matomo.ethereum.org" 10 | -------------------------------------------------------------------------------- /next-sitemap.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next-sitemap').IConfig} */ 2 | 3 | module.exports = { 4 | siteUrl: 'https://geth.ethereum.org', 5 | generateRobotsTxt: true 6 | }; 7 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const { redirects: redirectsList } = require('./redirects'); 3 | 4 | module.exports = { 5 | reactStrictMode: true, 6 | swcMinify: true, 7 | // Append the default value with md extensions 8 | pageExtensions: ['ts', 'tsx', 'md'], 9 | async redirects() { 10 | return redirectsList; 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "geth-site", 3 | "private": false, 4 | "description": "The website for geth.ethereum.org", 5 | "version": "2.0.0", 6 | "author": "Nicolás Quiroz ", 7 | "scripts": { 8 | "dev": "next dev", 9 | "build": "npm run lint && next build && npm run format:fix", 10 | "postbuild": "next-sitemap", 11 | "start": "next start", 12 | "lint": "next lint", 13 | "format:fix": "prettier . --write --config .prettierrc --ignore-path .prettierignore --loglevel warn" 14 | }, 15 | "dependencies": { 16 | "@chakra-ui/icons": "^2.0.11", 17 | "@chakra-ui/react": "^2.3.2", 18 | "@docsearch/react": "3", 19 | "@emotion/react": "^11.10.4", 20 | "@emotion/styled": "^11.10.4", 21 | "@socialgouv/matomo-next": "^1.4.0", 22 | "algoliasearch": "^4.14.2", 23 | "chakra-ui-markdown-renderer": "^4.1.0", 24 | "fast-xml-parser": "^4.0.12", 25 | "focus-visible": "^5.2.0", 26 | "framer-motion": "^7.3.2", 27 | "gray-matter": "^4.0.3", 28 | "js-yaml": "^4.1.0", 29 | "next": "^13.0.2", 30 | "next-sitemap": "^3.1.32", 31 | "react": "18.2.0", 32 | "react-dom": "18.2.0", 33 | "react-markdown": "^8.0.3", 34 | "react-syntax-highlighter": "^15.5.0", 35 | "rehype-raw": "^6.1.1", 36 | "remark-gfm": "^3.0.1" 37 | }, 38 | "devDependencies": { 39 | "@types/js-yaml": "^4.0.5", 40 | "@types/node": "18.7.16", 41 | "@types/react": "18.0.18", 42 | "@types/react-dom": "18.0.6", 43 | "@types/react-syntax-highlighter": "^15.5.5", 44 | "eslint": "8.23.0", 45 | "eslint-config-next": "12.2.5", 46 | "eslint-config-prettier": "^8.5.0", 47 | "prettier": "^2.7.1", 48 | "typescript": "4.8.2" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /public/code/qubes-client.py: -------------------------------------------------------------------------------- 1 | """ 2 | This implements a dispatcher which listens to localhost:8550, and proxies 3 | requests via qrexec to the service qubes.EthSign on a target domain 4 | """ 5 | 6 | import http.server 7 | import socketserver,subprocess 8 | 9 | PORT=8550 10 | TARGET_DOMAIN= 'debian-work' 11 | 12 | class Dispatcher(http.server.BaseHTTPRequestHandler): 13 | def do_POST(self): 14 | post_data = self.rfile.read(int(self.headers['Content-Length'])) 15 | p = subprocess.Popen(['/usr/bin/qrexec-client-vm',TARGET_DOMAIN,'qubes.Clefsign'],stdin=subprocess.PIPE, stdout=subprocess.PIPE) 16 | output = p.communicate(post_data)[0] 17 | self.wfile.write(output) 18 | 19 | 20 | with socketserver.TCPServer(("",PORT), Dispatcher) as httpd: 21 | print("Serving at port", PORT) 22 | httpd.serve_forever() 23 | 24 | -------------------------------------------------------------------------------- /public/code/qubes.Clefsign: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SIGNER_BIN="/home/user/tools/clef/clef" 4 | SIGNER_CMD="/home/user/tools/gtksigner/gtkui.py -s $SIGNER_BIN" 5 | 6 | # Start clef if not already started 7 | if [ ! -S /home/user/.clef/clef.ipc ]; then 8 | $SIGNER_CMD & 9 | sleep 1 10 | fi 11 | 12 | # Should be started by now 13 | if [ -S /home/user/.clef/clef.ipc ]; then 14 | # Post incoming request to HTTP channel 15 | curl -H "Content-Type: application/json" -X POST -d @- http://localhost:8550 2>/dev/null 16 | fi 17 | -------------------------------------------------------------------------------- /public/docs/vulnerabilities/vulnerabilities.json.minisig: -------------------------------------------------------------------------------- 1 | untrusted comment: signature from minisign secret key 2 | RWQk7Lo5TQgd+9DjD2nXoabMy0BkWSuMiePPOQ9rXlwzvjhRGzEtwPDK3YupbRT9/OmyykFLGHCzWTRKVtVfYqFHL07m0DOOnww= 3 | trusted comment: timestamp:1652258428 file:vulnerabilities.json 4 | jtud9mtIiBRWA+krlBf1WCHgRzkcuzeoe9YLjLfHLEUQosbs+Ru1oaxx+nhxmjKdSRFwhPy1yoV5j9+rw55yCg== 5 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/favicon.ico -------------------------------------------------------------------------------- /public/images/docs/clef_qubes_http.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/clef_qubes_http.png -------------------------------------------------------------------------------- /public/images/docs/clef_qubes_qrexec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/clef_qubes_qrexec.png -------------------------------------------------------------------------------- /public/images/docs/clef_ruleset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/clef_ruleset.png -------------------------------------------------------------------------------- /public/images/docs/clef_sign_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/clef_sign_flow.png -------------------------------------------------------------------------------- /public/images/docs/devcon2_labelled.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/devcon2_labelled.webp -------------------------------------------------------------------------------- /public/images/docs/ethstats-mainnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/ethstats-mainnet.png -------------------------------------------------------------------------------- /public/images/docs/grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/grafana.png -------------------------------------------------------------------------------- /public/images/docs/node-architecture-text-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/node-architecture-text-background.png -------------------------------------------------------------------------------- /public/images/docs/node_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/node_architecture.png -------------------------------------------------------------------------------- /public/images/docs/node_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/node_basic.png -------------------------------------------------------------------------------- /public/images/docs/qrexec-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/qrexec-example.png -------------------------------------------------------------------------------- /public/images/docs/qubes_newaccount-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/qubes_newaccount-1.png -------------------------------------------------------------------------------- /public/images/docs/qubes_newaccount-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/qubes_newaccount-2.png -------------------------------------------------------------------------------- /public/images/docs/remix-compiler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/remix-compiler.png -------------------------------------------------------------------------------- /public/images/docs/remix-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/remix-deploy.png -------------------------------------------------------------------------------- /public/images/docs/remix-func.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/remix-func.png -------------------------------------------------------------------------------- /public/images/docs/remix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/remix.png -------------------------------------------------------------------------------- /public/images/docs/state-pruning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/state-pruning.png -------------------------------------------------------------------------------- /public/images/docs/wireframe1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/wireframe1.png -------------------------------------------------------------------------------- /public/images/docs/wireframe2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/wireframe2.png -------------------------------------------------------------------------------- /public/images/docs/wireframe3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/wireframe3.png -------------------------------------------------------------------------------- /public/images/docs/wireframe4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/wireframe4.png -------------------------------------------------------------------------------- /public/images/docs/wireframe5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/docs/wireframe5.png -------------------------------------------------------------------------------- /public/images/metadata-gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethereum/geth-website/e74924e511ed99ecb898ea793f0e0d109d85edf7/public/images/metadata-gopher.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # * 2 | User-agent: * 3 | Allow: / 4 | 5 | # Host 6 | Host: https://geth.ethereum.org 7 | 8 | # Sitemaps 9 | Sitemap: https://geth.ethereum.org/sitemap.xml 10 | -------------------------------------------------------------------------------- /src/components/UI/ButtonLinkSecondary.tsx: -------------------------------------------------------------------------------- 1 | import { Link, Stack, Text } from '@chakra-ui/react'; 2 | import NextLink, { LinkProps } from 'next/link'; 3 | 4 | import { Link as LinkTheme } from '../../theme/components'; 5 | 6 | interface Props extends LinkProps { 7 | children: React.ReactNode; 8 | } 9 | 10 | export const ButtonLinkSecondary: React.FC = ({ href, children, ...restProps }) => { 11 | const isExternal: boolean = href.toString().startsWith('http'); 12 | 13 | const variant = LinkTheme.variants['button-link-secondary']; 14 | return ( 15 | 16 | {isExternal ? ( 17 | 18 | {children} 19 | 20 | ) : ( 21 | 22 | 23 | {children} 24 | 25 | 26 | )} 27 | 28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/components/UI/Header.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import { Box, Flex, Link, Stack, Text, useColorMode } from '@chakra-ui/react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { HeaderButtons, Search } from './'; 6 | import { MoonIcon, SunIcon } from '../UI/icons'; 7 | 8 | import { MobileMenu } from '../layouts'; 9 | 10 | export const Header: FC = () => { 11 | const { colorMode, toggleColorMode } = useColorMode(); 12 | const isDark = colorMode === 'dark'; 13 | 14 | return ( 15 | 22 | 31 | 32 | 33 | 34 | go-ethereum 35 | 36 | 37 | 38 | 51 | 52 | skip to content 53 | 54 | 55 | 56 | 57 | 58 | {/* HEADER BUTTONS */} 59 | 60 | 61 | 62 | 63 | {/* SEARCH */} 64 | 65 | 66 | 67 | 68 | {/* DARK MODE SWITCH */} 69 | 81 | {isDark ? : } 82 | 83 | 84 | 85 | {/* MOBILE MENU */} 86 | 87 | 88 | ); 89 | }; 90 | -------------------------------------------------------------------------------- /src/components/UI/HeaderButtons.tsx: -------------------------------------------------------------------------------- 1 | import { FC, MouseEventHandler } from 'react'; 2 | import { Flex, Link, Stack, Text } from '@chakra-ui/react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { BORDER_WIDTH, DOCS_PAGE, DOWNLOADS_PAGE } from '../../constants'; 6 | 7 | interface Props { 8 | close?: MouseEventHandler; 9 | } 10 | 11 | export const HeaderButtons: FC = ({ close }) => { 12 | const menuItemStyles = { 13 | p: { base: 8, md: 4 }, 14 | borderBottom: { base: BORDER_WIDTH, md: 'none' }, 15 | borderRight: { base: 'none', md: BORDER_WIDTH }, 16 | borderColor: { base: 'bg', md: 'primary' }, 17 | color: { base: 'bg', md: 'primary' }, 18 | alignItems: 'center', 19 | _hover: { 20 | textDecoration: 'none', 21 | bg: 'primary', 22 | color: 'bg !important' 23 | } 24 | }; 25 | return ( 26 | 27 | {/* DOWNLOADS */} 28 | 29 | 30 | 31 | downloads 32 | 33 | 34 | 35 | 36 | {/* DOCUMENTATION */} 37 | 38 | 39 | 40 | 41 | documentation 42 | 43 | 44 | 45 | 46 | 47 | ); 48 | }; 49 | -------------------------------------------------------------------------------- /src/components/UI/PageMetadata.tsx: -------------------------------------------------------------------------------- 1 | import Head from 'next/head'; 2 | import { useRouter } from 'next/router'; 3 | 4 | import { SITE_NAME, SITE_URL } from '../../constants'; 5 | 6 | interface Props { 7 | title: string; 8 | description: string; 9 | image?: string; 10 | } 11 | 12 | export const PageMetadata: React.FC = ({ title, description, image }) => { 13 | const router = useRouter(); 14 | const url = `${SITE_URL}${router.asPath}`; 15 | const fullTitle = `${title} | ${SITE_NAME}`; 16 | const defaultOgImage = `${SITE_URL}/images/metadata-gopher.png`; 17 | const ogImage = !image ? defaultOgImage : `${SITE_URL}${image}`; 18 | 19 | return ( 20 | 21 | {fullTitle} 22 | 23 | 24 | 25 | 26 | {/* OpenGraph */} 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {/* Twitter */} 38 | 39 | 40 | 41 | 42 | 43 | 44 | {/* patch to force a cache invalidation of twitter's card bot */} 45 | 46 | {/* viewport */} 47 | 48 | {/* favicon */} 49 | 50 | 51 | ); 52 | }; 53 | -------------------------------------------------------------------------------- /src/components/UI/Search.tsx: -------------------------------------------------------------------------------- 1 | import { DocSearch } from '@docsearch/react'; 2 | 3 | import '@docsearch/css'; 4 | 5 | export const Search: React.FC = () => { 6 | const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID || ''; 7 | const apiKey = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY || ''; 8 | const indexName = process.env.NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME || ''; 9 | return ( 10 | 15 | items.map(item => ({ 16 | ...item, 17 | url: item.url.replace(/^https?:\/\/[^\/]+(?=\/)/, '') 18 | })) 19 | } 20 | /> 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/components/UI/docs/Breadcrumbs.tsx: -------------------------------------------------------------------------------- 1 | import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, Stack } from '@chakra-ui/react'; 2 | import NextLink from 'next/link'; 3 | import { useRouter } from 'next/router'; 4 | import { FC } from 'react'; 5 | 6 | export const Breadcrumbs: FC = () => { 7 | const router = useRouter(); 8 | 9 | let pathSplit = router.asPath.split('#')[0].split('/'); 10 | pathSplit = pathSplit.splice(1, pathSplit.length); 11 | 12 | return ( 13 | <> 14 | {router.asPath !== '/docs' && pathSplit.length > 1 ? ( 15 | 16 | {pathSplit.map((path: string, idx: number) => { 17 | return ( 18 | 19 | 24 | 25 | {path} 26 | 27 | 28 | 29 | ); 30 | })} 31 | 32 | ) : ( 33 | 34 | )} 35 | 36 | ); 37 | }; 38 | -------------------------------------------------------------------------------- /src/components/UI/docs/Code.tsx: -------------------------------------------------------------------------------- 1 | // Libraries 2 | import { Code as ChakraCode, Stack, Text, useColorMode } from '@chakra-ui/react'; 3 | import { nightOwl, prism } from 'react-syntax-highlighter/dist/cjs/styles/prism'; 4 | import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter'; 5 | 6 | // Constants, utilities 7 | import { CLASSNAME_PREFIX } from '../../../constants'; 8 | import { getProgrammingLanguageName } from '../../../utils'; 9 | 10 | // Programming lang syntax highlighters 11 | import bash from 'react-syntax-highlighter/dist/cjs/languages/prism/bash'; 12 | import go from 'react-syntax-highlighter/dist/cjs/languages/prism/go'; 13 | import graphql from 'react-syntax-highlighter/dist/cjs/languages/prism/graphql'; 14 | import java from 'react-syntax-highlighter/dist/cjs/languages/prism/java'; 15 | import javascript from 'react-syntax-highlighter/dist/cjs/languages/prism/javascript'; 16 | import json from 'react-syntax-highlighter/dist/cjs/languages/prism/json'; 17 | import python from 'react-syntax-highlighter/dist/cjs/languages/prism/python'; 18 | import sh from 'react-syntax-highlighter/dist/cjs/languages/prism/shell-session'; 19 | import solidity from 'react-syntax-highlighter/dist/cjs/languages/prism/solidity'; 20 | import swift from 'react-syntax-highlighter/dist/cjs/languages/prism/swift'; 21 | 22 | // syntax highlighting languages supported 23 | SyntaxHighlighter.registerLanguage('bash', bash); 24 | SyntaxHighlighter.registerLanguage('terminal', bash); 25 | SyntaxHighlighter.registerLanguage('go', go); 26 | SyntaxHighlighter.registerLanguage('graphql', graphql); 27 | SyntaxHighlighter.registerLanguage('java', java); 28 | SyntaxHighlighter.registerLanguage('javascript', javascript); 29 | SyntaxHighlighter.registerLanguage('json', json); 30 | SyntaxHighlighter.registerLanguage('python', python); 31 | SyntaxHighlighter.registerLanguage('sh', sh); 32 | SyntaxHighlighter.registerLanguage('solidity', solidity); 33 | SyntaxHighlighter.registerLanguage('swift', swift); 34 | 35 | interface Props { 36 | className: string; 37 | children: string[]; 38 | inline?: boolean; 39 | } 40 | export const Code: React.FC = ({ className, children, inline }) => { 41 | const { colorMode } = useColorMode(); 42 | const isDark = colorMode === 'dark'; 43 | const isTerminal = className?.includes('terminal'); 44 | const [content] = children; 45 | if (inline) 46 | return ( 47 | 55 | {content} 56 | 57 | ); 58 | if (isTerminal) 59 | return ( 60 | 61 | 62 | {content} 63 | 64 | 65 | ); 66 | if (className?.startsWith(CLASSNAME_PREFIX)) 67 | return ( 68 | 73 | {content} 74 | 75 | ); 76 | return ( 77 | 78 | 79 | {content} 80 | 81 | 82 | ); 83 | }; 84 | -------------------------------------------------------------------------------- /src/components/UI/docs/DocsLinks.tsx: -------------------------------------------------------------------------------- 1 | import { FC, useEffect, useState } from 'react'; 2 | import { 3 | Accordion, 4 | AccordionButton, 5 | AccordionItem, 6 | AccordionPanel, 7 | Center, 8 | Link, 9 | Stack, 10 | Text 11 | } from '@chakra-ui/react'; 12 | import { AddIcon, MinusIcon } from '../svgs/'; 13 | import NextLink from 'next/link'; 14 | import { useRouter } from 'next/router'; 15 | 16 | import { LinksList } from './'; 17 | 18 | import { NavLink } from '../../../types'; 19 | import { checkNavLinks } from '../../../utils'; 20 | 21 | interface Props { 22 | navLinks: NavLink[]; 23 | toggleMobileAccordion: () => void; 24 | } 25 | 26 | export const DocsLinks: FC = ({ navLinks, toggleMobileAccordion }) => { 27 | const [openSections, setOpenSections] = useState<{ [key: string]: boolean }>({}); 28 | const { 29 | asPath, 30 | query: { slug } 31 | } = useRouter(); 32 | 33 | useEffect(() => { 34 | setOpenSections( 35 | navLinks.reduce( 36 | (acc, navLink) => ({ 37 | ...acc, 38 | [navLink.id]: checkNavLinks({ items: navLink.items, pathCheck: asPath.split('#')[0] }) 39 | }), 40 | {} 41 | ) 42 | ); 43 | }, [asPath, navLinks]); 44 | 45 | const handleSectionToggle = (id: string): void => { 46 | setOpenSections(prev => ({ ...prev, [id]: !prev[id] })); 47 | }; 48 | 49 | return ( 50 | 51 | {navLinks.map(({ id, to, items }, idx) => { 52 | const split = to?.split('/'); 53 | const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1]; 54 | const index = openSections[id] ? 0 : -1; 55 | 56 | return ( 57 | 58 | 59 | {({ isExpanded }) => ( 60 | <> 61 | handleSectionToggle(id)} 70 | > 71 | 79 | {to ? ( 80 | 81 | 82 | 94 | {id} 95 | 96 | 97 | 98 | ) : ( 99 | {id} 100 | )} 101 | 102 | 103 | {items && ( 104 | 105 |
106 | {isExpanded ? ( 107 | 108 | ) : ( 109 | 110 | )} 111 |
112 |
113 | )} 114 |
115 | {items && ( 116 | 117 | 118 | 119 | )} 120 | 121 | )} 122 |
123 |
124 | ); 125 | })} 126 |
127 | ); 128 | }; 129 | -------------------------------------------------------------------------------- /src/components/UI/docs/DocsNav.tsx: -------------------------------------------------------------------------------- 1 | import { FC, useState } from 'react'; 2 | import { 3 | Accordion, 4 | AccordionButton, 5 | AccordionIcon, 6 | AccordionItem, 7 | AccordionPanel, 8 | Stack, 9 | Text 10 | } from '@chakra-ui/react'; 11 | import { DocsLinks } from './DocsLinks'; 12 | 13 | import { NavLink } from '../../../types'; 14 | 15 | interface Props { 16 | navLinks: NavLink[]; 17 | } 18 | 19 | export const DocsNav: FC = ({ navLinks }) => { 20 | const [isMobileAccordionOpen, setMobileAccordionState] = useState(false); 21 | 22 | const toggleMobileAccordion = () => { 23 | setMobileAccordionState(prev => !prev); 24 | }; 25 | 26 | return ( 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 56 | Documentation 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | ); 67 | }; 68 | -------------------------------------------------------------------------------- /src/components/UI/docs/DocumentNav.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import { Box, Divider, Link, Text } from '@chakra-ui/react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { parseHeadingId } from '../../../utils/parseHeadingId'; 6 | import { useActiveHash } from '../../../hooks/useActiveHash'; 7 | 8 | interface Props { 9 | content: string; 10 | } 11 | 12 | export const DocumentNav: FC = ({ content }) => { 13 | const parsedHeadings = content 14 | .split('\n\n') 15 | .map(item => item.replace(/[\n\r]/g, '')) 16 | .filter(item => item.startsWith('##')) 17 | .map(item => parseHeadingId([item])) 18 | .filter(item => item); 19 | 20 | const activeHash = useActiveHash(parsedHeadings.map(heading => heading!.headingId)); 21 | 22 | return parsedHeadings.length ? ( 23 | 24 | on this page 25 | 26 | {parsedHeadings.map((heading, idx) => { 27 | return ( 28 | 29 | 30 | 52 | {heading?.title} 53 | 54 | 55 | 56 | ); 57 | })} 58 | 59 | ) : null; 60 | }; 61 | -------------------------------------------------------------------------------- /src/components/UI/docs/LinksList.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import { Link, Stack, Text } from '@chakra-ui/react'; 3 | import NextLink from 'next/link'; 4 | import { useRouter } from 'next/router'; 5 | 6 | import { NavLink } from '../../../types'; 7 | 8 | interface LinksListProps { 9 | links: NavLink[]; 10 | toggleMobileAccordion: () => void; 11 | } 12 | 13 | export const LinksList: FC = ({ links, toggleMobileAccordion }) => { 14 | const router = useRouter(); 15 | const { slug } = router.query; 16 | return ( 17 | 18 | {links.map(({ id, to, items }) => { 19 | const split = to?.split('/'); 20 | const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1]; 21 | return to ? ( 22 | 28 | 29 | 30 | 45 | {id} 46 | 47 | 48 | 49 | {items && } 50 | 51 | ) : ( 52 | 53 | 54 | {id} 55 | 56 | {items && } 57 | 58 | ); 59 | })} 60 | 61 | ); 62 | }; 63 | -------------------------------------------------------------------------------- /src/components/UI/docs/MDComponents.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Flex, 3 | Heading, 4 | Link, 5 | ListItem, 6 | OrderedList, 7 | Stack, 8 | Table, 9 | Text, 10 | UnorderedList 11 | } from '@chakra-ui/react'; 12 | import NextLink from 'next/link'; 13 | 14 | import { Code, Note } from '.'; 15 | import { textStyles } from '../../../theme/foundations'; 16 | import { parseHeadingId } from '../../../utils/parseHeadingId'; 17 | 18 | const { h1, h2, h3, h4 } = textStyles; 19 | 20 | const MDComponents = { 21 | // paragraphs 22 | p: ({ children }: any) => { 23 | return ( 24 | 25 | {children} 26 | 27 | ); 28 | }, 29 | // links 30 | a: ({ children, href }: any) => { 31 | const isExternal = href.startsWith('http') && !href.includes('geth.ethereum.org'); 32 | 33 | return isExternal ? ( 34 | 35 | {children} 36 | 37 | ) : ( 38 | 39 | {children} 40 | 41 | ); 42 | }, 43 | // headings 44 | h1: ({ children }: any) => { 45 | const { children: parsedChildren, headingId } = parseHeadingId(children); 46 | 47 | return ( 48 | 49 | {parsedChildren} 50 | 51 | ); 52 | }, 53 | h2: ({ children }: any) => { 54 | const { children: parsedChildren, headingId } = parseHeadingId(children); 55 | 56 | return ( 57 | 65 | {parsedChildren} 66 | 67 | ); 68 | }, 69 | h3: ({ children }: any) => { 70 | const { children: parsedChildren, headingId } = parseHeadingId(children); 71 | return ( 72 | 73 | {parsedChildren} 74 | 75 | ); 76 | }, 77 | h4: ({ children }: any) => { 78 | const { children: parsedChildren, headingId } = parseHeadingId(children); 79 | 80 | return ( 81 | 82 | {parsedChildren} 83 | 84 | ); 85 | }, 86 | // tables 87 | table: ({ children }: any) => ( 88 | 89 | 98 | {children} 99 |
100 |
101 | ), 102 | // pre 103 | pre: ({ children }: any) => ( 104 | 105 | {children} 106 | 107 | ), 108 | // code 109 | code: ({ children, ...props }: any) => {children}, 110 | // list 111 | ul: ({ children }: any) => { 112 | return ( 113 | 114 | 115 | {children} 116 | 117 | 118 | ); 119 | }, 120 | ol: ({ children }: any) => { 121 | return ( 122 | 123 | 124 | {children} 125 | 126 | 127 | ); 128 | }, 129 | li: ({ children }: any) => { 130 | return {children}; 131 | }, 132 | note: ({ children }: any) => { 133 | return {children}; 134 | } 135 | }; 136 | 137 | export default MDComponents; 138 | -------------------------------------------------------------------------------- /src/components/UI/docs/Note.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import { Stack, Text } from '@chakra-ui/react'; 3 | 4 | interface Props { 5 | children: string[]; 6 | } 7 | 8 | export const Note: FC = ({ children }) => { 9 | return ( 10 | 11 | 12 | Note 13 | 14 | {children} 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/UI/docs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Breadcrumbs'; 2 | export * from './Code'; 3 | export * from './DocsLinks'; 4 | export * from './DocsNav'; 5 | export * from './DocumentNav'; 6 | export * from './LinksList'; 7 | export * from './Note'; 8 | export { default } from './MDComponents'; 9 | -------------------------------------------------------------------------------- /src/components/UI/downloads/DownloadsHero.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Button, Center, Grid, HStack, Link, Stack, Text } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { GopherDownloads } from '../svgs'; 6 | 7 | import { DOWNLOAD_HEADER_BUTTONS } from '../../../constants'; 8 | 9 | interface DownloadsHero { 10 | currentBuild: string; 11 | currentBuildVersion: string; 12 | linuxBuildURL: string; 13 | macOSBuildURL: string; 14 | releaseNotesURL: string; 15 | sourceCodeURL: string; 16 | windowsBuildURL: string; 17 | } 18 | 19 | export const DownloadsHero: FC = ({ 20 | currentBuild, 21 | currentBuildVersion, 22 | linuxBuildURL, 23 | macOSBuildURL, 24 | releaseNotesURL, 25 | sourceCodeURL, 26 | windowsBuildURL 27 | }) => { 28 | DOWNLOAD_HEADER_BUTTONS.linuxBuild.buildURL = linuxBuildURL; 29 | DOWNLOAD_HEADER_BUTTONS.macOSBuild.buildURL = macOSBuildURL; 30 | DOWNLOAD_HEADER_BUTTONS.windowsBuild.buildURL = windowsBuildURL; 31 | DOWNLOAD_HEADER_BUTTONS.sourceCode.buildURL = sourceCodeURL; 32 | 33 | return ( 34 | 41 | 42 | 48 | 49 | 50 | Download go-ethereum 51 | 52 | 59 | {currentBuild} 60 | 61 | 62 | 63 | You can download the latest 64-bit stable release of Geth for our primary platforms 64 | below. Packages for all supported platforms, as well as develop builds, can be found 65 | further down the page. If you're looking to install Geth and/or associated tools 66 | via your favorite package manager, please check our installation guide. 67 | 68 | 69 | 70 |
76 | 77 |
78 |
79 | 80 | 81 | {Object.keys(DOWNLOAD_HEADER_BUTTONS).map((key: string) => { 82 | const { name, buildURL, Svg, ariaLabel } = DOWNLOAD_HEADER_BUTTONS[key]; 83 | 84 | return ( 85 | 86 | 103 | 104 | ); 105 | })} 106 | 107 | 108 | 109 | 110 | Release notes for {currentBuild} 111 | 112 | 113 |
114 | 115 |
116 | 117 |
118 |
119 | ); 120 | }; 121 | -------------------------------------------------------------------------------- /src/components/UI/downloads/DownloadsSection.tsx: -------------------------------------------------------------------------------- 1 | import { Center, Flex, IconProps, Stack, Text } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | 4 | interface Props { 5 | id: string; 6 | sectionTitle: string; 7 | sectionDescription?: React.ReactNode; 8 | children: React.ReactNode; 9 | Svg?: React.FC; 10 | ariaLabel?: string; 11 | } 12 | 13 | export const DownloadsSection: FC = ({ 14 | id, 15 | sectionTitle, 16 | sectionDescription, 17 | children, 18 | Svg, 19 | ariaLabel 20 | }) => { 21 | return ( 22 | 23 | {Svg && ( 24 | 25 | 26 | 27 | )} 28 | 29 | 34 | 35 |
36 | 37 | {sectionTitle} 38 | 39 |
40 |
41 | 42 | {sectionDescription && ( 43 |
49 | {sectionDescription} 50 |
51 | )} 52 |
53 | 54 | 55 | {children} 56 | 57 |
58 | ); 59 | }; 60 | -------------------------------------------------------------------------------- /src/components/UI/downloads/DownloadsTable.tsx: -------------------------------------------------------------------------------- 1 | import { Stack, Tabs, TabList, Tab, Text, TabPanel, TabPanels } from '@chakra-ui/react'; 2 | import { FC, useMemo } from 'react'; 3 | 4 | import { DataTable } from '../../UI'; 5 | 6 | import { DOWNLOADS_TABLE_TABS, DOWNLOADS_TABLE_TAB_COLUMN_HEADERS } from '../../../constants'; 7 | import { ReleaseData } from '../../../types'; 8 | 9 | interface Props { 10 | linuxData: ReleaseData[]; 11 | macOSData: ReleaseData[]; 12 | windowsData: ReleaseData[]; 13 | iOSData: ReleaseData[]; 14 | androidData: ReleaseData[]; 15 | totalReleasesNumber: number; 16 | amountOfReleasesToShow: number; 17 | setTotalReleases: (idx: number) => void; 18 | } 19 | 20 | export const DownloadsTable: FC = ({ 21 | linuxData, 22 | macOSData, 23 | windowsData, 24 | iOSData, 25 | androidData, 26 | totalReleasesNumber, 27 | amountOfReleasesToShow, 28 | setTotalReleases 29 | }) => { 30 | const totalReleases = [ 31 | linuxData.length, 32 | macOSData.length, 33 | windowsData.length, 34 | iOSData.length, 35 | androidData.length 36 | ]; 37 | 38 | const LAST_2_LINUX_RELEASES = amountOfReleasesToShow + 12; 39 | 40 | const getDefaultIndex = useMemo(() => { 41 | const OS: string = typeof window !== 'undefined' ? window.navigator.platform : ''; 42 | const userAgent = typeof window !== 'undefined' ? window.navigator.userAgent : ''; 43 | if (/Mac/i.test(OS)) return 1; 44 | if (/Win/i.test(OS)) return 2; 45 | if (/iPhone/i.test(OS)) return 3; 46 | if (/Android/i.test(userAgent)) return 4; 47 | return 0; 48 | }, []); 49 | 50 | return ( 51 | 59 | setTotalReleases(totalReleases[idx])} 62 | defaultIndex={getDefaultIndex} 63 | > 64 | 65 | {DOWNLOADS_TABLE_TABS.map((tab, idx) => { 66 | return ( 67 | 79 | {tab} 80 | 81 | ); 82 | })} 83 | 84 | 85 | 86 | 87 | 91 | 92 | 93 | 97 | 98 | 99 | 103 | 104 | 105 | 109 | 110 | 111 | 115 | 116 | 117 | 118 | 119 | ); 120 | }; 121 | -------------------------------------------------------------------------------- /src/components/UI/downloads/SpecificVersionsSection.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Flex, Grid, GridItem, Image, Stack } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | import { GopherHomeLinks } from '../svgs'; 4 | 5 | interface Props { 6 | children: React.ReactNode; 7 | } 8 | 9 | export const SpecificVersionsSection: FC = ({ children }) => { 10 | return ( 11 | 16 | 17 | 18 | {/* TODO: replace with animated/video version */} 19 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Specific Versions 37 | 38 | 39 | {children} 40 | 41 | 42 | 43 | ); 44 | }; 45 | -------------------------------------------------------------------------------- /src/components/UI/downloads/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DownloadsHero'; 2 | export * from './DownloadsSection'; 3 | export * from './DownloadsTable'; 4 | export * from './SpecificVersionsSection'; 5 | -------------------------------------------------------------------------------- /src/components/UI/homepage/HomeHero.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Button, Flex, Stack, Text } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { DOCS_PAGE, DOWNLOADS_PAGE } from '../../../constants'; 6 | 7 | export const HomeHero: FC = () => { 8 | return ( 9 | 16 | 17 | 26 | go-ethereum 27 | 28 | 29 | 30 | Official Go implementation of the Ethereum protocol 31 | 32 | 33 | 34 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | Get our latest releases 47 | 48 | 49 | 50 | 51 | 52 | 55 | 56 | 57 | 58 | Read our documentation 59 | 60 | 61 | 62 | 63 | ); 64 | }; 65 | -------------------------------------------------------------------------------- /src/components/UI/homepage/HomeSection.tsx: -------------------------------------------------------------------------------- 1 | import { Box, IconProps, Stack } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | 4 | import { ButtonLinkSecondary } from '..'; 5 | interface Props { 6 | sectionTitle: string; 7 | linkLabel: string; 8 | buttonHref: string; 9 | children?: React.ReactNode; 10 | Svg?: React.FC; 11 | ariaLabel?: string; 12 | } 13 | 14 | export const HomeSection: FC = ({ 15 | Svg, 16 | ariaLabel, 17 | sectionTitle, 18 | linkLabel, 19 | buttonHref, 20 | children 21 | }) => { 22 | return ( 23 | 24 | {Svg && ( 25 | 26 | 27 | 28 | )} 29 | 30 | 31 | {sectionTitle} 32 | 33 | 34 | 35 | 43 | {children} 44 | 45 | 46 | {linkLabel} 47 | 48 | ); 49 | }; 50 | -------------------------------------------------------------------------------- /src/components/UI/homepage/QuickLinks.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Grid, GridItem, Link, Stack, Text } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { CONTRIBUTING_PAGE, DOCS_PAGE, FAQ_PAGE } from '../../../constants'; 6 | 7 | export const QuickLinks: FC = () => { 8 | return ( 9 | 10 | 11 | 12 | Quick Links 13 | 14 | 15 | 16 | 20 | {/* get started */} 21 | 22 | 23 | 24 | Don't know where to start? 25 | 26 | 27 | We can help. 28 | 29 | 30 | 31 | 32 | 33 | 52 | Get started 53 | 54 | 55 | 56 | 57 | 58 | {/* faq */} 59 | 60 | 61 | 62 | Have doubts? 63 | 64 | 65 | Check the FAQ section in the documentation. 66 | 67 | 68 | 69 | 70 | 71 | 90 | Go to the FAQ 91 | 92 | 93 | 94 | 95 | 96 | {/* how to contribute */} 97 | 98 | 99 | 100 | Want to know how to contribute? 101 | 102 | 103 | Get more information in the documentation. 104 | 105 | 106 | 107 | 108 | 109 | 128 | How to contribute 129 | 130 | 131 | 132 | 133 | 134 | 135 | ); 136 | }; 137 | -------------------------------------------------------------------------------- /src/components/UI/homepage/WhatIsEthereum.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Grid, GridItem, Stack } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | import { GlyphHome } from '../svgs/GlyphHome'; 4 | import { ETHEREUM_ORG_URL } from '../../../constants'; 5 | import { ButtonLinkSecondary } from '..'; 6 | 7 | interface Props { 8 | children: React.ReactNode; 9 | } 10 | 11 | export const WhatIsEthereum: FC = ({ children }) => { 12 | return ( 13 | 14 | 19 | 24 | 25 | 26 | What is Ethereum? 27 | 28 | 29 | 30 | 31 | {children} 32 | 33 | 34 | 35 | 36 | 44 | 45 | 46 | 47 | 48 | 49 | Learn more on Ethereum.org 50 | 51 | ); 52 | }; 53 | -------------------------------------------------------------------------------- /src/components/UI/homepage/WhyRunANode.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Grid, GridItem, Stack } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | 4 | import { ButtonLinkSecondary } from '..'; 5 | import { GopherHomeNodes } from '../svgs/GopherHomeNodes'; 6 | import { ETHEREUM_ORG_RUN_A_NODE_URL } from '../../../constants'; 7 | 8 | interface Props { 9 | children: React.ReactNode; 10 | } 11 | 12 | export const WhyRunANode: FC = ({ children }) => { 13 | return ( 14 | 15 | 20 | 21 | 22 | 23 | Why run a node? 24 | 25 | 26 | 27 | 33 | {children} 34 | 35 | 36 | 37 | 38 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Read more about running a node 54 | 55 | 56 | ); 57 | }; 58 | -------------------------------------------------------------------------------- /src/components/UI/homepage/index.ts: -------------------------------------------------------------------------------- 1 | export * from './HomeHero'; 2 | export * from './HomeSection'; 3 | export * from './WhatIsEthereum'; 4 | export * from './WhyRunANode'; 5 | export * from './QuickLinks'; 6 | -------------------------------------------------------------------------------- /src/components/UI/icons/DiscordIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const DiscordIcon = createIcon({ 4 | displayName: 'DiscordIcon', 5 | viewBox: '0 0 32 24', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/GitHubIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const GitHubIcon = createIcon({ 4 | displayName: 'GitHubIcon', 5 | viewBox: '0 0 26 24', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/HamburgerIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const HamburgerIcon = createIcon({ 4 | displayName: 'HamburgerIcon', 5 | viewBox: '0 0 22 14', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/LensIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const LensIcon = createIcon({ 4 | displayName: 'LensIcon', 5 | viewBox: '0 0 17 18', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/LinuxPenguin.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [27, 36]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'LinuxPenguin', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 15 | 16 | ) 17 | }); 18 | 19 | export const LinuxPenguin: React.FC = props => ( 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /src/components/UI/icons/MacosLogo.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [25, 30]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'MacosLogo', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 15 | 16 | ) 17 | }); 18 | 19 | export const MacosLogo: React.FC = props => ; 20 | -------------------------------------------------------------------------------- /src/components/UI/icons/MoonIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const MoonIcon = createIcon({ 4 | displayName: 'MoonIcon', 5 | viewBox: '0 0 22 22', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/SourceBranch.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [22, 30]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'SourceBranch', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 15 | 16 | ) 17 | }); 18 | 19 | export const SourceBranch: React.FC = props => ( 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /src/components/UI/icons/SunIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const SunIcon = createIcon({ 4 | displayName: 'SunIcon', 5 | viewBox: '0 0 44 44', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/TwitterIcon.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from '@chakra-ui/icons'; 2 | 3 | export const TwitterIcon = createIcon({ 4 | displayName: 'TwitterIcon', 5 | viewBox: '0 0 28 22', 6 | path: ( 7 | 8 | 12 | 13 | ) 14 | }); 15 | -------------------------------------------------------------------------------- /src/components/UI/icons/WindowsLogo.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [25, 24]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'WindowsLogo', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 15 | 16 | ) 17 | }); 18 | 19 | export const WindowsLogo: React.FC = props => ; 20 | -------------------------------------------------------------------------------- /src/components/UI/icons/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DiscordIcon'; 2 | export * from './GitHubIcon'; 3 | export * from './HamburgerIcon'; 4 | export * from './LensIcon'; 5 | export * from './MoonIcon'; 6 | export * from './SunIcon'; 7 | export * from './TwitterIcon'; 8 | export * from './SourceBranch'; 9 | export * from './MacosLogo'; 10 | export * from './LinuxPenguin'; 11 | export * from './WindowsLogo'; 12 | -------------------------------------------------------------------------------- /src/components/UI/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ButtonLinkSecondary'; 2 | export * from './DataTable'; 3 | export * from './Header'; 4 | export * from './HeaderButtons'; 5 | export * from './PageMetadata'; 6 | export * from './Search'; 7 | -------------------------------------------------------------------------------- /src/components/UI/svgs/AddIcon.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [24, 24]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'AddIcon', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | ) 17 | }); 18 | 19 | export const AddIcon: React.FC = props => ( 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /src/components/UI/svgs/GlyphHome.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [180, 278]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'GlyphHome', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 15 | 16 | ) 17 | }); 18 | 19 | export const GlyphHome: React.FC = props => ( 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /src/components/UI/svgs/MinusIcon.tsx: -------------------------------------------------------------------------------- 1 | import { IconProps } from '@chakra-ui/react'; 2 | import { createIcon } from '@chakra-ui/icons'; 3 | 4 | const [w, h] = [24, 24]; 5 | 6 | const Icon = createIcon({ 7 | displayName: 'MinusIcon', 8 | viewBox: `0 0 ${w} ${h}`, 9 | path: ( 10 | 11 | 12 | 13 | ) 14 | }); 15 | 16 | export const MinusIcon: React.FC = props => ( 17 | 18 | ); 19 | -------------------------------------------------------------------------------- /src/components/UI/svgs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AddIcon'; 2 | export * from './GlyphHome'; 3 | export * from './GopherDownloads'; 4 | export * from './GopherHomeFront'; 5 | export * from './GopherHomeLinks'; 6 | export * from './GopherHomeNodes'; 7 | export * from './MinusIcon'; 8 | -------------------------------------------------------------------------------- /src/components/layouts/Footer.tsx: -------------------------------------------------------------------------------- 1 | import { Center, Flex, Link, Text } from '@chakra-ui/react'; 2 | import { FC } from 'react'; 3 | import NextLink from 'next/link'; 4 | 5 | import { 6 | DOCS_PAGE, 7 | DOWNLOADS_PAGE, 8 | GETH_DISCORD_URL, 9 | GETH_REPO_URL, 10 | GETH_TWITTER_URL 11 | } from '../../constants'; 12 | 13 | import { DiscordIcon, GitHubIcon, TwitterIcon } from '../UI/icons'; 14 | 15 | const hoverStyles = { 16 | textDecoration: 'none', 17 | bg: 'primary', 18 | color: 'bg !important' 19 | }; 20 | 21 | export const Footer: FC = () => { 22 | return ( 23 | 24 | 30 | 38 |
45 | 46 | 47 | DOWNLOADS 48 | 49 | 50 |
51 | 52 |
62 | 63 | 64 | DOCUMENTATION 65 | 66 | 67 |
68 |
69 | 70 | 71 |
82 | 83 | 90 | 91 |
92 | 93 |
101 | 102 | 109 | 110 |
111 | 112 |
113 | 114 | 121 | 122 |
123 |
124 |
125 | 126 |
136 | {`© 2013–${new Date().getFullYear()}. The go-ethereum Authors.`} 137 |
138 |
139 | ); 140 | }; 141 | -------------------------------------------------------------------------------- /src/components/layouts/Layout.tsx: -------------------------------------------------------------------------------- 1 | // Libraries 2 | import { Container } from '@chakra-ui/react'; 3 | import { FC } from 'react'; 4 | 5 | // Components 6 | import { Header } from '../UI'; 7 | import { Footer } from './Footer'; 8 | 9 | interface Props { 10 | children?: React.ReactNode; 11 | } 12 | 13 | export const Layout: FC = ({ children }) => { 14 | return ( 15 | 16 |
17 | 18 | {children} 19 | 20 |