Running on Docker

We provide a docker containerized distribution of the Quanta Core which can be used to run on Linux, OSX, or Windows platform. Docker nicely runs the linux environment required for the quanta-core instance, in an isolated environment.

Docker image: https://hub.docker.com/r/quantalabs/quanta-core

The image opens two ports 1) 8090 which is the websocket RPC service, and 2) 1776 a p2p service to communicate with other nodes.

Installing Docker

On windows, install docker from docker official page, https://docs.docker.com/docker-for-windows/install/ , or from download.docker.com.

NOTE: It will ask you to logout and log back into the system. Next it will enable Hyper-V which is a windows technology that powers the virtual machine. You may get an error about BIOS not enabled for virtualization. You need to enter your BIOS typically with DEL, ESC, or F10 when the machine boots up. From inside the bios you need to find a Virtualization Technology (VTx) and enable it. For my HP machine, this visual guide was helpful.

Preparing the Data

Next, download our pre-built docker-compose configuration and quanta configuration file. Dropbox link. Now, unzip the content to a directory where you will store the data for the quanta chain, where preferably you have 100GB+ in free space. Next, click on the Docker icon on the system tray, settings, and enable the drive where the folder is located to be shared with the docker. This allows docker to write the data back to your drive for persistent storage.

Running the QUANTA Node

Open up Terminal (from search / Terminal). Change directory to where your data directory. For example this is change directory command for C:\quanta

cd C:\quanta

Next, let's run the node. This command below will start the quanta-node in the background (-d parameter for detached). It's going to download the latest docker image from the cloud and boot up.

docker-compose up -d

Checking the logs

Let's verify whether the node ran properly. You should see it trying to fetch the blocks from the beginning. This will take 30-60 minutes to fetch all the blocks from the network.

docker-compose logs -f quantacore

After it gets all the blocks, you will see it receiving individual blocks and network transactions, which means the system is operating properly, like so:

3552003ms th_a       application.cpp:515           handle_block         ] Got block: #6865536 0068c28028d6e7d2a43e67cb443088a419503b98 time: 2019-03-12T06:59:12 transaction(s): 0 latency: 3 ms from: clockbound-witness  irreversible: 6865532 (-4)
3553123ms th_a       application.cpp:515           handle_block         ] Got block: #6865537 0068c28196a9dde7b150ea8dec24e8c719922b96 time: 2019-03-12T06:59:13 transaction(s): 0 latency: 123 ms from: flash-witness  irreversible: 6865532 (-5)
3553356ms th_a       application.cpp:571           handle_transaction   ] Got 1 transactions from network
3554127ms th_a       application.cpp:515           handle_block         ] Got block: #6865538 0068c282c369bf31220aeaf40431ab44f97ce3c2 time: 2019-03-12T06:59:14 transaction(s): 1 latency: 127 ms from: quantalabs-witness  irreversible: 6865532 (-6)

Stopping the node

To stop the node, run

docker-compose down

Accessing your wallet

This runs the wallet in a separate VM environment. The wallet file points to the same location as you config directory.

docker-compose run quantacore /usr/local/bin/cli_wallet --wallet-file=/etc/bitshares/quanta_wallet.json --server-rpc-endpoint=ws://quantacore:8090 --chain-id bb2aeb9eebaaa29d79ed81699ee49a912c19c59b9350f8f8d3d81b12fa178495

The first time you create a wallet, you will need set the password.

set_password XXX

Unlocking the password

unlock XXX

Query global properties: very useful to see active witnesses, prices, etc.

get_global_properties

Query on object. Every piece of data such as account, witness, block have object ids. Anything that has x.y.z (eg. 1.3.0) can be query with:

get_object 1.3.0

Query an account

get_full_account alpha

Importing your key

import_key alpha "5JXXXXXXX"

To Transfer 10 QDEX from alpha to charlie

transfer alpha charlie 10 QDEX "memo line" true

Registering a new account with quanta_foundation paying for the registration of the account and quanta_foundation receiving the referral fee. You would need to replace at least the registration account that you can unlock to pay for the fee.

register_account market-maker2 QA6vEzxzP1GE6z9S1A8MnNCZPCSe9BP9pJMR2ATnycBzonpiTTSw QA6vEzxzP1GE6z9S1A8MnNCZPCSe9BP9pJMR2ATnycBzonpiTTSw quanta_foundation quanta_foundation 0 true

For more commands:

Please see Wallet API on Graphene.

Switch to Mainnet

Instructions to switch to mainnet

  1. create a new directory eg. C:/quanta-mainnet

  2. unzip the prepare files

  3. edit docker-compose.yml

    1. change out quantalabs/quanta-core:latest with the latest image name ending with "m" for mainnet from https://hub.docker.com/r/quantalabs/quanta-core/tags

  4. edit the config.ini

    1. seed-nodes = ["54.203.105.154:4600","54.203.105.154:4600"]

    2. If you're a block producer, change the witness-id and the private-key fields.

  5. docker-compose up -d

  6. docker-compose logs -f

  7. you should see that we have a new chain id: 9809209586f5aef6c4c8f5c24ee2d7c4104b64f951b1c32355e3d7d93fe16daa

Upgrading

First step is to update the image version to the target version. In this case the version is 1.83-mainnet, and make sure REPLAY is o

version: '2.2'
services:
  quantacore:
    image: quantalabs/quanta-core:1.83-mainnet
    environment:
      - cluster.name=docker-cluster
      - BITSHARESD_PLUGINS=witness market_history
      - BITSHARESD_REPLAY=1
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./data:/var/lib/bitshares
      - ./config:/etc/bitshares

Next run retrieve the image:

docker pull quantalabs/quanta-core:1.83-mainnet

Then, restart the node, and force it to use the same new image.

docker-compose up -d --force-recreate quantacore

Last updated