-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
raingggg
committed
Apr 1, 2022
1 parent
8469ab2
commit 3b33b66
Showing
17 changed files
with
5,190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: develop-body | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*_ecostake' | ||
- 'v*.*.*_all' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
logout: true | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: ./dockers/coctohug-ecostake/dockerfile | ||
context: ./dockers/coctohug-ecostake | ||
platforms: linux/amd64 | ||
push: true | ||
build-args: | | ||
"CODE_BRANCH=1.0.2" | ||
tags: | | ||
${{ secrets.DOCKER_HUB_USERNAME }}/coctohug-ecostake:develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
how to evalate? | ||
1. cert name | ||
2. appname | ||
3. root folderpath | ||
4. mainnet folderpath | ||
|
||
replaces: | ||
1. chain url | ||
2. all replace | ||
3. tag | ||
4. controller port | ||
12. ssl | ||
7. target_address | ||
5. farmer port | ||
6. fullnode port | ||
8. site.js | ||
|
||
13. folder_name | ||
14. appname | ||
|
||
9. commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Git | ||
.git | ||
.gitignore | ||
.gitattributes | ||
.github | ||
|
||
node_modules | ||
*.log | ||
|
||
# macOS (optional) | ||
.DS_Store | ||
|
||
# Visual Studio Code (optional) | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
*.log | ||
|
||
# macOS (optional) | ||
.DS_Store | ||
|
||
# Visual Studio Code (optional) | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/env bash | ||
CODE_BRANCH=$1 | ||
CODE_URL=https://github.com/Ecostake-Network/ecostake-blockchain.git | ||
CODE_FOLDER="/ecostake-blockchain" | ||
BINARY_NAME="ecostake" | ||
|
||
if [ -z ${CODE_BRANCH} ]; then | ||
echo 'Skipping ${BINARY_NAME} install as not requested.' | ||
else | ||
rm -rf /root/.cache | ||
git clone --branch ${CODE_BRANCH} --single-branch ${CODE_URL} ${CODE_FOLDER} \ | ||
&& cd ${CODE_FOLDER} \ | ||
&& git submodule update --init mozilla-ca \ | ||
&& chmod +x install.sh \ | ||
&& /usr/bin/sh ./install.sh | ||
|
||
if [ ! -d /chia-blockchain/venv ]; then | ||
cd / | ||
rmdir /chia-blockchain | ||
ln -s ${CODE_FOLDER} /chia-blockchain | ||
ln -s ${CODE_FOLDER}/venv/bin/${BINARY_NAME} /chia-blockchain/venv/bin/chia | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/env bash | ||
# | ||
# | ||
CODE_FOLDER=/ecostake-blockchain | ||
BINARY_NAME=ecostake | ||
CONFIG_PATH=.ecostake | ||
CHIA_FORK_FOLDER=ecostake | ||
CERT_NAME=ecostake | ||
|
||
cd ${CODE_FOLDER} | ||
|
||
. ./activate | ||
|
||
# Only the /root/.chia folder is volume-mounted so store fork within | ||
mkdir -p /root/.chia/${CHIA_FORK_FOLDER} | ||
rm -f /root/${CONFIG_PATH} | ||
ln -s /root/.chia/${CHIA_FORK_FOLDER} /root/${CONFIG_PATH} | ||
|
||
mkdir -p /root/${CONFIG_PATH}/mainnet/log | ||
${BINARY_NAME} init >> /root/${CONFIG_PATH}/mainnet/log/init.log 2>&1 | ||
|
||
echo "Configuring ${BINARY_NAME}..." | ||
while [ ! -f /root/${CONFIG_PATH}/mainnet/config/config.yaml ]; do | ||
echo "Waiting for creation of /root/${CONFIG_PATH}/mainnet/config/config.yaml..." | ||
sleep 1 | ||
done | ||
sed -i 's/log_stdout: true/log_stdout: false/g' /root/${CONFIG_PATH}/mainnet/config/config.yaml | ||
sed -i 's/log_level: WARNING/log_level: INFO/g' /root/${CONFIG_PATH}/mainnet/config/config.yaml | ||
|
||
# Loop over provided list of key paths | ||
for k in ${keys//:/ }; do | ||
if [ -f ${k} ]; then | ||
echo "Adding key at path: ${k}" | ||
${BINARY_NAME} keys add -f ${k} > /dev/null | ||
else | ||
echo "Skipping '${BINARY_NAME} keys add' as no file found at: ${k}" | ||
fi | ||
done | ||
|
||
# Loop over provided list of completed plot directories | ||
for p in ${plots_dir//:/ }; do | ||
${BINARY_NAME} plots add -d ${p} | ||
done | ||
|
||
sed -i 's/localhost/127.0.0.1/g' ~/${CONFIG_PATH}/mainnet/config/config.yaml | ||
sed -i "s/target_outbound_peer_count: .*/target_outbound_peer_count: ${MAX_PEER_COUNT}/g" ~/${CONFIG_PATH}/mainnet/config/config.yaml | ||
sed -i "s/target_peer_count: .*/target_peer_count: ${MAX_PEER_COUNT}/g" ~/${CONFIG_PATH}/mainnet/config/config.yaml | ||
|
||
chmod 755 -R /root/${CONFIG_PATH}/mainnet/config/ssl/ &> /dev/null | ||
${BINARY_NAME} init --fix-ssl-permissions > /dev/null | ||
|
||
# Start services based on mode selected. Default is 'fullnode' | ||
if [[ ${mode} == 'fullnode' ]]; then | ||
if [ ! -f ~/${CONFIG_PATH}/mainnet/config/ssl/wallet/public_wallet.key ]; then | ||
echo "No wallet key found, so not starting farming services. Please add your mnemonic.txt to /root/.chia and restart." | ||
else | ||
${BINARY_NAME} start farmer | ||
fi | ||
elif [[ ${mode} =~ ^farmer.* ]]; then | ||
if [ ! -f ~/${CONFIG_PATH}/mainnet/config/ssl/wallet/public_wallet.key ]; then | ||
echo "No wallet key found, so not starting farming services. Please add your mnemonic.txt to /root/.chia and restart." | ||
else | ||
${BINARY_NAME} start farmer-no-wallet | ||
fi | ||
elif [[ ${mode} =~ ^harvester.* ]]; then | ||
if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then | ||
echo "A farmer peer address and port are required." | ||
exit | ||
else | ||
if [ ! -f /root/${CONFIG_PATH}/farmer_ca/${CERT_NAME}_ca.crt ]; then | ||
mkdir -p /root/${CONFIG_PATH}/farmer_ca | ||
response=$(curl --write-out '%{http_code}' --silent http://${controller_address}:${worker_web_port}/certificates --output /tmp/certs.zip) | ||
if [ $response == '200' ]; then | ||
unzip /tmp/certs.zip -d /root/${CONFIG_PATH}/farmer_ca | ||
else | ||
echo "Certificates response of ${response} from http://${controller_address}:${worker_web_port}/certificates. Try clicking 'Allow Harvester' menu item on 'Settings' page first." | ||
fi | ||
rm -f /tmp/certs.zip | ||
fi | ||
if [ -f /root/${CONFIG_PATH}/farmer_ca/${CERT_NAME}_ca.crt ]; then | ||
${BINARY_NAME} init -c /root/${CONFIG_PATH}/farmer_ca 2>&1 > /root/${CONFIG_PATH}/mainnet/log/init.log | ||
chmod 755 -R /root/${CONFIG_PATH}/mainnet/config/ssl/ &> /dev/null | ||
${BINARY_NAME} init --fix-ssl-permissions > /dev/null | ||
else | ||
echo "Did not find your farmer's certificates within /root/${CONFIG_PATH}/farmer_ca." | ||
echo "See: https://github.com/raingggg/coctohug/wiki" | ||
fi | ||
${BINARY_NAME} configure --set-farmer-peer ${controller_address}:${farmer_port} | ||
${BINARY_NAME} configure --enable-upnp false | ||
${BINARY_NAME} start harvester -r | ||
fi | ||
elif [[ ${mode} == 'wallet' ]]; then | ||
node /coctohug/flexible_config.js | ||
${BINARY_NAME} start wallet-only | ||
elif [[ ${mode} == 'standard_wallet' ]]; then | ||
${BINARY_NAME} start wallet | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Changelog | ||
|
||
## [1.3.1] - 2021-12-28 | ||
- show correct farming status immediately after users opening the summary page | ||
- update coin price and amount to show at most 8 digits | ||
- optimize docker file to speed up the deploying process | ||
|
||
## [1.3.0] - 2021-12-27 | ||
- fix too many offline and signage point warning issue | ||
|
||
## [1.2.9] - 2021-12-27 | ||
- don't show harvester records on summary page | ||
|
||
## [1.2.8] - 2021-12-27 | ||
- only execute jobs when WebUser is accessing Coctohug, otherwise once per hour at most | ||
- sample 1% chia-watch-dog to save computer resource | ||
- connections page supports adding multiple peers with multiple format | ||
- add blockchain version and port to UI | ||
- show wallet address on Keys and Wallet page | ||
- toggle font-size support on table layout page | ||
- wallet mode js function to automatically alter configuration of connecting fullnode | ||
- table layout ui improvement | ||
- move all js/css into coctohug, instead of using online cdn | ||
|
||
## [1.2.7] - 2021-12-24 | ||
- summary table layout | ||
- summary board color fix when fork number bigger than 20 | ||
- keep 2 days record for: received coins and daily report | ||
|
||
## [1.2.6] - 2021-12-22 | ||
- clear news data longer than 2 days | ||
- clear weekly/all data longer than 2 weeks | ||
- remove chia-watch-dog events from log | ||
- docker wallet-no-farmer mode config.yml edit fix with nodejs | ||
- support new 10+ forks: | ||
chives | ||
avocado | ||
kale | ||
cannabis | ||
melati | ||
sector | ||
scam | ||
fork | ||
|
||
seno | ||
rose | ||
goji | ||
spare | ||
chaingreen | ||
|
||
## [1.2.5] - 2021-12-21 | ||
- allow harverst fix for farmer-no-wallet mode | ||
- ccm full guide | ||
|
||
## [1.2.4] - 2021-12-20 | ||
- show yellow background for not getting data longer than 30 minutes cases | ||
- add version number to leftbar | ||
- use ccm for guide | ||
|
||
## [1.2.3] - 2021-12-20 | ||
- clear logs everyday: watchdoglog, blockchainlog, weblog | ||
- fix chia-watch-dog not sending daily stats | ||
- wallet-no-farmer docker-image fix | ||
|
||
## [1.2.2] - 2021-12-17 | ||
- coin amount fix for 1e-7 cases | ||
|
||
## [1.2.1] - 2021-12-17 | ||
- farmer mode add watch-dog | ||
- wallet mode start blockchain by default | ||
|
||
## [1.2.0] - 2021-12-17 | ||
- farmer support for all forks | ||
- restart fix depeneds on modes | ||
|
||
## [1.1.0] - 2021-12-16 | ||
- harvester support for all forks | ||
- chia and nchain support | ||
- trivial ui fix | ||
|
||
## [1.0.5] - 2021-12-15 | ||
- Account balance of Wallet in US Dollar | ||
- weekly report with coldwallet | ||
- daily report with coldwallet | ||
- auto add 30 peers when it is less than 3 | ||
- fast node sync doc update | ||
- auto archive warning more than 3 days | ||
|
||
## [1.0.1] - 2021-12-12 | ||
- cold wallet support | ||
- received coins support | ||
- watch-dog support | ||
- password protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mkdir -p /coctohug/web/node_modules | ||
npm install --prefix /coctohug/web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
FROM raingggg/coctohug-body:develop | ||
ARG CODE_BRANCH | ||
|
||
# copy local files | ||
RUN mkdir -p /coctohug/web | ||
COPY chain_install.sh /coctohug/ | ||
|
||
# set workdir | ||
WORKDIR /chia-blockchain | ||
|
||
# Install Chia (and forks), Plotman, Chiadog, Coctohug, etc | ||
RUN \ | ||
/usr/bin/bash /coctohug/chain_install.sh ${CODE_BRANCH} | ||
|
||
COPY coctohug_install.sh /coctohug/ | ||
COPY web/package.json /coctohug/web/ | ||
COPY web/package-lock.json /coctohug/web/ | ||
WORKDIR /chia-blockchain | ||
|
||
RUN \ | ||
/usr/bin/bash /coctohug/coctohug_install.sh \ | ||
&& rm -rf \ | ||
/root/.cache \ | ||
/tmp/* \ | ||
/var/lib/apt/lists/* \ | ||
/var/tmp/* | ||
|
||
COPY . /coctohug/ | ||
RUN cp -f /coctohug/entrypoint.sh /chia-blockchain/ | ||
RUN chmod 755 /coctohug/*.sh /chia-blockchain/entrypoint.sh | ||
|
||
# Provide a colon-separated list of in-container paths to your mnemonic keys | ||
ENV keys="/root/.coctohug/mnc.txt" | ||
# Provide a colon-separated list of in-container paths to your completed plots | ||
ENV plots_dir="/plots" | ||
# One of fullnode, farmer, harvester, plotter, farmer+plotter, harvester+plotter. Default is fullnode | ||
ENV mode="fullnode" | ||
# If mode=harvester, required for host and port the harvester will your farmer | ||
ENV farmer_address="null" | ||
|
||
ENV PATH="${PATH}:/chia-blockchain/venv/bin" | ||
ENV TZ=Etc/UTC | ||
ENV FLASK_ENV=production | ||
ENV XDG_CONFIG_HOME=/root/.chia | ||
ENV FORK_CODE_BRANCH=${CODE_BRANCH} | ||
ENV MAX_PEER_COUNT=5 | ||
|
||
VOLUME [ "/id_rsa" ] | ||
|
||
# Local network hostname of a Coctohug controller - localhost when standalone | ||
ENV controller_address="localhost" | ||
ENV controller_web_port=12630 | ||
|
||
ENV WEB_MODE="worker" | ||
ENV worker_address="localhost" | ||
ENV worker_web_port=12693 | ||
EXPOSE 12693 | ||
|
||
# full name of blockchain | ||
ENV config_file="/coctohug/web/blockchain.json" | ||
ENV blockchain="ecostake" | ||
|
||
# blockchain protocol port - forward at router | ||
ENV fullnode_protocol_port="38444" | ||
EXPOSE 38444 | ||
|
||
# blockchain farmer port - DO NOT forward at router | ||
ENV farmer_port="38441" | ||
EXPOSE 38441 | ||
|
||
WORKDIR /chia-blockchain | ||
ENTRYPOINT ["bash", "./entrypoint.sh"] |
Oops, something went wrong.