Skip to content

Commit

Permalink
access node setup guide changes with instructions on how to run with …
Browse files Browse the repository at this point in the history
…a binary (#862)
  • Loading branch information
vishalchangrani authored Aug 22, 2024
1 parent 6b0c032 commit 1522cbe
Show file tree
Hide file tree
Showing 14 changed files with 2,274 additions and 2,148 deletions.
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ description: Essential tools for the Flow blockchain ecosystem
---

import DocCardList from '@theme/DocCardList';
import { useDocsSidebar, isSamePath } from '@docusaurus/theme-common/internal';
import { isSamePath } from '@docusaurus/theme-common/internal';
import { useDocsSidebar } from '@docusaurus/plugin-content-docs/client';
import { useLocation } from '@docusaurus/router';

<DocCardList items={useDocsSidebar().items.filter(item => !isSamePath(item.href, useLocation().pathname))}/>
Expand Down Expand Up @@ -164,7 +165,8 @@ On the top level index category pages you have to use `useDocsSidebar` react hoo

```markdown
import DocCardList from '@theme/DocCardList';
import { useDocsSidebar, isSamePath } from '@docusaurus/theme-common/internal';
import { isSamePath } from '@docusaurus/theme-common/internal';
import { useDocsSidebar } from '@docusaurus/plugin-content-docs/client';
import { useLocation } from '@docusaurus/router';

<DocCardList items={useDocsSidebar().items.filter(item => !isSamePath(item.href, useLocation().pathname))}/>
Expand Down
3 changes: 2 additions & 1 deletion docs/ecosystem/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ description: Access essential tools, knowledge, and community connections for th
---

import DocCardList from '@theme/DocCardList';
import { useDocsSidebar, isSamePath } from '@docusaurus/theme-common/internal';
import { isSamePath } from '@docusaurus/theme-common/internal';
import { useDocsSidebar } from '@docusaurus/plugin-content-docs/client';
import { useLocation } from '@docusaurus/router';

<DocCardList items={
Expand Down
2 changes: 1 addition & 1 deletion docs/evm/guides/hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ To keep this example straightforward, we've included the account's private key d

## HelloWorld Smart Contract

```Solidity
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
Expand Down
3 changes: 2 additions & 1 deletion docs/networks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ sidebar_position: 1
---

import DocCardList from '@theme/DocCardList';
import { useDocsSidebar, isSamePath } from '@docusaurus/theme-common/internal';
import { isSamePath } from '@docusaurus/theme-common/internal';
import { useDocsSidebar } from '@docusaurus/plugin-content-docs/client';
import { useLocation } from '@docusaurus/router';

# Networks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ sidebar_label: Access Node Setup
sidebar_position: 2
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

This guide is for running a permissonless Access node on Flow. If you are planning to run a different type of staked node then see [node bootstrap](../../node-operation/node-bootstrap.md).

Permissionless Access nodes allow any operator to run a Flow Access node.
Expand Down Expand Up @@ -35,15 +38,16 @@ Confirmation of a new node's inclusion in epoch N+1 is included in the [`EpochSe

## Limitations

There are three open slots for access nodes every epoch.
There are five open slots for access nodes every epoch.
You can view the exact epoch phase transition time [here](https://app.metrika.co/flow/dashboard/network-overview?tr=1d) under `Epoch Phase`.

To summarize,

| **Date** | **Time** | **Epoch** | **Epoch Phase** | |
|:----------:|:---------:|:---------:|:----------------------:|:---------------------------------------------------:|
| 02/08/2023 | 20:00 UTC | 63 | Staking auction starts | Three new access node slots are opened. Anyone can register their access nodes |
| 02/15/2023 | 08:00 UTC | 63 | Staking auction ends | Three of the nodes registered during this epoch are randomly selected to be a part of the network in the next epoch. No more nodes can register until the next epoch starts. |
| 02/15/2023 | 20:00 UTC | 64 | Epoch n+1 starts | The newly selected nodes can now participate in the network. Three new slots are opened. |
| **Epoch** | **Epoch Phase** | |
|:----------:|:----------------------:|:---------------------------------------------------:|
| N | Staking auction starts | Three new access node slots are opened. Anyone can register their access nodes |
| N | Staking auction ends | Three of the nodes registered during this epoch are randomly selected to be a part of the network in the next epoch. No more nodes can register until the next epoch starts. |
| N+1 | Epoch N+1 starts | The newly selected nodes can now participate in the network. Three new slots are opened. |

## How To Run a Permissionless Access Node?

Expand Down Expand Up @@ -73,8 +77,8 @@ tar -xvf boot-tools.tar
```

```shell CheckSHA256
sha256sum ./boot-tools/bootstrapcmd
a06e3e9b2443c6755214150e9e101b70dd48ae30ffcfcbbcc471ba430cb104bf ./boot-tools/bootstrapcmd
sha256sum ./boot-tools/bootstrap
a06e3e9b2443c6755214150e9e101b70dd48ae30ffcfcbbcc471ba430cb104bf ./boot-tools/bootstrap
```

> If you have downloaded the bootstrapping kit previously, ensure the SHA256 hash for it still matches. If not, re-download to ensure you are using the most up-to-date version.
Expand Down Expand Up @@ -125,7 +129,7 @@ _Use a fully qualified domain name for the network address. Please also include

:::warning

_Do not include in `http://` in the network address._
_Do not include the prefix `http://` in the network address._

:::

Expand Down Expand Up @@ -259,30 +263,61 @@ First you'll need to provision a machine or virtual machine to run your node sof

The access node can be run as a Docker container with the following command.

Be sure to set `$VERSION` below to the version tag (eg. `v1.2.3`) corresponding to the current network version (see [here](https://github.com/onflow/flow-go/releases) for version releases). Set `$NODEID` to your node's ID (see [Generate Your Node Identity](#generate-your-node-identity) section above).
Be sure to set `$VERSION` below to the version tag (e.g. `v1.2.3`) corresponding to the latest **released** version [here](https://github.com/onflow/flow-go/releases) for version releases). Set `$NODEID` to your node's ID (see [Generate Your Node Identity](#generate-your-node-identity) section above).

<Tabs>
<TabItem value="mainnet" label="Mainnet">

```shell
docker run --rm \
-v $PWD/bootstrap:/bootstrap:ro \
-v $PWD/data:/data:rw \
--name flow-go \
--network host \
gcr.io/flow-container-registry/access:$VERSION \
--nodeid=$NODEID \
--bootstrapdir=/bootstrap \
--datadir=/data/protocol \
--secretsdir=/data/secrets \
--rpc-addr=0.0.0.0:9000 \
--http-addr=0.0.0.0:8000 \
--rest-addr=0.0.0.0:80 \
--rpc-metrics-enabled=true \
--bind 0.0.0.0:3569 \
--dynamic-startup-access-address=secure.mainnet.nodes.onflow.org:9001 \
--dynamic-startup-access-publickey=28a0d9edd0de3f15866dfe4aea1560c4504fe313fc6ca3f63a63e4f98d0e295144692a58ebe7f7894349198613f65b2d960abf99ec2625e247b1c78ba5bf2eae \
--dynamic-startup-epoch-phase=EpochPhaseStaking \
--loglevel=error
-v $PWD/bootstrap:/bootstrap:ro \
-v $PWD/data:/data:rw \
--name flow-go \
--network host \
gcr.io/flow-container-registry/access:$VERSION \
--nodeid=$NODEID \
--bootstrapdir=/bootstrap \
--datadir=/data/protocol \
--secretsdir=/data/secrets \
--rpc-addr=0.0.0.0:9000 \
--http-addr=0.0.0.0:8000 \
--rest-addr=0.0.0.0:80 \
--rpc-metrics-enabled=true \
--bind 0.0.0.0:3569 \
--dynamic-startup-access-address=secure.mainnet.nodes.onflow.org:9001 \
--dynamic-startup-access-publickey=28a0d9edd0de3f15866dfe4aea1560c4504fe313fc6ca3f63a63e4f98d0e295144692a58ebe7f7894349198613f65b2d960abf99ec2625e247b1c78ba5bf2eae \
--dynamic-startup-epoch-phase=EpochPhaseStaking \
--loglevel=error
```

</TabItem>
<TabItem value="testnet" label="Testnet">

```shell
docker run --rm \
-v $PWD/bootstrap:/bootstrap:ro \
-v $PWD/data:/data:rw \
--name flow-go \
--network host \
gcr.io/flow-container-registry/access:$VERSION \
--nodeid=$NODEID \
--bootstrapdir=/bootstrap \
--datadir=/data/protocol \
--secretsdir=/data/secrets \
--rpc-addr=0.0.0.0:9000 \
--http-addr=0.0.0.0:8000 \
--rest-addr=0.0.0.0:80 \
--rpc-metrics-enabled=true \
--bind 0.0.0.0:3569 \
--dynamic-startup-access-address=secure.testnet.nodes.onflow.org:9001 \
--dynamic-startup-access-publickey=ba69f7d2e82b9edf25b103c195cd371cf0cc047ef8884a9bbe331e62982d46daeebf836f7445a2ac16741013b192959d8ad26998aff12f2adc67a99e1eb2988d \
--dynamic-startup-epoch-phase=EpochPhaseStaking \
--loglevel=error
```

</TabItem>
</Tabs>

For example, if your Node ID is `e737ec6efbd26ef43bf676911cdc5a11ba15fc6562d05413e6589fccdd6c06d5` and the software version is `v1.2.3`, the Docker command would be the following:
```shell Example
docker run --rm \
Expand All @@ -306,6 +341,63 @@ docker run --rm \
--loglevel=error
```

> If you would like your node to sync from the start of the last network upgrade, then please see the instructions [here](https://developers.flow.com/networks/node-ops/node-operation/spork)
Alternatively, you can build a binary for the access node to run it without using Docker.
To build the access node binary, see the instructions [here](https://github.com/onflow/flow-go?tab=readme-ov-file#building-a-binary-for-the-access-node).
Please make sure to git checkout the latest release tag before building the binary.

<Tabs>
<TabItem value="mainnet" label="Mainnet">

```shell
$PWD/flow-go/flow_access_node \
--nodeid=e1a8b231156ab6f2a5c6f862c933baf5e5c2e7cf019b509c7c91f4ddb0a13398 \
--bootstrapdir=$PWD/bootstrap \
--datadir=$PWD/data/protocol \
--secretsdir=$PWD/data/secrets \
--execution-data-dir=$PWD/data/execution_data \
--rpc-addr=0.0.0.0:9000 \
--secure-rpc-addr=0.0.0.0:9001 \
--http-addr=0.0.0.0:8000 \
--rest-addr=0.0.0.0:8070 \
--admin-addr=localhost:9002 \
--bind=0.0.0.0:3569 \
--dht-enabled=false \
--grpc-compressor=gzip \
--profiler-dir=$PWD/data/profiler \
--dynamic-startup-access-address=secure.mainnet.nodes.onflow.org:9001 \
--dynamic-startup-access-publickey=28a0d9edd0de3f15866dfe4aea1560c4504fe313fc6ca3f63a63e4f98d0e295144692a58ebe7f7894349198613f65b2d960abf99ec2625e247b1c78ba5bf2eae \
--dynamic-startup-epoch-phase=EpochPhaseStaking
```

</TabItem>
<TabItem value="testnet" label="Testnet">

```shell
$PWD/flow-go/flow_access_node \
--nodeid=e1a8b231156ab6f2a5c6f862c933baf5e5c2e7cf019b509c7c91f4ddb0a13398 \
--bootstrapdir=$PWD/bootstrap \
--datadir=$PWD/data/protocol \
--secretsdir=$PWD/data/secrets \
--execution-data-dir=$PWD/data/execution_data \
--rpc-addr=0.0.0.0:9000 \
--secure-rpc-addr=0.0.0.0:9001 \
--http-addr=0.0.0.0:8000 \
--rest-addr=0.0.0.0:8070 \
--admin-addr=localhost:9002 \
--bind=0.0.0.0:3569 \
--dht-enabled=false \
--grpc-compressor=gzip \
--profiler-dir=$PWD/data/profiler \
--dynamic-startup-access-address=secure.testnet.nodes.onflow.org:9001 \
--dynamic-startup-access-publickey=ba69f7d2e82b9edf25b103c195cd371cf0cc047ef8884a9bbe331e62982d46daeebf836f7445a2ac16741013b192959d8ad26998aff12f2adc67a99e1eb2988d \
--dynamic-startup-epoch-phase=EpochPhaseStaking
```

</TabItem>
</Tabs>

For a more mature setup, it is recommended that you run the container using systemd as described [here](../../node-operation/node-setup.md#systemd)

> 🚀 The access node should now be up and running, and you should be able to query the node using Flow CLI or curl,
Expand Down
2 changes: 1 addition & 1 deletion docs/networks/node-ops/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Launch an access node using QuickNode

:::info

To run a self-hosted access node, follow this [guide](./access-onchain-data/access-nodes/access-node-setup.md)
To run a self-hosted access node, follow this [guide](./access-onchain-data/access-nodes/access-node-setup.mdx)

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/networks/node-ops/node-operation/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 1

Anyone can run an [observer node](../access-onchain-data/light-nodes/observer-node.md).

Anyone can run an Access Node after registering and staking. See [Access Node Setup](../access-onchain-data/access-nodes/access-node-setup.md) for detailed instructions.
Anyone can run an Access Node after registering and staking. See [Access Node Setup](../access-onchain-data/access-nodes/access-node-setup.mdx) for detailed instructions.

For the other node roles, individuals can go through an application process that involves asking about their background and experience contributing to decentralized projects. To pursue an application, please visit [the Flow website here to apply](https://www.onflow.org/node-validators).

Expand Down
2 changes: 1 addition & 1 deletion docs/networks/node-ops/node-operation/node-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: How to get started running a node on Flow
sidebar_position: 8
---

This guide is for getting a new node staked and running on Flow other than a permissionless Access node. For running a permissionless Access node see [Access node setup](../access-onchain-data/access-nodes/access-node-setup.md). For sporking documentation for existing node operators, see [Spork Process](./spork.md).
This guide is for getting a new node staked and running on Flow other than a permissionless Access node. For running a permissionless Access node see [Access node setup](../access-onchain-data/access-nodes/access-node-setup.mdx). For sporking documentation for existing node operators, see [Spork Process](./spork.md).

## Timing

Expand Down
2 changes: 1 addition & 1 deletion docs/networks/node-ops/node-operation/node-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 12
---

This guide is for running a Collection, Consensus, Verification and Execution node.
If you are planning to run an Access node then refer to [access node setup](../access-onchain-data/access-nodes/access-node-setup.md).
If you are planning to run an Access node then refer to [access node setup](../access-onchain-data/access-nodes/access-node-setup.mdx).

First you'll need to provision a machine or virtual machine to run your node software. Please see follow the [node-provisioning](./node-provisioning.md) guide for it.

Expand Down
3 changes: 2 additions & 1 deletion docs/tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ description: Essential tools for the Flow blockchain ecosystem
---

import DocCardList from '@theme/DocCardList';
import { useDocsSidebar, isSamePath } from '@docusaurus/theme-common/internal';
import { isSamePath } from '@docusaurus/theme-common/internal';
import { useDocsSidebar } from '@docusaurus/plugin-content-docs/client';
import { useLocation } from '@docusaurus/router';

<DocCardList items={[
Expand Down
3 changes: 1 addition & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ require('dotenv').config();
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

const theme = require('shiki/themes/nord.json');
const { remarkCodeHike } = require('@code-hike/mdx');

const path = require('path');
Expand Down Expand Up @@ -180,7 +179,7 @@ const config = {
beforeDefaultRemarkPlugins: [
[
remarkCodeHike,
{ theme, lineNumbers: true, showCopyButton: true },
{ theme: 'nord', lineNumbers: true, showCopyButton: true },
],
],
sidebarPath: require.resolve('./sidebars.js'),
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"typecheck": "tsc"
},
"dependencies": {
"@code-hike/mdx": "^0.8.2",
"@docusaurus/core": "^3.0.0",
"@docusaurus/plugin-client-redirects": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"@docusaurus/types": "^3.0.0",
"@code-hike/mdx": "^0.9.0",
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-client-redirects": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@docusaurus/types": "^3.5.2",
"@floating-ui/react-dom": "1.3.0",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
Expand All @@ -36,7 +36,7 @@
"clsx": "^1.2.1",
"date-fns": "2.29.3",
"discord.js": "14.8.0",
"docusaurus-theme-search-typesense": "^0.13.1",
"docusaurus-theme-search-typesense": "^0.20.0",
"dotenv": "16.0.3",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
Expand All @@ -45,16 +45,17 @@
"prism-react-renderer": "^1.3.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redocusaurus": "^1.6.4",
"redocusaurus": "^2.1.1",
"rehype-katex": "4",
"remark-math": "3",
"shiki": "1.14.1",
"tailwind-scrollbar-hide": "1.1.7",
"tailwindcss": "^3.3.5",
"webpack-merge": "5.8.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0",
"@tsconfig/docusaurus": "^2.0.2",
"@docusaurus/module-type-aliases": "^3.5.2",
"@tsconfig/docusaurus": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"concurrently": "^8.2.1",
"eslint": "^8.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/theme/DocCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Link from '@docusaurus/Link';
import {
findFirstSidebarItemLink,
useDocById,
} from '@docusaurus/theme-common/internal';
} from '@docusaurus/plugin-content-docs/client';
import isInternalUrl from '@docusaurus/isInternalUrl';
import { translate } from '@docusaurus/Translate';
import type { Props } from '@theme/DocCard';
Expand Down
Loading

0 comments on commit 1522cbe

Please sign in to comment.