Code Monkey home page Code Monkey logo

ninechronicles.headless's Introduction

NineChronicles Standalone

Run

$ dotnet run --project ./NineChronicles.Standalone.Executable/ -- --help

Usage: NineChronicles.Standalone.Executable [--no-miner] [--app-protocol-version <String>] [--genesis-block-path <String>] [--host <String>] [--port <Nullable`1>] [--minimum-difficulty <Int32>] [--private-key <String>] [--store-type <String>] [--st
ore-path <String>] [--ice-server <String>...] [--peer <String>...] [--no-trusted-state-validators] [--trusted-app-protocol-version-signer <String>...] [--rpc-server] [--rpc-listen-host <String>] [--rpc-listen-port <Nullable`1>] [--graphql-server] [
--graphql-host <String>] [--graphql-port <Nullable`1>] [--libplanet-node] [--no-mpt] [--workers <Int32>] [--confirmations <Int32>] [--max-transactions <Int32>] [--strict-rendering] [--dev] [--dev.block-interval <Int32>] [--dev.reorg-interval <Int32
>] [--log-minimum-level <String>] [--help] [--version]

Run standalone application with options.

Options:
  --no-miner
  -V, --app-protocol-version <String>                      App protocol version token (Default: )
  -G, --genesis-block-path <String>                         (Default: )
  -H, --host <String>                                       (Default: )
  -P, --port <Nullable`1>                                   (Default: )
  -D, --minimum-difficulty <Int32>                          (Default: 5000000)
  --private-key <String>                                    (Default: )
  --store-type <String>                                     (Default: )
  --store-path <String>                                     (Default: )
  -I, --ice-server <String>...                              (Default: )
  --peer <String>...                                        (Default: )
  --no-trusted-state-validators
  -T, --trusted-app-protocol-version-signer <String>...    Trustworthy signers who claim new app protocol versions (Default: )
  --rpc-server
  --rpc-listen-host <String>                                (Default: 0.0.0.0)
  --rpc-listen-port <Nullable`1>                            (Default: )
  --graphql-server
  --graphql-host <String>                                   (Default: 0.0.0.0)
  --graphql-port <Nullable`1>                               (Default: )
  --libplanet-node
  --no-mpt                                                 Flag to turn off the Merkle Patricia Trie for state saving.
  --workers <Int32>                                        Number of workers to use in Swarm (Default: 5)
  --confirmations <Int32>                                  The number of required confirmations to recognize a block.  0 by default. (Default: 0)
  --max-transactions <Int32>                               The number of maximum transactions can be included in a single block. Unlimited if the value is less then or equal to 0.  100 by default. (Default: 100)
  --strict-rendering                                       Flag to turn on validating action renderer.
  --dev                                                    Flag to turn on the dev mode.  false by default.
  --dev.block-interval <Int32>                             The time interval between blocks. It's unit is milliseconds. Works only when dev mode is on.  10000 (ms) by default. (Default: 10000)
  --dev.reorg-interval <Int32>                             The size of reorg interval. Works only when dev mode is on.  0 by default. (Default: 0)
  --log-minimum-level <String>                             The log minimum level during standalone execution. (Default: debug)
  -h, --help                                               Show help message
  --version                                                Show version

Docker Build

A Standalone image can be created by running the command below in the directory where the solution is located.

$ docker build . -t <IMAGE_TAG> --build-arg COMMIT=<VERSION_SUFFIX>
  • Nine Chronicles Team uses <VERSION_SUFFIX> to build an image with the latest git commit and push to the official Docker Hub repository. However, if you want to build and push to your own Docker Hub account, <VERSION_SUFFIX> can be any value.

Command Line Options

  • -H, --host: Specifies the host name.
  • -P, --port: Specifies the port number.
  • --private-key: Specifies the private Key.
  • --no-miner: Disables mining.
  • --no-trusted-state-validators: Calculates all states directly without receiving calculated states from specified peers.
  • --store-path: Specifies the path for storing data.
  • -I, --ice-server: Specifies the TURN server info used for NAT Traversal. If there are multiple servers, they can be added by typing: --ice-server serverA --ice-server serverB ....
  • --peer: Adds a peer and if there are multiple peers, they can be added by typing: --peer peerA --peer peerB ....
  • -G, --genesis-block-path: Specifies the path of the genesis block.
  • -V, --app-protocol-version: Specifies the value of Swarm<T>.AppProtocolVersion.
  • --rpc-server: Starts with RPC server mode. Must specify --rpc-listen-port to use this mode.
  • --rpc-listen-host: Host name for RPC server mode.
  • --rpc-listen-port: Port number for RPC server mode.
  • --graphql-server: Turn on graphQL controller.
  • --graphql-host: Host name for graphQL controller.
  • --graphql-port: Port number for graphQL controller.
  • --libplanet-node: Run with formal Libplanet node. One of this or graphql-server must be set.
  • --no-mpt: Use legacy block state store instead of Merkle Patricia Trie for state saving.
  • --workers: Number of workers to use in Swarm.
  • --confirmations: Specifies the number of required confirmations to recognize a block.
  • --max-transactions: Specifies the number of maximum transactions can be included in a single block. Unlimited if the value is less then or equal to 0.
  • --dev: Flag to turn on the dev mode.
  • --dev.block-interval: Specifies the time interval between blocks by milliseconds in dev mode.
  • --dev.reorg-interval: Specifies the size of reorg interval in dev mode.

Format

Formatting for PrivateKey or Peer follows the format in [Nekoyume Project README][../README.md].

How to run NineChronicles Standalone on AWS EC2 instance using Docker

On Your AWS EC2 Instance

Pre-requisites

1. Pull ninechronicles-headless Docker image to your AWS EC2 instance from the official Docker Hub repository.

  • If you would like to build your own Docker image from your local, refer to the appendix
$ docker pull planetariumhq/ninechronicles-headless:latest

Usage: docker pull [<DOCKER_HUB_ACCOUNT>/<IMAGE_NAME>] : [<TAGNAME>]

Docker Pull

2. Create a Docker volume for blockchain data persistance

$ docker volume create 9c-volume
Usage: docker volume create [<VOLUME_NAME>]

Docker Volume Create

3. Run your Docker image with your Docker volume mounted (use -d for detached mode)

$ docker run \
--detach \
--publish [HOST_PORT]:[CONTAINER_PORT] \
--volume 9c-volume:/app/data \
planetariumhq/ninechronicles-headless \
[NineChronicles Standalone Options]

Note)

  • Instead of including the "--ice-server" option, allocate an Elastic IP to your instance and include it as the "--host" option and after adding an inbound port, include it as the "--port" option. Refer to these official docs on Elastic IP allocation and editing inbound rules for more information.
  • For mining, make sure to include "--private-key" option with your private key. Also, include "--libplanet-node" to run the default libplanet node.

Docker Run

Appendix) Building Your Own Docker Image from Your Local

Pre-requisites

1. Build Docker image with the tag name in [<DOCKER_HUB_ACCOUNT>/<IMAGE_NAME>] format.

$ docker build . --tag 9c/9c-standalone --build-arg COMMIT=9c-1

Usage: docker build . --tag [<DOCKER_HUB_ACCOUNT>/<IMAGE_NAME>] : [<TAGNAME>] --build-arg COMMIT=[<VERSION_SUFFIX>]

Docker Build

2. Push your Docker image to your Docker Hub account.

$ docker push 9c/9c-standalone:latest

Usage: docker push [<DOCKER_HUB_ACCOUNT>/<IMAGE_NAME>] : [<TAGNAME>]

Docker Push

ninechronicles.headless's People

Contributors

area363 avatar boscohyun avatar dahlia avatar dependabot[bot] avatar earlbread avatar ipdae avatar limebell avatar longfin avatar moreal avatar unengine avatar

Watchers

 avatar  avatar

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.