From fb6becc0ad8d4f76f2becc872b1127355c72140e Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 31 May 2023 07:48:24 +0000 Subject: automatic import of python-nearup --- .gitignore | 1 + python-nearup.spec | 840 +++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 842 insertions(+) create mode 100644 python-nearup.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..a3111d3 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/nearup-1.16.0.tar.gz diff --git a/python-nearup.spec b/python-nearup.spec new file mode 100644 index 0000000..3020ec6 --- /dev/null +++ b/python-nearup.spec @@ -0,0 +1,840 @@ +%global _empty_manifest_terminate_build 0 +Name: python-nearup +Version: 1.16.0 +Release: 1 +Summary: Public scripts to launch near blockchain nodes +License: BSD License +URL: https://github.com/near/nearup +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e0/ba/847f0fb6af6d9afe210dbbf44daad1534cd9e306bae8c4331e043c653b93/nearup-1.16.0.tar.gz +BuildArch: noarch + +Requires: python3-boto3 +Requires: python3-click +Requires: python3-psutil + +%description +# nearup + +[![PyPI version](https://badge.fury.io/py/nearup.svg)](https://pypi.org/project/nearup/) + +Launch NEAR `betanet` and `testnet` nodes. + +- [Prepare](#prepare) +- [Install](#install) + * [Upgrade](#upgrade) +- [Getting Started](#getting-started) + * [Using the official binary](#using-the-official-binary) + * [Using a locally compiled binary](#using-a-locally-compiled-binary) + * [Spawn a local network](#spawn-a-local-network) +- [Operating](#operating) + * [Stop a running node or all running nodes in local network](#stop-a-running-node-or-all-running-nodes-in-local-network) + * [Additional options](#additional-options) +- [Docker](#docker) + * [Building the docker image](#building-the-docker-image) + * [Pull the docker image](#pull-the-docker-image) + * [Running `nearup` with Docker](#running-nearup-with-docker) + + [Running in detached mode](#running-in-detached-mode) + * [Check if the container is running](#check-if-the-container-is-running) + * [Execute `nearup` commands in container](#execute-nearup-commands-in-container) + * [`nearup` logs](#nearup-logs) + * [Stop the docker container](#stop-the-docker-container) +- [Development](#development) + * [Common commands](#common-commands) + +## 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 +``` + + +%package -n python3-nearup +Summary: Public scripts to launch near blockchain nodes +Provides: python-nearup +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-nearup +# nearup + +[![PyPI version](https://badge.fury.io/py/nearup.svg)](https://pypi.org/project/nearup/) + +Launch NEAR `betanet` and `testnet` nodes. + +- [Prepare](#prepare) +- [Install](#install) + * [Upgrade](#upgrade) +- [Getting Started](#getting-started) + * [Using the official binary](#using-the-official-binary) + * [Using a locally compiled binary](#using-a-locally-compiled-binary) + * [Spawn a local network](#spawn-a-local-network) +- [Operating](#operating) + * [Stop a running node or all running nodes in local network](#stop-a-running-node-or-all-running-nodes-in-local-network) + * [Additional options](#additional-options) +- [Docker](#docker) + * [Building the docker image](#building-the-docker-image) + * [Pull the docker image](#pull-the-docker-image) + * [Running `nearup` with Docker](#running-nearup-with-docker) + + [Running in detached mode](#running-in-detached-mode) + * [Check if the container is running](#check-if-the-container-is-running) + * [Execute `nearup` commands in container](#execute-nearup-commands-in-container) + * [`nearup` logs](#nearup-logs) + * [Stop the docker container](#stop-the-docker-container) +- [Development](#development) + * [Common commands](#common-commands) + +## 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 +``` + + +%package help +Summary: Development documents and examples for nearup +Provides: python3-nearup-doc +%description help +# nearup + +[![PyPI version](https://badge.fury.io/py/nearup.svg)](https://pypi.org/project/nearup/) + +Launch NEAR `betanet` and `testnet` nodes. + +- [Prepare](#prepare) +- [Install](#install) + * [Upgrade](#upgrade) +- [Getting Started](#getting-started) + * [Using the official binary](#using-the-official-binary) + * [Using a locally compiled binary](#using-a-locally-compiled-binary) + * [Spawn a local network](#spawn-a-local-network) +- [Operating](#operating) + * [Stop a running node or all running nodes in local network](#stop-a-running-node-or-all-running-nodes-in-local-network) + * [Additional options](#additional-options) +- [Docker](#docker) + * [Building the docker image](#building-the-docker-image) + * [Pull the docker image](#pull-the-docker-image) + * [Running `nearup` with Docker](#running-nearup-with-docker) + + [Running in detached mode](#running-in-detached-mode) + * [Check if the container is running](#check-if-the-container-is-running) + * [Execute `nearup` commands in container](#execute-nearup-commands-in-container) + * [`nearup` logs](#nearup-logs) + * [Stop the docker container](#stop-the-docker-container) +- [Development](#development) + * [Common commands](#common-commands) + +## 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 +``` + + +%prep +%autosetup -n nearup-1.16.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-nearup -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot - 1.16.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..e0b8845 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +56348ac51a6816e4da47393f157232f3 nearup-1.16.0.tar.gz -- cgit v1.2.3