Skip to content

Commit

Permalink
Merge pull request #37 from RandyMcMillan/codespell
Browse files Browse the repository at this point in the history
codespell and follow up TRIPLET make support
  • Loading branch information
rsafier authored Sep 21, 2021
2 parents e745c44 + dda9754 commit 1661c87
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .codespell-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]

hist
rouge
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]

skip = ./docs/material,./.github/workflows/codeql-analysis.yml

ignore-words-list = qwerty

49 changes: 49 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This is a basic workflow to help you get started with Actions
name: codespell

# 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/[email protected]
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: 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
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-py-md
run: |
codespell --config .codespellrc --ignore-words .codespell-ignore $(git ls-files -- "*.py" "*.md")
- name: codespell-html
run: |
codespell --config .codespellrc --ignore-words .codespell-ignore ./docs/docs/*.html
- name: git-grep-terms-debug
run: |
echo "change when needed for PRs"
git grep ARCH
git grep TRIPLET
git grep "version: \"3"
21 changes: 10 additions & 11 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down Expand Up @@ -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}'
Expand Down Expand Up @@ -284,18 +285,16 @@ 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'
ifneq ($(PIP3),)
$(PIP3) install -r requirements.txt
$(PYTHON3) ./plebnet_generate.py TRIPLET=$(TRIPLET)
pushd docs && $(PIP3) install -r requirements.txt && popd
else
$(PIP) install -r requirements.txt
$(PYTHON) ./plebnet_generate.py TRIPLET=$(TRIPLET)
pushd docs && $(PIP) install -r requirements.txt && popd
endif

Expand All @@ -305,12 +304,12 @@ endif
#######################
.PHONY: install
install: init
bash -c './install.sh $(ARCH)'
bash -c 'make btcd'
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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
29 changes: 15 additions & 14 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
35 changes: 24 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions plebnet_generate.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion worklogs/asherp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1661c87

Please sign in to comment.