wainach / docker-kava

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Kava

NOTICE: No Longer Maintained

drawing

Docker Pulls MicroBadger Layers (latest) MicroBadger Version CircleCI (all branches) Codacy grade

Prerequisites

  • Docker
  • Docker-Compose (optional)

Quick Start

The image can be run without any configuration and defaults to mainnet (currently kava-3)

docker  run --rm -it -P ryanhendricks/docker-kava:latest

Configuration

Config.toml Parameters

  • The config.toml is created dynamically when starting the container.
  • All parameters specified in the standard config.toml file can be set using environmental variables with the same name as the config parameter but in all caps. See entrypoint script for more details.
  • If left unset the default values will be used.
  • Parameters can be set directly by modifying the config.toml portion of ./scripts/entrypoint.sh if you are cloning and building the image yourself.

Environment Variables

You can set ENV variables either in a docker-compose file or in the docker run command if running the container directly. If left unchanged they will default to the standard value except for the following:

  • MONIKER
    • defaults to "nonamenode"
  • CHAIN_ID
    • defaults to kava-4
  • GENESIS_URL

Some examples:

MONIKER=nonamenode
CHAIN_ID=kava-3
BOOTSTRAP=TRUE
PROMETHEUS=true
GENESIS_URL=https://raw.githubusercontent.com/Kava-Labs/launch/master/kava-4/genesis.json
KVD_HOME=/.kvd

Running multiple nodes with the same IP address is possible using different ports. This is easily accomplished with the following ENV variabes.

PROMETHEUS_LISTEN_ADDR=46660
MAX_OPEN_CONNECTIONS=10
LCD_PORT=4317
RPC_PORT=46657
P2P_PORT=46656
PROXY_APP_PORT=46658

Bootstrapping

The entrypoint script allows for the node to be bootstrapped upon creation. This drastically reduces the time required to fully sync with the network. The start up time is increased relative to the amount of time it takes the host machine to download the archived data and extract it into the data directory.

Set the ENV variable BOOTSTRAP=TRUE to enable bootstrapping.

Build

The following command will build the image.

docker build --rm -f Dockerfile -t docker-kava:latest .

Run

docker-compose up -d --build

Supervisor

The image uses Supervisor to run both kvd and kvcli simultaneously (in the same container) at container runtime. Supervisor also restarts either process should it fail for some reason.

Kvd

After starting the container you can check the status here: http://0.0.0.0:26657/status.

or from the terminal

curl -X GET \
  http://127.0.0.1:26657/status? \
  -H 'cache-control: no-cache'

Kvcli Rest-Server

Supervisor starts the rest-server with the following command:

kvcli rest-server --trust-node --cors * --home $KVD_HOME --laddr tcp://0.0.0.0:1317

You can verify that the rest-server is running using the following example

curl -X GET \
  http://0.0.0.0:1317/blocks/latest \
  -H 'cache-control: no-cache'

Contributing

PRs Welcome

Contributors

Keybase PGP

License

GitHub

About

License:MIT License


Languages

Language:Shell 81.8%Language:Dockerfile 18.2%