Skip to content

Commit

Permalink
updaing docker container to use new keys strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
justinengland committed Mar 30, 2021
1 parent 225c884 commit 3c00fb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ cd /chia-blockchain
chia init

if [[ ${keys} == "generate" ]]; then
echo "to use your own keys pass them as a variable -e keys=\"24words\""
echo "to use your own keys pass them as a text file -v /path/to/keyfile:/path/in/container and -e keys=\"/path/in/container\""
chia keys generate
else
echo "${keys}" | chia keys add
chia keys add -f ${keys}
fi

if [[ ! "$(ls -A /plots)" ]]; then
Expand Down
15 changes: 11 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ docker run --name <container-name> -d ghcr.io/chia-network/chia:latest

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

To use your own keys pass
To use your own keys pass as arguments on startup
```
-e keys="twenty four words"
-v /path/to/key/file:/path/in/continer -e keys="/path/incontainer"
```
or pass keys into the running container
```
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/
```

To start a farmer only node pass
Expand All @@ -25,9 +33,8 @@ To start a harvester only node pass
-e harvester="true" -e farmer_address="addres.of.farmer" -e farmer_port="portnumber"
```

#### or run the commands externally with venv
#### or run commands externally with venv (this works for most chia XYZ commands)
```
docker exec -it chia venv/bin/chia keys add
docker exec -it chia venv/bin/chia plots add -d /plots
```

Expand Down

0 comments on commit 3c00fb8

Please sign in to comment.