Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/community/contribute/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ As part of the NEAR contributor program
If you are interested in testing our documentation, guides and developer tools, head over to the following pages. We would love to jump on a call and get to know your insights, or you can submit directly issues in the respective repositories on GitHub. For more information on where and how to file issues, please head over to our [developer contribution section.](/docs/community/contribute/how-to-contribute)

- [Developer tools](/docs/develop/basics/create-account)
- [Local development](/docs/develop/node/running-a-node)
- [Local development](/docs/develop/node/validator/running-a-node)
- [Introduction to near-api-js](/docs/develop/front-end/introduction)

#### Development
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts/networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ NEAR Protocol operates on several networks each operating with their own indepen
* [`testnet`](/docs/concepts/networks#testnet)
* [`betanet`](/docs/concepts/networks#betanet)
* [`localnet`](/docs/concepts/networks#localnet)

---

## `mainnet`
Expand Down Expand Up @@ -53,7 +53,7 @@ NEAR Protocol operates on several networks each operating with their own indepen

> LocalNet is intended for developers who want to work with the NEAR platform independent of the public blockchain. You will need to generate nodes yourself.

More on local development [here](/docs/develop/node/running-a-node)
More on local development [here](/docs/develop/node/validator/running-a-node)

`near-cli` [network selection](/docs/tools/near-cli#network-selection) variable is `local`

Expand Down
2 changes: 1 addition & 1 deletion docs/develop/front-end/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ If you prefer a more experimental and rapid approach, try the following:

1. Explore [NEAR Examples](http://near.dev/) to deploy one of several sample applications in minutes. You will be able to deploy them using Gitpod's web-hosted environment, modify the code, play with them in the browser there and view transactions on the blockchain via an explorer or wallet. You can modify this code into your own apps.
2. Use your own development environment to create dApps
1. Beginner level setup (recommended): [TestNet](/docs/develop/node/running-a-node)
1. Beginner level setup (recommended): [TestNet](/docs/develop/node/validator/running-a-node)
3. Follow our introductory [JavaScript library Guides](/docs/tutorials/front-end/naj-examples) to
1. Create an account
2. Authenticate with NEAR CLI
Expand Down
55 changes: 55 additions & 0 deletions docs/develop/node/archival/hardware-archival.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
id: hardware-archival
title: Hardware Requirements for Archival Node
sidebar_label: Hardware Requirements
description: NEAR Archival Node Hardware Requirements
---

This page covers the minimum and recommended hardware requirements for engaging with the NEAR platform as an Archival node.


## Recommended Hardware Specifications

| Hardware | Recommended Specifications |
| -------------- | ----------------------------------------------------------------------- |
| CPU | 4-Core (8-Thread) Intel i7/Xeon or equivalent with AVX support |
| RAM | 16GB DDR4 |
| Storage | 2 Terabyte SSD |

_Verify AVX support on Linux by issuing the command ```$ lscpu | grep -oh avx```. If the output is empty, your CPU is not supported._


## Minimal Hardware Specifications

| Hardware | Minimal Specifications |
| -------------- | -------------------------------------------------------------------------- |
| CPU | 4-Core (8-Thread) Intel i7/Xeon or equivalent with AVX support |
| RAM | 8GB DDR4 |
| Storage | 1.5 Terabyte SSD |

_Verify AVX support on Linux by issuing the command ```$ lscpu | grep -oh avx```. If the output is empty, your CPU is not supported._

## Cost Estimation

Estimated monthly costs depending on operating system:

| Cloud Provider | Machine Size | Linux |
| -------------- | --------------- | ---------------------- |
| AWS | c5.2xlarge | $150 CPU + $20 storage |
| GCP | c2-standard-8 | $250 CPU + $20 storage |
| Azure | Standard_F8s_v2 | $180 CPU + $10 storage |

<blockquote class="info">
<strong>Resources for Cost Estimation</strong><br><br>

All prices reflect *reserved instances* which offer deep discounts on all platforms with a 1 year commitment

- AWS
- cpu: https://aws.amazon.com/ec2/pricing/reserved-instances/pricing
- storage: https://aws.amazon.com/ebs/pricing
- GCP
- cpu: https://cloud.google.com/compute/vm-instance-pricing
- storage: https://cloud.google.com/compute/disks-image-pricing
- Azure — https://azure.microsoft.com/en-us/pricing/calculator

</blockquote>
51 changes: 51 additions & 0 deletions docs/develop/node/community/node-community-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
id: node-community-updates
title: Node Community Updates
sidebar_label: Node Community Updates
description: NEAR Node and Validator Community Updates
---

## NEAR Validator Community Channels

NEAR Protocol will communicate with validators using these channels:

1. Releases of `nearcore` are on Github repository of [`nearcore`](https://github.com/near/nearcore/issues).

2. Bugs and feature enhancements are tracked in the Github project tracker [`Node Experience`](https://github.com/orgs/near/projects/18). Node operators are welcome to create new issues for features and bugs, and to add these issues into the [Github project tracker](https://github.com/orgs/near/projects/18).
- **New feature / Enhancement requests:**
- Please create a [`Github issue`](https://github.com/near/nearcore/issues)
- Tag `nodeX`
- Filter them through `Incoming Requests` column in the Github project tracker [`Node Experience`](https://github.com/orgs/near/projects/18), where they will be groomed and moved into `Backlog` based on priority
- **Bug reports:**
- Please create a [`Github issue`](https://github.com/near/nearcore/issues)
- Tag `nodeX` and `Bug`
- Put it at the top of the `Incoming Requests` column for more immediate attention in the Github project tracker [`Node Experience`](https://github.com/orgs/near/projects/18)
Comment on lines +14 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-NEAR members cannot label issues or move issues on those boards. We need to create GitHub templates with the pre-set labels to let people create the issues with the specific labels.


3. Technical support and troubleshooting by the NEAR team are available in the Validator Channels on [Discord](https://discord.gg/ZMPr3VB) and on [Telegram](https://t.me/near_validators).

4. Discussions on upcoming changes and early ideation are on [gov.near.org](https://gov.near.org/c/staking-delegation/5).


<blockquote class="info">
<strong>Heads up</strong><br><br>

As a node operator, you are welcome to create bugs and feature requests on Github to improve the experience of running a node. Head to [`nearcore`](https://github.com/near/nearcore/issues) repository on Github to open an issue, and don't forget to tag the issue with the `nodeX` tag.

</blockquote>



**Runtime Alerts:**

To keep our network healthy and minimize the damage of potential incidents, the NEAR team would like to establish a process with which we communicate updates and emergency situations with validators so that they can respond promptly to properly sustain the operations of the network. To this end, we propose that we use different tags in important messages to validators so that they can be easily picked up by automated systems on validators’ end.

The tags we propose are as follows:

`[CODE_RED_<network_id>]` where `<network_id>` is either `MAINNET` or `TESTNET`. This represents the most dire and urgent situation. Usually it means that the network has stalled or crashed and we need validators to take **immediate** actions to bring the network up. Alternatively it could mean that we discovered some highly critical security vulnerabilities and a patch is needed as soon as possible. If it is about mainnet, we expect that validators will react immediately to such alerts, ideally within 30 minutes.

`[CODE_YELLOW_<network_id>]` where `<network_id>` is either `MAINNET` or `TESTNET`. This represents a less urgent announcement. Usually it means the release of a protocol change or a fix of a moderate security issue. In such cases, validators are not expected to take immediate actions but are still expected to react within days.

`[CODE_GREEN_<network_id>]` where `<network_id>` is either `MAINNET` or `TESTNET`. This usually means some general announcement that is more informational or doesn’t require actions within a short period of time. It could be an announcement of a release that improves performance or a fix some minor issues.


Call-to-actions for technical teams if the network is stalling and there's the need to coordinate a manual node restart. Such messages begin with `[CODE_RED_BETANET]` or `[CODE_RED_TESTNET]`, and will be posted in the read-only Validator Announcement channel on [Discord](https://discord.gg/xsrHaCb). The same message may be repeated in other channels, to have higher outreach.
28 changes: 14 additions & 14 deletions docs/validator/keys.md → docs/develop/node/intro/keys.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
---
id: keys
title: Keys on the NEAR Platform
sidebar_label: Understanding Keys
title: Key Management
sidebar_label: Key Management
description: NEAR Node Key Management
---

## what are keys?
## What are Keys?

In public key cryptography we need a key pair, one public and one private, to sign and send verifiable transactions across the network. NEAR takes the common approach of using public keys for identity and private keys for signatures. Internally the NEAR platform uses ed25519, one of several "elliptic curves" that produce secure cryptographic results quicky. Specifically, we use `tweetnacl` in JavaScript and `libsodium` in Rust.
In public key cryptography, there is a key pair, one public and one private, to sign and send verifiable transactions across the network. NEAR takes the common approach of using public keys for identity and private keys for signatures. Internally the NEAR platform uses ed25519, one of several "elliptic curves" that produce secure cryptographic results quicky. Specifically, we use `tweetnacl` in JavaScript and `libsodium` in Rust.

## are there different kinds of keys?
## Are there Different Types of Keys?

There are 3 types of key pairs on the NEAR platform

- signer keys (aka. account keys, access keys, etc)
- validator keys
- node keys
- Signer Keys (aka. account keys, access keys, etc)
- Validator Keys
- Node Keys

**Signer keys** are the ones we all know and love. They're used by all accounts on the network to sign transactions like `sendMoney` and `stake` before sending them to the network. Signer keys are not related to running a node in any way. End users who sign up through the [NEAR Wallet](https://wallet.betanet.near.org/) get their own signer keys, for example. These are the keys that humans think about and keep safe.
**Signer Keys** are the ones we all know and love. They're used by all accounts on the network to sign transactions like `sendMoney` and `stake` before sending them to the network. Signer keys are not related to running a node in any way. End users who sign up through the [NEAR Wallet](https://wallet.betanet.near.org/) get their own signer keys, for example. These are the keys that humans think about and keep safe.

There are two flavors of signer keys currently available, `FullAccess` keys and `FunctionCall` keys. The first has unrestricted control to "act on behalf of an account" (as used by NEAR CLI and NEAR Wallet to get things done for you). The second is limited to contract storage and compute. Both flavors of keys can be revoked by the account holder. There is no limit to the flavors of keys that the NEAR platform can handle so we can easily imagine keys for voting, shopping, conducting official business, etc. each with their own access controls on our data, programmable time limits, etc. But keep in mind that you do have to pay rent on keys issued to your account.

**Validator keys** are used by validators (people and companies who are committed to maintaining the integrity of the system) to support their work of validating blocks and chunks on the network, nothing more. The human validators don't think about these keys beyond creating them and resetting them. Once added to a validator's node, validator keys are used by the node to do their thing of validating blocks and chunks. As a convenience to validators, validator keys are currently produced by a script at node startup if they don't already exist (in the case of NEAR Stake Wars, the `start_stakewars.py` script) but this may change.
**Validator Keys** are used by validators (people and companies who are committed to maintaining the integrity of the system) to support their work of validating blocks and chunks on the network, nothing more. The human validators don't think about these keys beyond creating them and resetting them. Once added to a validator's node, validator keys are used by the node to do their thing of validating blocks and chunks. As a convenience to validators, validator keys are currently produced by a script at node startup if they don't already exist (in the case of NEAR Stake Wars, the `start_stakewars.py` script) but this may change.

**Node keys** are something no humans on the network think about except core contributors to the platform. These keys are used internally by a node to sign low-level communications with other nodes in the network like sending block headers or making other verifiable requests. Node keys are currently provided to a node at startup by a script. In the case of NEAR Stake Wars it's the `start_stakewars.py` script that produces these keys for now, but this may change.
**Node Keys** are something no humans on the network think about except core contributors to the platform. These keys are used internally by a node to sign low-level communications with other nodes in the network like sending block headers or making other verifiable requests. Node keys are currently provided to a node at startup by a script. In the case of NEAR Stake Wars it's the `start_stakewars.py` script that produces these keys for now, but this may change.

## can keys be changed?
## Can Keys be Changed?

Yes, but only in that keys can be _reset_ (ie. regenerated as a new key pair). If a private key is lost or compromised somehow then a new key pair must be generated. This is just the nature of secure keys.

Expand All @@ -35,7 +36,7 @@ Yes, but only in that keys can be _reset_ (ie. regenerated as a new key pair). I
**Nodes** should not need to reset their node keys.

<blockquote class="info">
<strong>did you know?</strong><br><br>
<strong>Did you know?</strong><br><br>

As a brief word on the NEAR runtime, the subsystem that manages state transitions on the blockchain (ie. keeping things moving from one block to the next), it's worth understanding that the movement of the system happens in stages, called epochs, during which the group of validators does not change. The [Nightshade whitepaper](https://near.org/downloads/Nightshade.pdf) introduces epochs this way: "the maintenance of the network is done in epochs, where an epoch is a period of time on the order of days." and there's much more detail in the paper.

Expand All @@ -55,7 +56,6 @@ If validator keys are changed _during an epoch in which the validator is staking
For concrete examples of keys being used as identifiers, you can see a list of validators and active nodes on various NEAR networks here:

- NEAR TestNet (staking currently disabled)

- https://rpc.testnet.near.org/status
- https://rpc.testnet.near.org/network_info

Expand Down
17 changes: 17 additions & 0 deletions docs/develop/node/intro/types-of-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
id: types-of-node
title: Types of Node
sidebar_label: Types of Node
description: Types of NEAR Node
---

You can run three different types of node - Validator Node, RPC Node, and Archival Node.

## Validator Node
Validator Nodes are the operators of the NEAR blockchain and are essential to the health of the network. Validator nodes participate in the consensus and produce blocks and/or chunks"

## RPC Node
RPC Nodes are RPC service providers for that provide public RPC endpoints for developers to use. The NEAR Foundation currently maintains a public RPC endpoint `http://rpc.mainnet.near.org/` that is free for everyone to use. However, any participants are encouraged to run their own RPC node and offer RPC services through a grant from the NEAR Foundation. For more information, please reach out in Validator channels on Telegram or Discord.

## Archival Node
Archival Nodes store full blockchain data, and build an archive of historical states. These nodes are useful for block explorers, chain analytics, and infrastructure providers.
23 changes: 23 additions & 0 deletions docs/develop/node/intro/what-is-a-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
id: what-is-a-node
title: What is a Node
sidebar_label: What is a Node
description: What is a NEAR Node and Why Run a Node
---

NEAR Protocol runs on a collection of publicly maintained computers (or "nodes"). All nodes are running the same `nearcore` codebase with the latest releases available on [Github](https://github.com/near/nearcore/releases/). In the following section, we will introduce three types of nodes.

It is important to keep in mind all nodes runs the same codebase, but with different configurations. As such we have split up the instructions for running different nodes into different sections.

## Why run a Node?

You may decide to run a node of your own for a few reasons:

- To join a network as a validator running a "validator node". Running a validator node is a public good and you are effectively securing the NEAR network and earning rewards.
- To develop and deploy contracts on a node connected to `MainNet`, `TestNet` or `BetaNet` (†)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see it to be a good reason to run your own node. I think it is better to say something along these lines:

To run applications that heavily depend on RPC performance and/or availability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cost ranges from 0.10-0.35 cents depending on tyoe of SSDs which are used across providers. For 1.5TB the cost would be somewhere 150-500 dollars depending on setup.

Yes!
@chefsale May I please have some guidance and ballpark cost estimation numbers on hardware costs:

Validator node cost estimate: https://docs.near.org/docs/develop/node/validator/hardware
RPC node cost estimate: https://docs.near.org/docs/develop/node/rpc/hardware-rpc
Archival node cost estimate: https://docs.near.org/docs/develop/node/archival/hardware-archival - Is the storage cost of $150-$500 a monthly figure?

Thanks!

- To develop and deploy contracts on a local (independent and isolated) node (sometimes called "LocalNet"). (††)
- To quickly extract blockchain data that can be used for chain analytics

_( † ) `TestNet` is intended to operate as similarly to `MainNet` as possible with only stable releases while `BetaNet` follows a weekly release cycle._

_( †† ) `LocalNet` would be the right choice if you prefer to avoid leaking information about your work during the development process since `TestNet` and `BetaNet` are *public* networks. `LocalNet` also gives you total control over accounts, economics and other factors for more advanced use cases (ie. making changes to `nearcore`)._
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we stick to lowercase naming (testnet, betanet, localnet), please, double-check with @bowenwang1996 and @thisisjoshford

Copy link
Contributor Author

@janewang janewang Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we stick to lowercase naming (testnet, betanet, localnet), please, double-check with @bowenwang1996 and @thisisjoshford

Yes, I was thinking of the same naming convention while reading the docs. Sometimes they are TitleCase, sometimes camelCase, and sometimes lowercase. In code, they seem to be consistently lowercase. I will convert all to lowercase for consistency.

Loading