Skip to content

Commit

Permalink
fixing things up for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
justinengland committed Mar 17, 2021
1 parent 7a48680 commit 01b624b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 127 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/Chia-Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: 'chia branch name to use'
required: true
default: 'dev'
image_tag:
description: 'special tag for this image build'
required: true
default: 'unstable'

jobs:
docker_build_and_publish:
Expand All @@ -19,15 +23,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.PACKAGE_ADMIN_PAT }}

- name: set image tag
id: set_tag
run: |
if [[ ${{ github.event.inputs.upstream_branch }} == "dev" ]]; then
echo "::set-output name=tag::latest"
else
echo "::set-output name=tag::${{ github.event.inputs.upstream_branch }}"
fi
- name: Check out the repo
uses: actions/checkout@v2

Expand All @@ -42,7 +37,7 @@ jobs:
echo "::set-output name=reg_token::$(curl -X POST -H "Authorization: token ${{ secrets.ORG_ADMIN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/Chia-Network/actions/runners/registration-token | jq -r '.token')"
- name: Build docker image
run: docker build --no-cache --build-arg branch=${{ github.event.inputs.upstream_branch }} -t ghcr.io/chia-network/chia:${{ steps.set_tag.outputs.tag }} .
run: docker build --no-cache --build-arg branch=${{ github.event.inputs.upstream_branch }} -t ghcr.io/chia-network/chia:${{ github.event.inputs.image_tag }} .

- name: Push to github packages
run: docker push ghcr.io/chia-network/chia:${{ steps.set_tag.outputs.tag }}
run: docker push ghcr.io/chia-network/chia:${{ github.event.inputs.image_tag }}
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ FROM ubuntu:latest
EXPOSE 8555
EXPOSE 58444

ENV keys="generate"
ENV harvester="false"
ENV farmer="false"
ENV plots_dir="/plots"
ENV farmer_address="null"
ENV farmer_port="null"
ENV branch="dev"

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y curl jq python3 ansible tar bash ca-certificates git openssl unzip wget python3-pip sudo acl build-essential python3-dev python3.8-venv python3.8-distutils apt nfs-common python-is-python3 vim
Expand All @@ -17,4 +23,4 @@ WORKDIR /chia-blockchain

ADD ./entrypoint.sh entrypoint.sh

ENTRYPOINT ["bash", "./entrypoint.sh"]
ENTRYPOINT ["bash", "./entrypoint.sh"]
14 changes: 7 additions & 7 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ cat ~/.chia/testnet/config/config.yaml
if [[ ${farmer} == 'true' ]]; then
chia start farmer-only
elif [[ ${harvester} == 'true' ]]; then
#if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then
# echo "A farmer peer address and port are required."
# exit
#else
#chia configure --set-farmer-peer ${farmer_address}:${farmer_port}
if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then
echo "A farmer peer address and port are required."
exit
else
chia configure --set-farmer-peer ${farmer_address}:${farmer_port}
chia start harvester
#fi
fi
else
chia start farmer
fi
#statements

while true; do sleep 30; done;
while true; do sleep 30; done;
41 changes: 0 additions & 41 deletions old-entrypoint

This file was deleted.

79 changes: 12 additions & 67 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,34 @@ Currently latest = head of dev branch
tagged releases to match rc and more to come shortly


## Initialize
## Basic Startup
```
docker run (optional --expose=58444 to run a testnet node)--name chia (chia-farmer, chia-harvester1 etc.) -d ghcr.io/chia-network/chia:latest (optional -v /path/to/plots:plots)
docker run (optional --expose=58444 to run a testnet node) --name <container-name> -d ghcr.io/chia-network/chia:latest (optional -v /path/to/plots:plots)
```

## Config management
```
docker exec -it chia /bin/bash
vim (or nano if you prefer) ~/.chia/testnet/config/config.yaml
```

modify the line
```
self_hostname: &self_hostname "localhost"
```
to match
```
self_hostname: &self_hostname "127.0.0.1"
```

#### optional: remote harvester

```
harvester:
# The harvester server (if run) will run on this port
port: 8448
farmer_peer:
host: *self_hostname
port: 8447
```
include the proper host and port for your remote farmer node or container.

## Starting Chia Blockchain

#### remain in the container with a bash shell
## Configuration

Activate venv
```
. ./activate
```
You can modify the behavior of your Chia container by setting specific environment variables.

If you have your own keys
```
chia keys add (follow prompt)
```
or
To use your own keys pass
```
echo "keys" | chia keys add -
-e keys="twenty four words"
```

To generate keys
To start a farmer only node pass
```
chia keys generate
-e farmer="true"
```

If added the optional plots earlier

To start a harvester only node pass
```
chia plots add -d /plots
-e harvester="true" -e farmer_address="addres.of.farmer" -e farmer_port="portnumber"
```

you can start chia as usual
```
chia start farmer
optional single purpose node
(chia start farmer-only)
(chia start harvester)
```

verify things are working
```
chia show -s -c
```

drop from shell, leave running Container
```
exit
```
#### or run the same commands externally with venv
#### or run the commands externally with venv
```
docker exec -it chia venv/bin/chia keys generate OR docker exec -it chia venv/bin/chia keys add
docker exec -it chia venv/bin/chia keys add
docker exec -it chia venv/bin/chia plots add -d /plots
docker exec -it chia venv/bin/chia start farmer
```

#### status from outside the container
Expand Down

0 comments on commit 01b624b

Please sign in to comment.