Git Product home page Git Product logo

docker-cosmos's Introduction

Docker-Cosmos

Dockerized Cosmos Node with Optional Bootstrap for Fast Syncing


Docker Pulls

Codacy grade


Prerequisites

  • Docker
  • Docker-Compose (optional)

Quick Start

The image can be run without any configuration and defaults to mainnet

docker  run --rm -it -P ryanhendricks/docker-cosmos: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

# EXAMPLES

MONIKER=nonamenode
CHAIN_ID=cosmoshub-4
PROMETHEUS=true
PROMETHEUS_LISTEN_ADDR=26660
MAX_OPEN_CONNECTIONS=10
LCD_PORT=1317
RPC_PORT=26657
P2P_PORT=26656
PROXY_APP_PORT=26658

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:

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 ~20GB of 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-cosmos:latest .

Running

Mainnet

docker-compose up -d --build

Testnet

docker-compose docker-compose-testnet.yml up -d --build

Supervisor

The image uses Supervisor to run both gaiad and gaiacli simultaneously at container runtime. Supervisor also restarts either process should it fail for some reason.

Gaiad

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'

NOTES

  • You probably should not run a validator with this setup.

Contributing

PRs Welcome

Contributors

Keybase PGP

License

GitHub

docker-cosmos's People

Contributors

nk185 avatar ryanhendricks avatar visualbasic6 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-cosmos's Issues

Why not suitable for Validator?

You wrote in the notes, this setup shouldn't be used for validators. Since I think the isolation given from the containerization I thought, it might be useful to have a validator running in a container. So I was wondering why you wouldn't suggest to use it for a validator (assuming everything is built locally and the parent images have been security reviewed)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.