From 8b1e76869d88acf96522f8cab3ae2555f585fcb1 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 12:33:19 -0400 Subject: [PATCH 01/11] codespell: initial config --- .codespell-ignore | 4 +++ .codespellrc | 6 ++++ .github/workflows/codespell.yml | 50 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .codespell-ignore create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml diff --git a/.codespell-ignore b/.codespell-ignore new file mode 100644 index 000000000..d85227829 --- /dev/null +++ b/.codespell-ignore @@ -0,0 +1,4 @@ +[codespell] + +hist +rouge diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 000000000..6525905e4 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] + +skip = ./docs/material + +ignore-words-list = bA, ba, bA, keypair, BA, Wan + diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..72d5c5f98 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,50 @@ +# This is a basic workflow to help you get started with Actions +name: workflow-matrix + +# Controls when the action will run. +on: [push, pull_request] + +jobs: + + ubuntu-site-matrix: + name: github-workspace + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04, ubuntu-latest] + steps: + - uses: styfle/cancel-workflow-action@0.8.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: printenv + run: | + printenv + - name: install-codespell-asciidoctor + run: | + sudo apt install asciidoctor + pip3 install -U codespell + go get github.com/client9/misspell/cmd/misspell + - name: git-grep + run: | + git grep -n --color $'\r' -- "*.md" && echo "^ Possible Windows style line ending detected. Please use Unix style line endings (\n)." && exit 0 || true + git grep -n --color ' $' -- "*.md" && echo "^ Trailing space detected at end of line. Please remove." && exit 0 || true + git grep -n --color $'\t' -- "*.md" && echo "^ Use of tabs detected. Please use space for indentation." && exit 0 || true + git grep -iE -n --color '(^| )(\w+) \2(\.|,|:|;| |$)' -- "*.md" && echo "^ Detected lexical illusion in the form of a duplicated word. Please correct." && exit 0 || true + for FILE in $(git ls-files -- "*.md"); do if [[ $(tail -c1 $FILE) != "" ]]; then echo "File ${FILE} does not end with a newline character (\n)."; exit 0; fi; done + git grep "" -- "*.md" | uniq -c | grep -1 "^ [2-9] " | cut -b9- | sed 's/:$/:[more-than-one-blank-line-here-please-remove]/' \ + | grep ":" && echo "^ Multiple blank lines detected. Please use only one blank line between paragraphs." && exit 0 || true + - name: codespell-asciidoc + run: | + codespell --config .codespellrc --ignore-words .codespell-ignore $(git ls-files -- "*.asciidoc" "*.md") + - name: run-asciidoctor + run: | + asciidoctor -D html *.asciidoc + asciidoctor -D html/contrib ./contrib/*.asciidoc + - name: codespell-html + run: | + codespell --config .codespellrc --ignore-words .codespell-ignore ./html/*.html + - name: git-grep-lighting + run: | + git grep lighting + From 9cbc89c96652fb8c3c9b7e0d042a2cc1fcfef6ff Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 12:53:47 -0400 Subject: [PATCH 02/11] plebnet_generate.py:chmod +x - add hash bang --- plebnet_generate.py | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 plebnet_generate.py diff --git a/plebnet_generate.py b/plebnet_generate.py old mode 100644 new mode 100755 index b200005a5..fcd735b68 --- a/plebnet_generate.py +++ b/plebnet_generate.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # Generates docker-compose from command line. # # For each service identified at command line, this we identify other dependent services and add them to the config. From 64d0fd04c237a55f517ec7c72120c163e38448ba Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 13:03:56 -0400 Subject: [PATCH 03/11] make: install - trigger ./plebnet-generate.py --- GNUmakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index 81f554e73..9d11b54d6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -293,9 +293,11 @@ ifneq ($(shell id -u),0) sudo -s bash -c 'install -v $(PWD)/scripts/* /usr/local/bin' ifneq ($(PIP3),) $(PIP3) install -r requirements.txt + $(PYTHON3) ./plebnet_generate.py pushd docs && $(PIP3) install -r requirements.txt && popd else $(PIP) install -r requirements.txt + $(PYTHON) ./plebnet_generate.py pushd docs && $(PIP) install -r requirements.txt && popd endif From c1d2d11c2de0c0b18619c78c219a4557609f63f0 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 13:06:26 -0400 Subject: [PATCH 04/11] README.md: codespell correction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7ccc6eb3..5f00bfa95 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ cd plebnet-playground-docker TRIPLET=x86_64-linux-gnu ./install.sh ``` -### Install and start just the `bitcoind`,`lnd` services (comma seperate them) +### Install and start just the `bitcoind`,`lnd` services (comma separate them) ```sh TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh ``` From 8a9f26278a4a7ca9befc796b7500e48e4da5be99 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 13:08:04 -0400 Subject: [PATCH 05/11] codespellrc: ignore .github/.../codeql.. --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index 6525905e4..8236826f1 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,6 @@ [codespell] -skip = ./docs/material +skip = ./docs/material,./.github/workflows/codeql-analysis.yml ignore-words-list = bA, ba, bA, keypair, BA, Wan From 8266fe0cd9b89157e9ae27aaf6cc59e05b3bc8c7 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 13:12:26 -0400 Subject: [PATCH 06/11] docs: update index.md --- docs/docs/index.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index cdd2e33fa..1636a49e9 100755 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -32,17 +32,28 @@ cd plebnet-playground-docker | arm 32-bit linux | arm-linux-gnueabihf | | ARM64 linux | aarch64-linux-gnu | +### Services +| Service | Description | +| ----------- | ----------- | +| bitcoind | Bitcoin Core Daemon | +| lnd | Lightning Labs LND Daemon | +| tor | tor network daemon | +| rtl | Ride The Lightning Daemon | +| thunderhub | Thunderhub Lightning UI | +| docs | MKDocs documentation | +| notebook | Jupyter Notebook environment setup for lightning development | +| dashboard | Jupyter Dashboard | + ### Install and start all services (Intel x64 example) *** ```sh -ARCH=x86_64-linux-gnu ./install.sh +TRIPLET=x86_64-linux-gnu ./install.sh ``` -### Install and start just the `rtl` service (ride-the-lightning) -*** +### Install and start just the `bitcoind`,`lnd` services (comma separate them) ```sh -ARCH=x86_64-linux-gnu services=rtl ./install.sh +TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh ``` ### Stop containers @@ -142,16 +153,6 @@ USE_TEST_DATA=TRUE docker-compose up dashboard ![Plebnet Dashboard](./images/plebnet_dashboard.png) -### How to run development notebook - -If you ran `docker-compose up -d` above, the notebook server should be running at `localhost:8888` and the default password is `plebnet`. Any notebooks created within the container should be accessable from your host machine in the in this repo's `notebooks/` subdirectory. At present, the notebooks container has the following packages pre-installed: - -* [networkx](https://networkx.org/) - graph construction and analysis -* [plotly/dash](https://dash.plotly.com/) - visualization framework/data-driven graphical user interfaces -* [pandas](https://pandas.pydata.org/pandas-docs/stable/getting_started/overview.html) - data analysis/manipulation -* [numpy](https://numpy.org/doc/stable/user/whatisnumpy.html) array manipulation -* [scipy](https://docs.scipy.org/doc/scipy/reference/dev/index.html#scipy-development) scientific data analysis - ### Additional reference material - [Plebnet Wiki](https://plebnet.wiki) - [Bitcoin Wiki](https://bitcoin.it) From ad6e93dcb12c9b4b67975e7e3bdfc4bef9043cc8 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 13:22:00 -0400 Subject: [PATCH 07/11] make: TRIPLET support/usage --- GNUmakefile | 13 +++++++------ worklogs/asherp.md | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 9d11b54d6..fdf218558 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -10,12 +10,12 @@ export TIME ARCH :=$(shell uname -m) export ARCH ifeq ($(ARCH),x86_64) -ARCH :=x86_64-linux-gnu -export ARCH +TRIPLET :=x86_64-linux-gnu +export TRIPLET endif ifeq ($(ARCH),arm64) -ARCH :=aarch64-linux-gnu -export ARCH +TRIPLET :=aarch64-linux-gnu +export TRIPLET endif ifeq ($(user),) @@ -233,6 +233,7 @@ report: @echo ' - TIME=${TIME}' @echo ' - PACKAGE_PREFIX=${PACKAGE_PREFIX}' @echo ' - ARCH=${ARCH}' + @echo ' - TRIPLET=${TRIPLET}' @echo ' - HOST_USER=${HOST_USER}' @echo ' - HOST_UID=${HOST_UID}' @echo ' - PUBLIC_PORT=${PUBLIC_PORT}' @@ -293,11 +294,11 @@ ifneq ($(shell id -u),0) sudo -s bash -c 'install -v $(PWD)/scripts/* /usr/local/bin' ifneq ($(PIP3),) $(PIP3) install -r requirements.txt - $(PYTHON3) ./plebnet_generate.py + $(PYTHON3) ./plebnet_generate.py TRIPLET=$(TRIPLET) pushd docs && $(PIP3) install -r requirements.txt && popd else $(PIP) install -r requirements.txt - $(PYTHON) ./plebnet_generate.py + $(PYTHON) ./plebnet_generate.py TRIPLET=$(TRIPLET) pushd docs && $(PIP) install -r requirements.txt && popd endif diff --git a/worklogs/asherp.md b/worklogs/asherp.md index 802fad66f..a0629c5f2 100644 --- a/worklogs/asherp.md +++ b/worklogs/asherp.md @@ -254,7 +254,7 @@ Above command does not actually strip the newline character. When I decode in py * fixed up arch table * `ARCH=aarch64-linux-gnu` works on my mac. bitcoind starts up -* docker-compose was not stoping containers on my mac, but restarting docker desktop from tray icon worked +* docker-compose was not stopping containers on my mac, but restarting docker desktop from tray icon worked * docker-compose up sometimes fails with tor still running: `docker system prune` resolved my issue * ignore data volumes and any dev-dependent hourly configs * added worklogs directory for dev time tracking From 7a1ae7bdd45cd7dfd1e7410fab1c7d86f394710f Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 13:25:47 -0400 Subject: [PATCH 08/11] workflow: codespell *.py --- .github/workflows/codespell.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 72d5c5f98..7d83d3ff2 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -1,5 +1,5 @@ # This is a basic workflow to help you get started with Actions -name: workflow-matrix +name: codespell # Controls when the action will run. on: [push, pull_request] @@ -34,17 +34,14 @@ jobs: for FILE in $(git ls-files -- "*.md"); do if [[ $(tail -c1 $FILE) != "" ]]; then echo "File ${FILE} does not end with a newline character (\n)."; exit 0; fi; done git grep "" -- "*.md" | uniq -c | grep -1 "^ [2-9] " | cut -b9- | sed 's/:$/:[more-than-one-blank-line-here-please-remove]/' \ | grep ":" && echo "^ Multiple blank lines detected. Please use only one blank line between paragraphs." && exit 0 || true - - name: codespell-asciidoc + - name: codespell-py-md run: | - codespell --config .codespellrc --ignore-words .codespell-ignore $(git ls-files -- "*.asciidoc" "*.md") - - name: run-asciidoctor - run: | - asciidoctor -D html *.asciidoc - asciidoctor -D html/contrib ./contrib/*.asciidoc + codespell --config .codespellrc --ignore-words .codespell-ignore $(git ls-files -- "*.py" "*.md") - name: codespell-html run: | - codespell --config .codespellrc --ignore-words .codespell-ignore ./html/*.html - - name: git-grep-lighting + codespell --config .codespellrc --ignore-words .codespell-ignore ./docs/docs/*.html + - name: git-grep-terms run: | - git grep lighting + git grep ARCH + git grep TRIPLET From 2c749806eb69db88eb1d633dfe3a2cc4de3b1823 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 14:36:34 -0400 Subject: [PATCH 09/11] make: more TRIPLET support --- GNUmakefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index fdf218558..9a86b6af6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -285,10 +285,6 @@ ifneq ($(shell id -u),0) @echo 'sudo make init #try if permissions issue' endif @echo 'init' - mkdir -p volumes/tor_datadir - mkdir -p volumes/tor_servicesdir - touch volumes/tor_datadir/.gitkeep - touch volumes/tor_servicesdir/.gitkeep ifneq ($(shell id -u),0) sudo -s bash -c 'rm -f /usr/local/bin/play' sudo -s bash -c 'install -v $(PWD)/scripts/* /usr/local/bin' @@ -308,12 +304,12 @@ endif ####################### .PHONY: install install: init - bash -c './install.sh $(ARCH)' + bash -c './install.sh $(TRIPLET)' bash -c 'make btcd' ####################### .PHONY: uninstall uninstall: - bash -c './uninstall.sh $(ARCH)' + bash -c './uninstall.sh $(TRIPLET)' ####################### .PHONY: run run: docs init From d8ed853390d32565b48c7c9481afe95383963044 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 14:36:57 -0400 Subject: [PATCH 10/11] install.sh: TRIPLET support - no exit no fail --- .codespellrc | 2 +- .github/workflows/codespell.yml | 5 +++-- install.sh | 35 ++++++++++++++++++++++----------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.codespellrc b/.codespellrc index 8236826f1..b31827f1e 100644 --- a/.codespellrc +++ b/.codespellrc @@ -2,5 +2,5 @@ skip = ./docs/material,./.github/workflows/codeql-analysis.yml -ignore-words-list = bA, ba, bA, keypair, BA, Wan +ignore-words-list = qwerty diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7d83d3ff2..5e481aba4 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -25,7 +25,7 @@ jobs: sudo apt install asciidoctor pip3 install -U codespell go get github.com/client9/misspell/cmd/misspell - - name: git-grep + - name: markdown-syntax run: | git grep -n --color $'\r' -- "*.md" && echo "^ Possible Windows style line ending detected. Please use Unix style line endings (\n)." && exit 0 || true git grep -n --color ' $' -- "*.md" && echo "^ Trailing space detected at end of line. Please remove." && exit 0 || true @@ -40,8 +40,9 @@ jobs: - name: codespell-html run: | codespell --config .codespellrc --ignore-words .codespell-ignore ./docs/docs/*.html - - name: git-grep-terms + - name: git-grep-terms-debug run: | + echo "change when needed for PRs" git grep ARCH git grep TRIPLET diff --git a/install.sh b/install.sh index ad1a90201..3f2c37c70 100755 --- a/install.sh +++ b/install.sh @@ -1,17 +1,30 @@ -# if [ -z "$1" ] -# then -# echo 'You must provide TRIPLET as first parameter' -# echo './install.sh x86_64-linux-gnu' -# exit; -# fi - -# TRIPLET=$1 - -: ${TRIPLET:=x86_64-linux-gnu} +if [ -z "$1" ] + then + if [[ "$(echo uname -m)" == "arm64" ]];then + TRIPLET=aarch64-linx-gnu + echo TRIPLET=$TRIPLET + else + #echo 'You must provide TRIPLET as first parameter' + #echo './install.sh x86_64-linux-gnu' + echo + fi + echo "EXAMPLE:" + echo " TRIPLET=x86_64-linux-gnu ./install.sh" + echo "EXAMPLE:" + echo " TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh" + TRIPLET=$(uname -m)-linux-gnu + echo TRIPLET=$TRIPLET + echo services:$services + echo +else +TRIPLET=$1 +: ${TRIPLET:=$TRIPLET} : ${services:=Null} +fi + #Remove any old version -docker-compose down +docker-compose down python plebnet_generate.py TRIPLET=$TRIPLET services=$services From dda9754d158fe722fe57d08f8c9d1e703a87ef23 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 21 Sep 2021 15:33:39 -0400 Subject: [PATCH 11/11] codespell: git grep "version: \"3" --- .github/workflows/codespell.yml | 1 + GNUmakefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 5e481aba4..8a28e6d48 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -45,4 +45,5 @@ jobs: echo "change when needed for PRs" git grep ARCH git grep TRIPLET + git grep "version: \"3" diff --git a/GNUmakefile b/GNUmakefile index 9a86b6af6..1cd04e874 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -305,7 +305,7 @@ endif .PHONY: install install: init bash -c './install.sh $(TRIPLET)' - bash -c 'make btcd' + #bash -c 'make btcd' ####################### .PHONY: uninstall uninstall: