• This repository has been archived on 21/Sep/2023
  • Stars
    star
    104
  • Rank 320,284 (Top 7 %)
  • Language
    Python
  • Created about 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Public scripts to launch NEAR Protocol betanet and testnet node

nearup

PyPI version

Launch NEAR betanet and testnet nodes.

Prepare

Before you proceed, make sure you have Python 3 and pip3 installed.

On ubuntu, you can install with,

sudo apt update
sudo apt install python3 python3-pip python3-dev

⚠️ Upgrade pip if needed you are getting a Permission Denied error or version of pip (pip3 --version) is below 20.

pip3 install --upgrade pip

Install

⚠️ Make sure that you are installing with the --user flag.

pip3 install --user nearup

Verify that you local installation is in python3 -m site --user-base under bin directory by running:

which nearup

⚠️ If the above returns nothing, add nearup to your $PATH in ~/.profile, ~/.bashrc, or appropriate shell config.

USER_BASE_BIN=$(python3 -m site --user-base)/bin
export PATH="$USER_BASE_BIN:$PATH"

Upgrade

⚠️ If you have already installed nearup, you can upgrade to the latest version by using the command below

pip3 install --user --upgrade nearup

Getting Started

Using the official binary

This is recommended for running on servers

You can start your node with (remove the --interactive flag if you don't want to be prompted):

nearup run betanet --interactive

Replace betanet if you want to use a different network.

Using a locally compiled binary

Recommended for security critical validators or during development.

Clone and compile nearcore with make release or make debug first.

nearup run betanet --binary-path path/to/nearcore/target/{debug, release}

Replace betanet with testnet if you want to use a different network.

Spawn a local network

Clone and compile nearcore with make release or make debug first.

nearup run localnet --binary-path path/to/nearcore/target/{debug, release}

By default it will spawn 4 nodes validating in 1 shard. RPC ports of each nodes will be consecutive starting from 3030. Access one node status using http://localhost:3030/status

Operating

Stop a running node or all running nodes in local network

nearup stop

Additional options

nearup run betanet --help

Docker

Building the docker image

docker build . -t nearprotocol/nearup

Pull the docker image

If you don't want to build a docker image locally, you can pull the latest from Docker Hub,

docker pull nearprotocol/nearup

Running nearup with Docker

⚠️ nearup and neard are running inside the container, to ensure you don't lose your data which should live on the host you have to mount the ~/.near folder. To run the nearup docker image run:

docker run -v $HOME/.near:/root/.near -p 3030:3030 --name nearup nearprotocol/nearup run betanet

Running in detached mode

To run nearup in docker's detached (non-blocking) mode, you can add -d to the docker run command,

docker run -v $HOME/.near:/root/.near -p 3030:3030 -d --name nearup nearprotocol/nearup run betanet

Check if the container is running

docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS           PORTS               NAMES
fc17f7f7fae0        nearup              "/root/start.sh run …"   3 minutes ago       Up 3 minutes     324324         mystifying_moore

Execute nearup commands in container

To execute other nearup commands like logs, stop, run, you can use docker exec,

docker exec nearup nearup logs
docker exec nearup nearup stop
docker exec nearup nearup run {betanet/testnet}

(The container is running in a busy wait loop, so the container won't die.)

nearup logs

To get the neard logs run:

docker exec nearup nearup logs

or,

docker exec nearup nearup logs --follow

To get the nearup logs run:

docker logs -f nearup

Stop the docker container

docker kill nearup

Development

To build a development image:

docker build . -t nearprotocol/nearup:dev

The following will mount your repo directory into the running container and drop you into a shell to run test commands.

docker run -it --entrypoint "" -v $PWD:/root/nearup -v $HOME/.near:/root/.near -w /root/nearup nearprotocol/nearup:dev bash

Common commands

For testing and other checks, nearup uses tox.

To install,

pip3 install --user tox

Unit tests

tox

Unit tests w/ coverage

tox -e coverage

Linter checks

tox -e lint

Python style checks

tox -e style

More Repositories

1

nearcore

Reference client for NEAR Protocol
Rust
2,265
star
2

near-sdk-rs

Rust library for writing NEAR smart contracts
Rust
432
star
3

borsh

Binary Object Representation Serializer for Hashing
430
star
4

near-api-js

JavaScript library to interact with NEAR Protocol via RPC API
TypeScript
379
star
5

create-near-app

Create a starter app hooked up to the NEAR blockchain
TypeScript
339
star
6

core-contracts

Core contracts: reference staking pool, lockup, voting, whitelist, multisig.
Rust
316
star
7

borsh-rs

Rust implementation of Binary Object Representation Serializer for Hashing
Rust
268
star
8

near-wallet

Web wallet for NEAR Protocol which stores keys in browser's localStorage
JavaScript
209
star
9

near-sdk-js

Tools for building NEAR smart contracts in JavaScript
TypeScript
192
star
10

NEPs

The Near Enhancement Proposals repository
JavaScript
190
star
11

near-cli

General purpose command line tools for interacting with NEAR Protocol
JavaScript
190
star
12

assemblyscript-json

JSON encoder / decoder for AssemblyScript
TypeScript
163
star
13

docs

NEAR Protocol Documentation
SCSS
134
star
14

wallet-selector

This is a wallet selector modal that allows users to interact with NEAR dApps with a selection of available wallets.
TypeScript
127
star
15

near-indexer-for-explorer

Watch NEAR network and store all the data from NEAR blockchain to PostgreSQL database
Rust
124
star
16

near-sdk-as

Tools for building NEAR smart contracts in AssemblyScript
TypeScript
114
star
17

stakewars-iii

Stake Wars: Episode 3 challenges and place to report issues
89
star
18

borsh-js

TypeScript/JavaScript implementation of Binary Object Representation Serializer for Hashing
JavaScript
89
star
19

near-cli-rs

near CLI is your human-friendly companion that helps to interact with NEAR Protocol from command line.
Rust
82
star
20

near-explorer

NEAR blockchain explorer
TypeScript
82
star
21

near-workspaces-rs

Write tests once, run them both on NEAR TestNet and a controlled NEAR Sandbox local environment via Rust
Rust
81
star
22

bounties

Specs for technical and non-technical work that earns NEAR tokens
74
star
23

near-linkdrop

Contract to drop tokens via link
Rust
55
star
24

near-api-py

Python API to interact with NEAR via RPC API
Python
51
star
25

near-lake-framework-rs

Library to connect to the NEAR Lake S3 and stream the data
Rust
45
star
26

near-jsonrpc-client-rs

Lower-level API for interfacing with the NEAR Protocol via JSONRPC.
Rust
45
star
27

borsh-go

Go implementation of Binary Object Representation Serializer for Hashing
Go
44
star
28

near-discovery

NEAR is the BOS
HTML
44
star
29

near-lake-indexer

Watch NEAR network and store all the events as JSON files on AWS S3
Rust
42
star
30

near-workspaces-js

Write tests once, run them both on NEAR TestNet and a controlled NEAR Sandbox local environment
TypeScript
41
star
31

sandbox

Easily run a local NEAR blockchain
TypeScript
40
star
32

ecosystem

Community-sourced and curated data for the NEAR Ecosystem.
Python
39
star
33

near-sdk-contract-tools

Helpful functions and macros for developing smart contracts on NEAR Protocol.
Rust
36
star
34

community

Coordination repository of Near Community
36
star
35

awesome-near

Curated list of resources: examples, libraries, projects
TypeScript
36
star
36

near-seed-phrase

Utilities to work with NEAR Protocol key pairs based on BIP39 seed phrases
JavaScript
35
star
37

near-contract-helper

Micro-service used by NEAR Wallet to store & send recovery methods
JavaScript
35
star
38

near-evm

Obsolete EVM contract experiments. Find current development at: https://github.com/aurora-is-near/aurora-engine
Rust
33
star
39

fast-auth-signer

TypeScript
27
star
40

wiki

NEAR Wiki
JavaScript
26
star
41

cargo-near

Cargo extension for building Rust smart contracts on NEAR
Rust
26
star
42

near-lake-framework-js

JS Library to connect to the NEAR Lake S3 and stream the data
TypeScript
25
star
43

mpc-recovery

Rust
25
star
44

borsh-construct-py

Python implementation of Binary Object Representation Serializer for Hashing
Python
25
star
45

pagoda-relayer-rs

Rust Reference Implementation of Relayer for NEP-366 Meta Transactions
Rust
23
star
46

corgis

simple solution for corgi NFT
JavaScript
22
star
47

near-api-swift

Interact with NEAR blockchain from iOS and OS X apps using Swift
Swift
22
star
48

wasmer

🚀 The leading WebAssembly Runtime supporting WASI and Emscripten
Rust
21
star
49

rollup-data-availability

NEAR as data availability!
Rust
21
star
50

near-analytics

Python
20
star
51

sdk-docs

The book about near-sdk-rs
JavaScript
20
star
52

neardevhub-widgets

NEAR DevHub UI hosted on NEAR BOS
JavaScript
20
star
53

DX

Developer Experience building on NEAR
20
star
54

near-api-kotlin

Kotlin
20
star
55

bos-web-engine

Improved execution layer for NEAR decentralized frontend components
TypeScript
19
star
56

finite-wasm

Cheating a little to solve the halting problem at scale
WebAssembly
18
star
57

bos-loader

Rust
18
star
58

near-enhanced-api-server

Rust
18
star
59

queryapi

Near Indexing as a Service
Rust
14
star
60

near-redpacket

NEAR Redpacket based on NEAR Linkdrop
CSS
14
star
61

near-vscode

https://marketplace.visualstudio.com/items?itemName=near-protocol.near-discovery-ide
JavaScript
14
star
62

read-rpc

Read-only NEAR RPC centralized-like performant solution
Rust
14
star
63

neardevhub-contract

NEAR DevHub contract
Rust
11
star
64

near-sdk-js-template-project

A starting point to write, build and test JavaScript smart contract
JavaScript
11
star
65

devx

This is the home of NEAR collective developer experience plans and roadmap.
11
star
66

rainbow-bridge-lib

JavaScript
10
star
67

rainbow-bridge-sol

Solidity
10
star
68

borshj

Borsh binary serialization format support for Java.
Java
10
star
69

near-memory-tracker

near-memory-tracker
Rust
10
star
70

node-docs

NEAR Nodes documentation
CSS
10
star
71

near-discovery-components

This is a repository that holds the source code of all NEAR discovery components that the team maintains for near.org.
JavaScript
10
star
72

devrel

The space for DevRel
9
star
73

rainbow-bridge-rs

Rust
9
star
74

units-js

Easily parse and format NEAR Tokens and gas units
TypeScript
9
star
75

stakewars-iv

Shell
9
star
76

abi

NEAR contract schema and tooling
8
star
77

near-microindexers

Rust
8
star
78

near-api-unity

Port of https://github.com/near/near-api-js to Unity
C#
8
star
79

near-wallet-roadmap

near-wallet-roadmap
8
star
80

cargo-near-new-project-template

temp project to become part of `cargo near new` command
Rust
8
star
81

near-drop-demo

JavaScript
7
star
82

near-indexer-events

Rust
7
star
83

near-sdk-abi

ABI utilities used for generating Rust SDK cross-contract calls
Rust
6
star
84

repro-near-funcall

Repro near function call actions with local near-vm-runner-standalone
JavaScript
6
star
85

as-base64

Encode and Decode base64 strings in AssemblyScript
WebAssembly
6
star
86

near-indexer-for-wallet

Rust
6
star
87

near-ledger-js

Connect to NEAR Ledger app from browser
JavaScript
6
star
88

boilerplate-template-keypom

A github template repository of an end-to-end application that demonstrates minimal UI to build a lazy-minted NFT link drop using Keypom
TypeScript
6
star
89

near-abi-rs

NEAR smart contract ABI primitives
Rust
6
star
90

near-abi-client-rs

Library to generate Rust client code from NEAR ABI
Rust
5
star
91

wasm_sizer

Python
5
star
92

discovery-docs

NEAR Discovery Documentation
JavaScript
5
star
93

local

5
star
94

near-api-helper

Cloudflare worker that can batch RPC calls
JavaScript
5
star
95

boilerplate-template-rs

TypeScript
5
star
96

near-blake2

Pure Rust implementation of the BLAKE2 hash function family.
Rust
5
star
97

near-abi-client-js

Library to generate JavaScript/TypeScript client code from NEAR ABI
TypeScript
5
star
98

nayduck

Test Infra
Python
5
star
99

units-rs

Rust tools for parsing and printing NEAR related units
Rust
5
star
100

multisig-tool

A tool / UI to manage multisig contracts
JavaScript
5
star