Skip to content
Official NEAR Protocol client.
Branch: master
Clone or download
ilblackdragon Factored out Authority into POA and ThresholdedPOS authorities (#752)
* Factored out Authority into POA and ThresholdedPOS authorities
Latest commit a134082 Mar 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add weekly digest config for fri (#730) Mar 15, 2019
core More protos (#744) Mar 21, 2019
docker
docs New logo (#533) Feb 7, 2019
nearlib Enable failing on incorrectly signed blocks, fix tests (#748) Mar 21, 2019
node Factored out Authority into POA and ThresholdedPOS authorities (#752) Mar 22, 2019
ops
protos
pynear pynear: fix json compatibility issue with py3.5 (#678) Mar 8, 2019
scripts Enable clippy (#675) Mar 6, 2019
test-utils
tests
.dockerignore docker + chain-spec-builder + localnet spawner (#240) Dec 20, 2018
.gitattributes
.gitignore protobuf for TransactionBody (#431) Jan 29, 2019
.gitlab-ci.yml
ATTRIBUTIONS.md
Cargo.lock
Cargo.toml
LICENSE Initial commit Oct 2, 2018
README.md
build.rs protobuf for TransactionBody (#431) Jan 29, 2019
rustfmt.toml Fix authority keys, NAT network, sync & produce blocks integration wo… Mar 2, 2019

README.md

NEAR Protocol - scalable and usable blockchain

Build status dependency status Join the community on Spectrum Discord

NEAR Protocol is a new smart-contract platform that delivers scalability and usability.

Through sharding, it will linearly scale with the number of validation nodes on the network.

Leveraging WebAssembly, TypeScript, more sane contract management, ephemeral accounts and many other advancements, NEAR finally makes using a blockchain protocol easy for both developers and consumers.

Quick start

Check out quick start documentation, specifically:

Develop and deploy contracts without any setup required using NEARStudio:

NEAR Studio Demo

Status

This project is currently under heavy development. Please see Issues and Milestones to checkout the current progress and work items.

High level milestones:

  • DevNet: a tool with fully working State Transition + WebAssembly.
  • AlphaNet: Multi-node smart-contract platform.
  • BetaNet: Added economics and enchanced security.
  • TestNet: added governance module, ready to launch as MVB
  • MainNet: Launched as Minimum Viable Blockchain.
  • Shard chains: Support for scalable sharding.

Development

This repo contains the core NEAR Protocol node client. It is written using the Rust language and contains a Python-based wrapper for interfacing to it.

Setup rust

$ curl https://sh.rustup.rs -sSf | sh
$ rustup component add clippy-preview

You may need to activate the environment via . ~/.cargo/env to use cargo.

Install dependencies

Mac OS:

brew install protobuf

Ubuntu:

apt-get install protobuf-compiler

Build & Run from source code

# Download NEAR Core code.
git clone https://github.com/nearprotocol/nearcore
cd nearcore

It will build the first time and then run:

cargo run

or

cargo run --package=devnet

Testing

In order to run tests currently, you must setup pynear:

cd pynear
# sudo may be required if you are not testing with a python virtual environment
python setup.py develop

Logging

For runnable apps (devnet, nearcore, etc.), you can use the --log-level option to configure the log level across all internal crates. You can also use the RUST_LOG environment variable, with env_logger semantics to override the log level for specific targets. RUST_LOG can also be used in integration tests which spawn runnable apps.

Example:

$ RUST_LOG=runtime=debug cargo run -- --log-level warn

To add new target (e.g. info!(target: "my target", "hello")), add the desired target to the list in node/cli/src/service.rs in configure_logging function.

Contributions

If you are planning to contribute, there are few more things to setup

Setup git hooks

./scripts/setup_hooks.sh

Setup rustfmt for your editor (optional)

Installation instructions here

Lints

We currently use clippy to enforce certain standards. This check is run automatically during CI builds, and in a pre-commit hook. You can run do a clippy check with ./scripts/run_clippy.sh.

You can’t perform that action at this time.