nearup
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
:warning: 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
:warning: 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
:warning: 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
:warning: 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
:warning: 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
Metadata
Release files for nearup 1.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nearup-1.16.0.tar.gz | 16.7 kB | Without provenance | Details for nearup-1.16.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nearup-1.16.0-py3-none-any.whl | Python 3 | none | any | Details for nearup-1.16.0-py3-none-any.whl |
Total release size: 38.6 kB
Release files / nearup-1.16.0.tar.gz
| Download URL | nearup-1.16.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69e4ec3de99d0c5adf762ab86d04682c86a817fa1020d45e37fdbd25a508e8d6
|
|
BLAKE2b-256 checksum How to use checksums |
e0ba847f0fb6af6d9afe210dbbf44daad1534cd9e306bae8c4331e043c653b93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / nearup-1.16.0-py3-none-any.whl
| Download URL | nearup-1.16.0-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5162e564a5386ec71668b75c3f8caa1b4c236188d04176fe47593f1d50579ea9
|
|
BLAKE2b-256 checksum How to use checksums |
eac6a3248b346b25db4bc182418329f3dfcff908a02550fddfabdd1925282050
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Security for nearup 1.16.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.