mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
update networks/local readme
This commit is contained in:
parent
6c4a26f248
commit
d7d12c8030
4
Makefile
4
Makefile
@ -193,6 +193,10 @@ build-docker:
|
|||||||
build-linux:
|
build-linux:
|
||||||
GOOS=linux GOARCH=amd64 $(MAKE) build
|
GOOS=linux GOARCH=amd64 $(MAKE) build
|
||||||
|
|
||||||
|
build-docker-localnode:
|
||||||
|
cd networks/local
|
||||||
|
make
|
||||||
|
|
||||||
# Run a 4-node testnet locally
|
# Run a 4-node testnet locally
|
||||||
localnet-start: localnet-stop
|
localnet-start: localnet-stop
|
||||||
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 4 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi
|
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 4 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi
|
||||||
|
@ -28,8 +28,11 @@ genesis file (``genesis.json``) containing the associated public key,
|
|||||||
in ``$TMHOME/config``.
|
in ``$TMHOME/config``.
|
||||||
This is all that's necessary to run a local testnet with one validator.
|
This is all that's necessary to run a local testnet with one validator.
|
||||||
|
|
||||||
For more elaborate initialization, see our `testnet deployment
|
For more elaborate initialization, see the `tesnet` command:
|
||||||
tool <https://github.com/tendermint/tools/tree/master/mintnet-kubernetes>`__.
|
|
||||||
|
::
|
||||||
|
|
||||||
|
tendermint testnet --help
|
||||||
|
|
||||||
Run
|
Run
|
||||||
---
|
---
|
||||||
|
@ -1,29 +1,79 @@
|
|||||||
localnode
|
localnode
|
||||||
=========
|
=========
|
||||||
|
|
||||||
It is assumed that you have already `setup docker <https://docs.docker.com/engine/installation/>`__.
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
Description
|
- `Install docker <https://docs.docker.com/engine/installation/>`__.
|
||||||
-----------
|
- `Install docker-compose <https://docs.docker.com/compose/install/>`__.
|
||||||
Image for local testnets.
|
|
||||||
|
|
||||||
Add the tendermint binary to the image by attaching it in a folder to the `/tendermint` mount point.
|
Build
|
||||||
|
-----
|
||||||
|
|
||||||
It assumes that the configuration was created by the `tendermint testnet` command and it is also attached to the `/tendermint` mount point.
|
Build the `tendermint` binary and the `tendermint/localnode` docker image:
|
||||||
|
|
||||||
Example:
|
|
||||||
This example builds a linux tendermint binary under the `build/` folder, creates tendermint configuration for a single-node validator and runs the node:
|
|
||||||
```
|
```
|
||||||
cd $GOPATH/src/github.com/tendermint/tendermint
|
cd $GOPATH/src/github.com/tendermint/tendermint
|
||||||
|
|
||||||
#Build binary
|
# Install dependencies (skip if already done)
|
||||||
|
make get_tools
|
||||||
|
make get_vendor_deps
|
||||||
|
|
||||||
|
# Build binary in ./build
|
||||||
make build-linux
|
make build-linux
|
||||||
|
|
||||||
#Create configuration
|
# Build tendermint/localnode image
|
||||||
|
make build-docker-localnode
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Run a testnet
|
||||||
|
-------------
|
||||||
|
|
||||||
|
To start a 4 node testnet run:
|
||||||
|
|
||||||
|
```
|
||||||
|
make localnet-start
|
||||||
|
|
||||||
|
``
|
||||||
|
|
||||||
|
The nodes bind their RPC servers to ports 46657, 46660, 46662, and 46664 on the host.
|
||||||
|
This file creates a 4-node network using the localnode image.
|
||||||
|
The nodes of the network expose their P2P and RPC endpoints to the host machine on ports 46656-46657, 46659-46660, 46661-46662, and 46663-46664 respectively.
|
||||||
|
|
||||||
|
To update the binary, just rebuild it and restart the nodes:
|
||||||
|
|
||||||
|
```
|
||||||
|
make build-linux
|
||||||
|
make localnet-stop
|
||||||
|
make localnet-start
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The `make localnet-start` creates files for a 4-node testnet in `./build` by calling the `tendermint testnet` command.
|
||||||
|
|
||||||
|
The `./build` directory is mounted to the `/tendermint` mount point to attach the binary and config files to the container.
|
||||||
|
|
||||||
|
For instance, to create a single node testnet:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd $GOPATH/src/github.com/tendermint/tendermint
|
||||||
|
|
||||||
|
# Clear the build folder
|
||||||
|
rm -rf ./build
|
||||||
|
|
||||||
|
# Build binary
|
||||||
|
make build-linux
|
||||||
|
|
||||||
|
# Create configuration
|
||||||
docker run -e LOG="stdout" -v `pwd`/build:/tendermint tendermint/localnode testnet --o . --v 1
|
docker run -e LOG="stdout" -v `pwd`/build:/tendermint tendermint/localnode testnet --o . --v 1
|
||||||
|
|
||||||
#Run the node
|
#Run the node
|
||||||
docker run -v `pwd`/build:/tendermint tendermint/localnode
|
docker run -v `pwd`/build:/tendermint tendermint/localnode
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Logging
|
Logging
|
||||||
@ -34,7 +84,3 @@ Special binaries
|
|||||||
----------------
|
----------------
|
||||||
If you have multiple binaries with different names, you can specify which one to run with the BINARY environment variable. The path of the binary is relative to the attached volume.
|
If you have multiple binaries with different names, you can specify which one to run with the BINARY environment variable. The path of the binary is relative to the attached volume.
|
||||||
|
|
||||||
docker-compose.yml
|
|
||||||
==================
|
|
||||||
This file creates a 4-node network using the localnode image. The nodes of the network are exposed to the host machine on ports 46656-46657, 46659-46660, 46661-46662, 46663-46664 respectively.
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user