Giter Club home page Giter Club logo

chia-docker's Introduction

Official Chia Docker Container

Quick Start

These examples shows valid setups using Chia for both docker run and docker-compose. Note that you should read some documentation at some point, but this is a good place to start.

Docker run

Simple example:

docker run --name chia --expose=8444 -v /path/to/plots:/plots -d ghcr.io/chia-network/chia:latest

Syntax

docker run [--name <container-name>] [--expose=<port>] [-v </path/to/plots:/plots>] -d ghcr.io/chia-network/chia:latest

Optional Docker parameters:

  • Give the container a name: --name=chia
  • Accept incoming connections: --expose=8444
  • Volume mount plots: -v /path/to/plots:/plots

Docker compose

version: "3.6"
services:
  chia:
    container_name: chia
    restart: unless-stopped
    image: ghcr.io/chia-network/chia:latest
    ports:
      - 8444:8444
    volumes:
      - /path/to/plots:/plots

Configuration

You can modify the behavior of your Chia container by setting specific environment variables.

Timezone

Set the timezone for the container (optional, defaults to UTC). Timezones can be configured using the TZ env variable. A list of supported time zones can be found here

-e TZ="America/Chicago"

Add your custom keys

To use your own keys pass a file with your mnemonic as arguments on startup

-v /path/to/key/file:/path/in/container -e keys="/path/in/container"

or pass keys into the running container with your mnemonic

docker exec -it <container-name> venv/bin/chia keys add

alternatively you can pass in your local keychain, if you have previously deployed chia with these keys on the host machine

-v ~/.local/share/python_keyring/:/root/.local/share/python_keyring/

or if you would like to persist the entire mainnet subdirectory and not touch the key directories at all

-v ~/.chia/mainnet:/root/.chia/mainnet -e keys="persistent"

Persist configuration, db, and keyring

You can persist whole db and configuration, simply mount it to Host.

-v ~/.chia:/root/.chia \
-v ~/.chia_keys:/root/.chia_keys

Farmer only

To start a farmer only node pass

-e service="farmer-only"

Harvester only

To start a harvester only node pass

-e service="harvester" -e farmer_address="addres.of.farmer" -e farmer_port="portnumber" -v /path/to/ssl/ca:/path/in/container -e ca="/path/in/container" -e keys="none"

Configure full_node peer

To set the full_node peer's hostname and port, set the "full_node_peer" environment variable with the format hostname:port

-e full_node_peer="node:8444"

This will configure the full_node peer hostname and port for the wallet, farmer, and timelord sections of the config.yaml file.

Plots

The plots_dir environment variable can be used to specify the directory containing the plots, it supports PATH-style colon-separated directories.

Or, you can simply mount /plots path to your host machine.

Set the environment variable recursive_plot_scan to true to enable the recursive plot scan configuration option.

Adding mounts while running

By default, Docker requires a container restart to discover newly mounted filesystems under a configured bind-mount. Setting the bind-propagation option to rslave enables dynamic addition of sub-mounts while the container is running (Linux systems only). See Docker Bind Mounts documentation for more information.

-v /plotdrives:/plotdrives:rslave

Compressed Plots

There are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled.

See the official documentation for a description on what each of these settings do.

Compressed plot farming can be enabled by setting the following:

-e parallel_decompressor_count=1
-e decompressor_thread_count=1

And to use an nvidia GPU for plot decompression, set:

-e use_gpu_harvesting="true"

Log level

To set the log level to one of CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET

-e log_level="DEBUG"

Peer Count

To set the peer_count and outbound_peer_count

for example to set both to 20 use

-e peer_count="20"
-e outbound_peer_count="20"

UPnP

To disable UPnP support (enabled by default)

-e upnp="false"

Log to file

Log file can be used by external tools like chiadog, etc. Enabled by default.

To disable log file generation, use

-e log_to_file="false"

Docker Compose

version: "3.6"
services:
  chia:
    container_name: chia
    restart: unless-stopped
    image: ghcr.io/chia-network/chia:latest
    ports:
      - 8444:8444
    environment:
      # Farmer Only
#     service: farmer-only
      # Harvester Only
#     service: harvester
#     farmer_address: 192.168.0.10
#     farmer_port: 8447
#     ca: /path/in/container
#     keys: generate
      # Harvester Only END
      # If you would like to add keys manually via mnemonic file
#     keys: /path/in/container
      # OR
      # Disable key generation on start
#     keys: 
      TZ: ${TZ}
      # Enable UPnP
#     upnp: "true"
      # Enable log file generation
#     log_to_file: "true"
    volumes:
      - /path/to/plots:/plots
      - /home/user/.chia:/root/.chia
#     - /home/user/mnemonic:/path/in/container

CLI

You can run commands externally with venv (this works for most chia CLI commands)

docker exec -it chia venv/bin/chia plots add -d /plots

Is it working?

You can see status from outside the container

$ docker exec -it chia venv/bin/chia farm summary
Farming status: Farming
Total chia farmed: xx
User transaction fees: xx
Block rewards: xx
Last height farmed: xxxxxxx
Local Harvester
   xxx plots of size: xx.xxx TiB
Plot count for all harvesters: xxx
Total size of plots: xx.xxx TiB
Estimated network space: 30.638 EiB
Expected time to win: x months and x weeks
Note: log into your key using 'chia wallet show' to see rewards for each key

Or via chia peer. Note that you have to specify your component.

docker exec -it chia venv/bin/chia peer -c {farmer|wallet|full_node|harvester|data_layer}

Or via chia show -s.

$ docker exec -it chia venv/bin/chia show -s
Network: mainnet    Port: 8444   RPC Port: 8555
Node ID: xxxxx
Genesis Challenge: xxxxx
Current Blockchain Status: Full Node Synced

Peak: Hash: xxxxx
      Time: Fri Jan 19 2024 17:52:44 CET                  Height:    4823454

Estimated network space: 30.639 EiB
Current difficulty: 11136
Current VDF sub_slot_iters: 574619648

  Height: |   Hash:
  4823454 | 7e66bd11e46801b25ac9237e300deff27a4750fc3bf4eb7e3c594b17faaf0b37
  4823453 | 9f5b68a52364c1afec48bc87d26bbba912c355e7f51c970f7bf89d068c762530
  4823452 | db3b5bb0e3d09fd398e2d9bd159c387f9ad280ec8719916ebb6c25c948834f9c
  4823451 | 5dd056960ec14da1c54fe295f33487e280f3e3c39eddced158ebb520b8215894
  4823450 | a3f5a3f61728b1f52e1ab7971b29d0c55b6bc8e2797ad826b780ada7a0f76a49
  4823449 | 052075e6b9881049c95c3ceeabed9160e5bfbf55a2b3b0768a743542ce88a3a3
  4823448 | 3e2b954d4eb782d1ce67eb7f17e9bf72843d17948ba181168dbc239c5e70acd2
  4823447 | 69539a9474c239280b6a6b4ab5be994e892c1b75c7bfb8967517e75ee5a65b12
  4823446 | 47ce031f46b2b0c9f90e90de4f9cab58054f356a7a3019b30c8f6292b86a5aae
  4823445 | 8c5d0254db6e304696d240dc70bad803ad227b861d68e65a3dc30c0aeef298f6

Connect to testnet?

docker run -d --expose=58444 -e testnet=true --name chia ghcr.io/chia-network/chia:latest

Connect remotely

Sometimes you may want to access Chia RPCs from outside of the container, or connect a GUI to a remote Chia farm. In those instances, you may need to configure the self_hostname key in the Chia config file.

By default this is set to 127.0.0.1 in chia-docker, but can be configured using the self_hostname environment variable, like so:

docker run -d -e self_hostname="0.0.0.0" --name chia ghcr.io/chia-network/chia:latest

This sets self_hostname in the config to 0.0.0.0, which will allow you to access the Chia RPC from outside of the container (you will still need a copy of the private cert/key for the component you're attempting to access.)

Need a wallet?

To get new wallet, execute command and follow the prompts:

docker exec -it chia-farmer1 venv/bin/chia wallet show

Building

docker build -t chia --build-arg BRANCH=latest .

Healthchecks

The Dockerfile includes a HEALTHCHECK instruction that runs one or more curl commands against the Chia RPC API. In Docker, this can be disabled using an environment variable -e healthcheck=false as part of the docker run command. Or in docker-compose you can add it to your Chia service, like so:

version: "3.6"
services:
  chia:
    ...
    environment:
      healthcheck: "false"

In Kubernetes, Docker healthchecks are disabled by default. Instead, readiness and liveness probes should be used, which can be configured in a Pod or Deployment manifest file like the following:

livenessProbe:
  exec:
    command:
    - /bin/sh
    - -c
    - '/usr/local/bin/docker-healthcheck.sh || exit 1'
  initialDelaySeconds: 60
readinessProbe:
  exec:
    command:
    - /bin/sh
    - -c
    - '/usr/local/bin/docker-healthcheck.sh || exit 1'
  initialDelaySeconds: 60

See Configure Probes for more information about configuring readiness and liveness probes for Kubernetes clusters. The initialDelaySeconds parameter may need to be adjusted higher or lower depending on the speed to start up on the host the container is running on.

Simulator

docker run -e service=simulator -v /local/path/to/simulator:/root/.chia/simulator ghcr.io/chia-network/chia:latest

Mounts the simulator root to the provided local path to make the test plots and the mnemonic persistent. Mnemonic will be available at /local/path/to/simulator/mnemonic

chia-docker's People

Contributors

7ac avatar carles2m avatar cmmarslender avatar davidbarratt avatar dudeofawesome avatar gilbertgong avatar gnomuz avatar grerrg avatar jack60612 avatar jinnatar avatar justinengland avatar kemp avatar linnik avatar mengland17 avatar mharsch avatar mumfmeistert avatar nirajpathak13 avatar npathak13 avatar pmaslana avatar semkowicz avatar skweee avatar sparklyballs avatar starttoaster avatar stefan-lange avatar stogiec avatar stonemelody avatar thdxr avatar thelastcicada avatar wallentx avatar xearl4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chia-docker's Issues

Harvester

I can not start harvester using this docker and cant add required certs

How to specify temporary directories?

The plots_dir environment variable specify the final destination folder where you would like the plot to be stored, and usually it's recommended to use a large slow hard drive. Am I understanding this plots_dir correctly?

This docker image has plots_dir environment variable for final directory, but doesn't have an environment variable to specify temporary directories, usually temporary directories are on fast SSDs.

Operation Not Permitted when moving to final destination that is na nfs share.

Using a privileged podman container with multiple bind mounts for temp directories and a nfs mount on the host used for plots directory. I have full privileges to make delete and rename files on the nfs share, but the final step copying the *.plot.2.tmp file to the nfs share mounted at /plots says Operation Not Permitted trying again in 5 minutes.

Wallet isuues

Hi

I have been farming plots in two pc with windows but actually i have a qnap nas with docker.

I have installed docker version in NAS, afte i've used comand KEYS ADD to put my 24 mnemotic words.

Everything seems correct, but in the FARM SUMMARY or SHOW -S -C status commands a wallet error appears.
I have passed the command cat ~ / .chia / mainnet / log / debug.log | grep error
and the errors are:

cat ~/.chia/mainnet/log/debug.log | grep error

2021-05-01T19:11:14.268 wallet chia.rpc.wallet_rpc_api : ERROR error No backup on backup service
2021-05-02T15:37:36.144 wallet chia.rpc.wallet_rpc_api : ERROR error 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://backup.chia.net/download_backup')
2021-05-02T15:52:11.560 wallet chia.rpc.wallet_rpc_api : ERROR error 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://backup.chia.net/download_backup')

I have automàtic wallet in pc with windows, without configure anything. Why in docket there isn´t wallet?

How to check log files

I have sucessful install the docker and run it, but I cant find where the log files are located on docker

Error: connect ECONNREFUSED 127.0.0.1:8555

Hello ,

I got following error when I tried to connect via docker container . Attached my docker-compose file. Can you please let me know how do I establish connection from app container .

class RpcClient {
  constructor(options) {
    this.port = options.port;
    this.agent = new Agent({
      rejectUnauthorized: false,
      cert:  fs.readFileSync(path.resolve(__dirname, certPath)),
      key: fs.readFileSync(path.resolve(__dirname, keyPath)),
    });
  }

  baseUri() {
    return `https://localhost:${this.port}`;
  }

  async request(route, body) {
    const url = `${this.baseUri()}/${route}`;
    console.log(url);
    const { data } = await axios.post(url, body, {
      httpsAgent: this.agent,
    });

    return data;
  }
}

module.exports = RpcClient;

docker compose file

version: '3.6'
services:
  chianet:
    image: ghcr.io/chia-network/chia
    restart: always
    networks: 
      - dotin
  app:
    container_name: app
    restart: always
    ports:
      - 3001:3001
    build:
      context: app
      dockerfile: Dockerfile    
    depends_on:
      - chianet
    links:
      - "chianet"   
    command: npm run start    
    networks: 
      - dotin   

volumes:
  db_data:

networks:
  default:
syncError: Error: connect ECONNREFUSED 127.0.0.1:8555
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) {
    errno: 'ECONNREFUSED',
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 8555,
    config: {
      url: 'https://localhost:8555/get_blockchain_state',
      ```

Container is dev-release

Just re-created my container and it seems it is running the dev-release.

Command docker exec -it chia venv/bin/chia version returns: 1.1.3.dev0

I have tried the official way to fix this:
# If you get RELEASE.dev0 then delete the package-lock.json in chia-blockchain-gui and install.sh again
but there is no package-lock.json file in chia-blockchain-gui.

Don't know if this is a problem (other than potential bugs, since it is the dev-branch).

Slow syncing

Got this installed on a Synology DS1821+ AMD AMD Ryzen™ Quad-core 2.2 GHz, 12 Gb of ram however the syncing to main net is painfully slow. So far in 4 days I have gotten to 40000 is this normal.

Got me wondering if syncing is this slow will the container be fast enough to work as the farmer? How does one test that?

Is it possible to run node on specific post (taken from .env)

Hey! Is it possible to specify port of Node service via environment variables?
We want to deploy testnet & mainnet nodes on the same machine and want to add pretty and useful subdomains to them. Our PaaS (heroku & dokku) require the app to respect the $PORT env where it would run the service.

Is it possible to set the node's and wallet's port via .env? It would be really useful for at-scale deployments.

The plot log file is empty

I use docker command ... chia plots create -k 32 -b 4000 -r 2 -n 6 -t /tmp1 -d /data1 >> plots2.log 2>&1 & to running

But the log file plots2.log is always empty , but I can see the tmp file is generalized, there are many files in /tmp1 dir.

Mnemonic sent do docker log in plain text

This container currently logs the private key mnemonic in plain text to whatever the docker system logging daemon is.

In many cases this is widely readable by monitoring systems etc.

This is a serious vulnerability.

$ docker logs chia
Chia directory /root/.chia/mainnet
Can't find private CA, creating a new one in /root/.chia/mainnet to generate TLS certificates
No keys are present in the keychain. Generate them with 'chia keys generate'

To see your keys, run 'chia keys show'
Added private key with public key fingerprint 1076947857 and mnemonic
ghost sense make design slush bulb liquid unaware home heart host charge talk type lady life renew weird test topic trust adult thumb cabbage

Persist blockchain sync

I'm sure the answer to this is obvious, but with the current documentation I cannot find a straightforward answer.

When I start the container, naturally it begins syncing with the mainnet. But if I restart the container, the sync starts from the beginning.

The closest I can find is this issue where the advice is to copy the db from an already synced node - which I could do, but there's no information on how to do this?

I assume there's a volume I could mount to persist this database (And to copy an existing db into), but I can't find info on where this would be.

ssl3_get_record error while accessing Dockerized Node via PRC

The problem

I want to run the node in the docker container and access its PRC interface from another docker container.

When I call PRC endpoints from inside the Node's container - everything works perfectly. If I try to do the same from outside (e.g. from machine where docker is deployed) I received error:1408F10B:SSL routines:ssl3_get_record:wrong version number.

Steps to reproduce

Run node

docker run --name rpc_test \
-v /root/.chia:/root/.chia \
-v /root/.local/share/python_keyring:/root/.local/share/python_keyring \
-d ghcr.io/chia-network/chia:latest \
-p 8555:8555 -p 8444:8444

Open logs to make sure everything started fine.

~ docker logs rpc_test
Chia directory /root/.chia/mainnet
WARNING: using a farmer address which we don't have the private keys for. We searched the first 500 addresses. Consider overriding xch1ncdfpth786dz0vkqyv5yg7ect7q70wq3l0j9zxrv8muuhnajzk4ssxuxav with xch1ycd28vszm8xvxyd99hf485sj870zyvyx8yftyy9r8jd0uyxl2nzql3jqp2
WARNING: using a pool address which we don't have the private keys for. We searched the first 500 addresses. Consider overriding xch1ncdfpth786dz0vkqyv5yg7ect7q70wq3l0j9zxrv8muuhnajzk4ssxuxav with xch1ycd28vszm8xvxyd99hf485sj870zyvyx8yftyy9r8jd0uyxl2nzql3jqp2
/root/.chia/mainnet already exists, no migration action taken
to use your own keys pass them as a text file -v /path/to/keyfile:/path/in/container and -e keys="/path/in/container"
Generating private key
Added private key with public key fingerprint 471723910 and mnemonic
enter coach solve supreme crucial option stay wealth helmet illness between present course direct aunt sun sail equip blush false drift chronic bright minute
WARNING: using a farmer address which we don't have the private keys for. We searched the first 500 addresses. Consider overriding xch1ncdfpth786dz0vkqyv5yg7ect7q70wq3l0j9zxrv8muuhnajzk4ssxuxav with xch1ycd28vszm8xvxyd99hf485sj870zyvyx8yftyy9r8jd0uyxl2nzql3jqp2
WARNING: using a pool address which we don't have the private keys for. We searched the first 500 addresses. Consider overriding xch1ncdfpth786dz0vkqyv5yg7ect7q70wq3l0j9zxrv8muuhnajzk4ssxuxav with xch1ycd28vszm8xvxyd99hf485sj870zyvyx8yftyy9r8jd0uyxl2nzql3jqp2
Plots directory '/plots' appears to be empty, try mounting a plot directory with the docker -v command
Added plot directory "/plots".
Daemon not started yet
Starting daemon
chia_harvester: started
chia_farmer: started
chia_full_node: started
chia_wallet: started

Get blockchain status to make sure everything is fine (again)

~ docker exec -it rpc_test venv/bin/chia show -s

Current Blockchain Status: Full Node Synced

Peak: Hash: c83896873a02d356e18f02551fdcc4eb54d2071719ff5f1b7b8e7883574e2adf
      Time: Wed Jun 02 2021 13:19:23 UTC                  Height:     373395

Estimated network space: 15.978 EiB
Current difficulty: 1168
Current VDF sub_slot_iters: 117964800
Total iterations since the start of the blockchain: 1214915313295

  Height: |   Hash:
   373395 | c83896873a02d356e18f02551fdcc4eb54d2071719ff5f1b7b8e7883574e2adf
   373394 | 7417f715ea6cc2d9fe38cffd99bb30855f37611774ef886d0a5fb522789ec5df
   .......

Enter the container to check if local PRC requests work. curl request found here.

docker exec -it rpc_test bash

curl --insecure --cert /root/.chia/mainnet/config/ssl/full_node/private_full_node.crt \
--key /root/.chia/mainnet/config/ssl/full_node/private_full_node.key \
-d '{}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_blockchain_state

# prints valid JSON with node state. Starting with: {"blockchain_state": {"difficulty": 1168, ....

Doing the same from machine where the docker was depoyed (from outside of the node's container):

curl --insecure --cert /root/.chia/mainnet/config/ssl/full_node/private_full_node.crt \
--key /root/.chia/mainnet/config/ssl/full_node/private_full_node.key \
-d '{}' -H "Content-Type: application/json" -X POST https://0.0.0.0:8555/get_blockchain_state

Receiving error:

curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

Docker contained didn't write anything to stdout:

docker logs rpc_test
# nothing new here 

Chia Debug logs are empty as well - nothing was added after the curl:

~ docker exec -it rpc_test cat ~/.chia/mainnet/log/debug.log -t
# nothing new here also

More info about my setup

I have run and synced the node without docker on that machine before. So I in the attached volumes I have the data of synced node and its keys. I tried to remove all synced node data (rm -rf /root/.chia/mainnet) but it didn't help.

Host I/O rate.

Hello

I have run docker stats command
docker stats
And saw that it reports 8.71TB of writes to host. Yet I plotted only one k32 on this container, and it' in harvester mode. From chia documentation, it is supposed to write approx 1.7TB for each plot. I wonder why my stats are that high and what could be the case. Can be there something wrong with my host setup?
Can somebody check how much your image reports for one plot on block i/o ?
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
66e51a4b1b32 chia-3 0.00% 389.5MiB / 15.53GiB 2.45% 406kB / 292kB 8.71TB / 6.98MB 0

Official arm build not available in docker hub

Hi,

I get the following error when trying to start the container on a raspberry pi. From the build it looks like an arm image is created here but the user is a secret and so I have no clue which image is the right one.

Any chance you could make this information part of the official documentation?

Failed to pull image "ghcr.io/chia-network/chia:latest": rpc error: code = NotFound desc = failed to pull and unpack image "ghcr.io/chia-network/chia:latest": no match for platform in manifest: not found

Will not keep sync Version 1.1.6

Had issues syncing with 1.1.5, I beleive it was a known issue. Now that I have it upgraded to 1.1.6 which should have resolved the issue. It hasent.

Current Blockchain Status: Not Synced. Peak height: 315224
Time: Fri May 21 2021 17:13:43 America Height: 315224

I have 4 different machines running chia in 3 different locations. All of them had this syncing issue. The three windows machines I have, now that there upgraded to 1.1.6 have no sync issues at all. But the docker still has this issue.

Port 8444 has been checked countless time to be open and ready. UPNP is shut off both in chia config and router. I've had external users connect to chia running in the docker and connection successful. I can confirm my windows connects to docker and docker connects to windows. I would assume it would sync of the local windows chia with no issues.

CPU usage on docker is at about 30-40%.

Sync is trying, But its almost like it cant sync fast enough to keep up with the growing blocks.

I am unsure what else to try?

UI ?

Does this container include a working UI?

The chia/mainnet/config/config.yaml file generated by chia init has ui: port: 8222, but that port currently is not EXPOSE-d in the Dockerfile (only 8444 & 8555) - should it be?

arm image

Hi,

I would have like to test Chia on my NAS via Docker, but I get the following error message in the container log at launch:

standard_init_linux.go:219: exec user process caused: exec format error

This usually means that the image has the wrong architecture, my NAS is an ARM64 armbian.
I'm using image ghcr.io/chia-network/chia:latest.

I see a Chia-Docker-Arm.yml, I don't know how it works, but it sounds like the image should support arm?
I could try the Raspberry Pi installation which is very close to my armbian based NAS, but I would prefer to use Docker.

docker container fails to start - connection error

After attempting to start the docker container Connection error. docker exec -it chia venv/bin/chia show -s -c says "Connection error. Check if full node rpc is running at 8555
This is normal if full node is still starting up"

The container logs show
" File "/usr/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
raise OSError(err.errno, 'error while attempting '
OSError: [Errno 99] error while attempting to bind on address ('::1', 55400, 0,
Daemon not started yet
Starting daemon
Daemon not started yet
Failed to create the chia daemon"

There is nothing running on the docker host using port 8555.

Run as non-root user

Hi folks,

Is there a good reason the docker runs as the root user? (I don't see it at least)
I am aware of the user mapping option that docker provides (e.g. https://docs.docker.com/engine/security/userns-remap/) , but a lot of users won't bother.

Suggestion:
Create a chia user and group with their own homedir in the Dockerfile and run using that instead of root.

Wrong time zone/time?

This whole thing is new to me, but my time seems to be wrong. Not sure if this has any affect on the node but it seems to think my time zone in UTC. Any way to correct this?

I can't find key files in documents.

Where is the key files in container?
If docker is update to new version
how to transfer key to new version container?

I have use venv/bin/chia keys show
only show public keys.

Thank you.

Add variable to set Log Level

Would it be possible to add an environment variable to be able to set the log level for chia in the container, something along the lines of
-e log="INFO"

This would make it practically stateless for harvester only nodes and let us see the proofs etc ticking over, without having to stop the container, edit the config.yaml, and restart the container

Community/dev branch

I assume that right now the developers are laser-focused on pooling, unfortunately the chia-docker repo has plenty useful PRs ready to be approved, that are several days old. It will be nice to have a community/dev branch (and relative docker tag deployed) in which PR are merged after 2 or 3 community approvals.
2-3 seems a fair number but could be more.

Can we get a hot fix update?

Apparently anyone who doesn’t update will loose out on 30% of potential farm challenges (according to Reddit, could we get a hot fix update?

environment variables

in the gui editions of chia there are easy ways to specify the temp location and then the dump location for the plots. if we are running dockers as plotters only, then where do we set those options to crank out plots to the, lets say ubuntu farmer?

Req : include tzdata in the image

Could you please include tzdata in the image so that timezone can be set with the TZ variable ?

I run the container as a harvester-only on my storage NAS (Unraid). It works as expected in conjunction with a full node on another machine.
But currently, timestamps in logs from the container are UTC, and that's not easy to follow-up with logs on the other machines which are in the relevant timezone.
See basic pull request to solve this annoying issue : #50
Thanks in advance

Please don't use environment variables for secrets like this

Hi there, I'd suggest another method for providing the mnemonic words. Having them in the environment like this will add them to people's log and bash history etc. which is a significant concern. It can also expose them through careless use of commands like env in the container.

I'd suggest reading from a mounted file, which can be defined via an env var, e.g.

docker exec  ... -e MNEMONIC_FILE=/var/secrets/mnemonic.txt …

Note, this would also be compatible with Docker Swarm and Docker Compose's native secrets handling.

Harvester only - cannot start

Hi
followed all steps from official wiki - all goes well until I start chia harvester.
Got error and this comes live in logs (below).
Any idea what is wrong? Is this possible that its an error because I am starting this at old 32bit QNAP with Unraid?
Want only to share files from this machine, not via SMB but in "proper" way.

LOGS:

2021-04-27T14:37:37.303 daemon chia.daemon.server : ERROR problem starting chia_harvester
Traceback (most recent call last):
File "/chia-blockchain/chia/daemon/server.py", line 610, in start_service
process, pid_path = launch_service(self.root_path, exe_command)
File "/chia-blockchain/chia/daemon/server.py", line 766, in launch_service
process = subprocess.Popen(
File "/usr/lib/python3.8/subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chia_harvester'

No new image available with approved pull requests

Thanks for approving some of the pending pull requests from the community (including my proposal to add tzdata).
Could you please build the image including them with the newly released 1.1.6 ? I always prefer using official images rather than forks by others or myself in terms of maintenance. So, for the moment I can't upgrade my full node to 1.1.6 as I run a harvester in the container pulled from the 11 days old 'latest' tag.
Thanks in advance

New version of chia

Now we have the version 1.1.6 Chia Blockchain 2021-05-20

¿How can I update to that version?

I have a problem with this version, it is always on syncing and don't works.

Keys in harvester mode

Hello,

When starting the container in harvester mode, are the keys necessary?
I think that by copying the CAs of the farmer node it would be enough and there would be more security since it would not always need the Keys to boot.
I am right?

If this is correct, they could change in the entrypoint so that the keys do not apply in that mode.
Thank you!!

Versioning management

Currently, when pulling the latest image, the "chia version" command returns 1.1.6.dev0

I run the container as a harvester only and it works fine with a full node v1.1.5 under Ubuntu (RPi4). But, unless I've missed something, I think the docker image should be on the same stable version as the rest of the architecture. And as the tag 1.1.5 does not exist, we only have the choice between 1.1.4 and latest (which happens to be 1.1.6dev0).

For future upgrades, I think all the relevant versions should be available as docker images so that architectures with more than one node can remain consistent.

Stable release instead of dev in "latest" tag.

Hello dear community,

currently we have tag latest that being used for latest dev releases, so version, e.g. 1.1.7 is not equal to 1.1.7.dev and if I have a look on https://github.com/Chia-Network/chia-blockchain then latest version is 1.1.7:

grafik

But with docker tag latest I will receive 1.1.8.dev already.

There is no tag to have latest stable version, besides to update it manually, e.g. :1.1.7 and then :1.1.8...

My suggestion is to not use tag latest for dev software, but for actual stable version of software in sync with main channel https://github.com/Chia-Network/chia-blockchain e.g. 1.1.7, not 1.1.8.dev.

You can introduce tag preview, dev or unstable to use for x.x.x.dev releases.

Cheers!

Wallet error

I set up the docker yesterday and all seems fine except for the wallet. When I run farm summary, I get the following for the wallet:

Exception from 'wallet' {'error': "'NoneType' object has no attribute 'tx_store'", 'success': False}

When I run wallet show, I get:

No online backup file found, Press S to skip restore from backup Press F to use your own backup file: Exception from 'wallet' EOF when reading a line

Any ideas?

Reasoning behind expose vs publishing port?

Is the container meant for actual usage or more testing? Asking because it currently exposes a port vs publish (which would allow it to be mapped as a participating node).
I guess its easy enough to start it with -p 8444:8444 if so?

rebuild for 1.1.5

Seems like the container is not automatically rebuilt when there's a new chia release.

Pulling now still gets 1.1.4.

Problem with starting farming

Full node does not start in docker

I start docker using command
docker run -p 8444:8444 -p 8555:8555 -v /mnt/chia/plots:/plots --name chia_plots -d ghcr.io/chia-network/chia:latest
And get an error:

chia start farmer
Daemon not started yet
Starting daemon
Traceback (most recent call last):
  File "/chia-blockchain/venv/bin/chia", line 33, in <module>
    sys.exit(load_entry_point('chia-blockchain', 'console_scripts', 'chia')())
  File "/chia-blockchain/src/cmds/chia.py", line 59, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 1026, in __call__
    return self.main(*args, **kwargs)
  File "/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 956, in main
    rv = self.invoke(ctx)
  File "/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 1518, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 1280, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 711, in invoke
    return callback(*args, **kwargs)
  File "/chia-blockchain/venv/lib/python3.8/site-packages/click/decorators.py", line 22, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/chia-blockchain/src/cmds/chia.py", line 43, in run_daemon_cmd
    asyncio.get_event_loop().run_until_complete(async_run_daemon(ctx.obj["root_path"]))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/chia-blockchain/src/daemon/server.py", line 985, in async_run_daemon
    await ws_server.start()
  File "/chia-blockchain/src/daemon/server.py", line 142, in start
    self.websocket_server = await serve(
  File "/chia-blockchain/venv/lib/python3.8/site-packages/websockets/server.py", line 965, in __await_impl__
    server = await self._create_server()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
    raise OSError(err.errno, 'error while attempting '
OSError: [Errno 99] error while attempting to bind on address ('::1', 55400, 0, 0): cannot assign requested address
Daemon not started yet
Failed to create the chia daemon

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.