README: rework it a little

Structure it a bit better, fix some mistakes.
This commit is contained in:
Roman Khimov 2021-03-18 12:33:42 +03:00
parent 7c50bbc649
commit 09d560e8a1

View file

@ -36,60 +36,38 @@ Neo 3 code (0.90.0 being compatible with Neo 3 preview2).
## Installation ## Installation
Go: 1.14+ NeoGo is distributed as a single binary that includes all the functionality
provided (but smart contract compiler requires Go compiler to operate). You
Install dependencies. can grab it from [releases
page](https://github.com/nspcc-dev/neo-go/releases), use a Docker image (see
`neo-go` uses [GoModules](https://github.com/golang/go/wiki/Modules) as dependency manager: [Docker Hub](https://hub.docker.com/r/nspccdev/neo-go) for various releases of
NeoGo, `:latest` points to the latest release) or build yourself.
```
make deps
```
## How to setup a node
### Docker
Each tagged build is published to docker hub and the `:latest` tag pointing at the latest tagged master build.
By default the `CMD` is set to run a node on `privnet`, so to do this simply run:
```bash
docker run -d --name neo-go -p 20332:20332 -p 20331:20331 nspccdev/neo-go
```
Which will start a node on `privnet` and expose the nodes port `20332` and `20331` for the `JSON-RPC` server.
### Building ### Building
Build the **neo-go** CLI: To build NeoGo you need Go 1.14+ and `make`:
``` ```
make build make build
``` ```
### Running The resulting binary is `bin/neo-go`.
Quick start a NEO node on the private network. ## Running a node
To build and run the private network image locally, use:
```
make env_image
make env_up
```
To start a NEO node on the private network: A node needs to connect to some network, either local one (usually referred to
``` as `privnet`) or public (like `mainnet` or `testnet`). Network configuration
make run is stored in a file and NeoGo allows you to store multiple files in one
``` directory (`./config` by default) and easily switch between them using network
flags.
To run the binary directly: To start Neo node on private network use:
``` ```
./bin/neo-go node ./bin/neo-go node
``` ```
By default the node will run on the private network, to change this: Or specify a different network with appropriate flag like this:
``` ```
./bin/neo-go node --mainnet ./bin/neo-go node --mainnet
@ -100,7 +78,18 @@ Available network flags:
- `--privnet, -p` - `--privnet, -p`
- `--testnet, -t` - `--testnet, -t`
#### Importing mainnet/testnet dump files ### Docker
By default the `CMD` is set to run a node on `privnet`, so to do this simply run:
```bash
docker run -d --name neo-go -p 20332:20332 -p 20331:20331 nspccdev/neo-go
```
Which will start a node on `privnet` and expose node's ports `20332` (P2P
protocol) and `20331` (JSON-RPC server).
### Importing mainnet/testnet dump files
If you want to jump-start your mainnet or testnet node with [chain archives If you want to jump-start your mainnet or testnet node with [chain archives
provided by NGD](https://sync.ngd.network/) follow these instructions (when provided by NGD](https://sync.ngd.network/) follow these instructions (when
@ -114,6 +103,10 @@ $ ./bin/neo-go db restore -m -i chain.acc # for testnet use '-t' flag instead of
The process differs from the C# node in that block importing is a separate The process differs from the C# node in that block importing is a separate
mode, after it ends the node can be started normally. mode, after it ends the node can be started normally.
## Running a private network
Refer to [consensus node documentation](docs/consensus.md).
## Smart contract development ## Smart contract development
Please refer to [neo-go smart contract development Please refer to [neo-go smart contract development