Skip to content

Commit 1661c87

Browse files
authored
Merge pull request #37 from RandyMcMillan/codespell
codespell and follow up TRIPLET make support
2 parents e745c44 + dda9754 commit 1661c87

File tree

9 files changed

+111
-38
lines changed

9 files changed

+111
-38
lines changed

.codespell-ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
3+
hist
4+
rouge

.codespellrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[codespell]
2+
3+
skip = ./docs/material,./.github/workflows/codeql-analysis.yml
4+
5+
ignore-words-list = qwerty
6+

.github/workflows/codespell.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: codespell
3+
4+
# Controls when the action will run.
5+
on: [push, pull_request]
6+
7+
jobs:
8+
9+
ubuntu-site-matrix:
10+
name: github-workspace
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-latest]
15+
steps:
16+
- uses: styfle/[email protected]
17+
with:
18+
access_token: ${{ github.token }}
19+
- uses: actions/checkout@v2
20+
- name: printenv
21+
run: |
22+
printenv
23+
- name: install-codespell-asciidoctor
24+
run: |
25+
sudo apt install asciidoctor
26+
pip3 install -U codespell
27+
go get github.com/client9/misspell/cmd/misspell
28+
- name: markdown-syntax
29+
run: |
30+
git grep -n --color $'\r' -- "*.md" && echo "^ Possible Windows style line ending detected. Please use Unix style line endings (\n)." && exit 0 || true
31+
git grep -n --color ' $' -- "*.md" && echo "^ Trailing space detected at end of line. Please remove." && exit 0 || true
32+
git grep -n --color $'\t' -- "*.md" && echo "^ Use of tabs detected. Please use space for indentation." && exit 0 || true
33+
git grep -iE -n --color '(^| )(\w+) \2(\.|,|:|;| |$)' -- "*.md" && echo "^ Detected lexical illusion in the form of a duplicated word. Please correct." && exit 0 || true
34+
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
35+
git grep "" -- "*.md" | uniq -c | grep -1 "^ [2-9] " | cut -b9- | sed 's/:$/:[more-than-one-blank-line-here-please-remove]/' \
36+
| grep ":" && echo "^ Multiple blank lines detected. Please use only one blank line between paragraphs." && exit 0 || true
37+
- name: codespell-py-md
38+
run: |
39+
codespell --config .codespellrc --ignore-words .codespell-ignore $(git ls-files -- "*.py" "*.md")
40+
- name: codespell-html
41+
run: |
42+
codespell --config .codespellrc --ignore-words .codespell-ignore ./docs/docs/*.html
43+
- name: git-grep-terms-debug
44+
run: |
45+
echo "change when needed for PRs"
46+
git grep ARCH
47+
git grep TRIPLET
48+
git grep "version: \"3"
49+

GNUmakefile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export TIME
1010
ARCH :=$(shell uname -m)
1111
export ARCH
1212
ifeq ($(ARCH),x86_64)
13-
ARCH :=x86_64-linux-gnu
14-
export ARCH
13+
TRIPLET :=x86_64-linux-gnu
14+
export TRIPLET
1515
endif
1616
ifeq ($(ARCH),arm64)
17-
ARCH :=aarch64-linux-gnu
18-
export ARCH
17+
TRIPLET :=aarch64-linux-gnu
18+
export TRIPLET
1919
endif
2020

2121
ifeq ($(user),)
@@ -233,6 +233,7 @@ report:
233233
@echo ' - TIME=${TIME}'
234234
@echo ' - PACKAGE_PREFIX=${PACKAGE_PREFIX}'
235235
@echo ' - ARCH=${ARCH}'
236+
@echo ' - TRIPLET=${TRIPLET}'
236237
@echo ' - HOST_USER=${HOST_USER}'
237238
@echo ' - HOST_UID=${HOST_UID}'
238239
@echo ' - PUBLIC_PORT=${PUBLIC_PORT}'
@@ -284,18 +285,16 @@ ifneq ($(shell id -u),0)
284285
@echo 'sudo make init #try if permissions issue'
285286
endif
286287
@echo 'init'
287-
mkdir -p volumes/tor_datadir
288-
mkdir -p volumes/tor_servicesdir
289-
touch volumes/tor_datadir/.gitkeep
290-
touch volumes/tor_servicesdir/.gitkeep
291288
ifneq ($(shell id -u),0)
292289
sudo -s bash -c 'rm -f /usr/local/bin/play'
293290
sudo -s bash -c 'install -v $(PWD)/scripts/* /usr/local/bin'
294291
ifneq ($(PIP3),)
295292
$(PIP3) install -r requirements.txt
293+
$(PYTHON3) ./plebnet_generate.py TRIPLET=$(TRIPLET)
296294
pushd docs && $(PIP3) install -r requirements.txt && popd
297295
else
298296
$(PIP) install -r requirements.txt
297+
$(PYTHON) ./plebnet_generate.py TRIPLET=$(TRIPLET)
299298
pushd docs && $(PIP) install -r requirements.txt && popd
300299
endif
301300

@@ -305,12 +304,12 @@ endif
305304
#######################
306305
.PHONY: install
307306
install: init
308-
bash -c './install.sh $(ARCH)'
309-
bash -c 'make btcd'
307+
bash -c './install.sh $(TRIPLET)'
308+
#bash -c 'make btcd'
310309
#######################
311310
.PHONY: uninstall
312311
uninstall:
313-
bash -c './uninstall.sh $(ARCH)'
312+
bash -c './uninstall.sh $(TRIPLET)'
314313
#######################
315314
.PHONY: run
316315
run: docs init

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cd plebnet-playground-docker
5151
TRIPLET=x86_64-linux-gnu ./install.sh
5252
```
5353

54-
### Install and start just the `bitcoind`,`lnd` services (comma seperate them)
54+
### Install and start just the `bitcoind`,`lnd` services (comma separate them)
5555
```sh
5656
TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh
5757
```

docs/docs/index.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,28 @@ cd plebnet-playground-docker
3232
| arm 32-bit linux | arm-linux-gnueabihf |
3333
| ARM64 linux | aarch64-linux-gnu |
3434

35+
### Services
36+
| Service | Description |
37+
| ----------- | ----------- |
38+
| bitcoind | Bitcoin Core Daemon |
39+
| lnd | Lightning Labs LND Daemon |
40+
| tor | tor network daemon |
41+
| rtl | Ride The Lightning Daemon |
42+
| thunderhub | Thunderhub Lightning UI |
43+
| docs | MKDocs documentation |
44+
| notebook | Jupyter Notebook environment setup for lightning development |
45+
| dashboard | Jupyter Dashboard |
46+
3547
### Install and start all services (Intel x64 example)
3648
***
3749

3850
```sh
39-
ARCH=x86_64-linux-gnu ./install.sh
51+
TRIPLET=x86_64-linux-gnu ./install.sh
4052
```
4153

42-
### Install and start just the `rtl` service (ride-the-lightning)
43-
***
54+
### Install and start just the `bitcoind`,`lnd` services (comma separate them)
4455
```sh
45-
ARCH=x86_64-linux-gnu services=rtl ./install.sh
56+
TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh
4657
```
4758

4859
### Stop containers
@@ -142,16 +153,6 @@ USE_TEST_DATA=TRUE docker-compose up dashboard
142153

143154
![Plebnet Dashboard](./images/plebnet_dashboard.png)
144155

145-
### How to run development notebook
146-
147-
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:
148-
149-
* [networkx](https://networkx.org/) - graph construction and analysis
150-
* [plotly/dash](https://dash.plotly.com/) - visualization framework/data-driven graphical user interfaces
151-
* [pandas](https://pandas.pydata.org/pandas-docs/stable/getting_started/overview.html) - data analysis/manipulation
152-
* [numpy](https://numpy.org/doc/stable/user/whatisnumpy.html) array manipulation
153-
* [scipy](https://docs.scipy.org/doc/scipy/reference/dev/index.html#scipy-development) scientific data analysis
154-
155156
### Additional reference material
156157
- [Plebnet Wiki](https://plebnet.wiki)
157158
- [Bitcoin Wiki](https://bitcoin.it)

install.sh

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
1-
# if [ -z "$1" ]
2-
# then
3-
# echo 'You must provide TRIPLET as first parameter'
4-
# echo './install.sh x86_64-linux-gnu'
5-
# exit;
6-
# fi
7-
8-
# TRIPLET=$1
9-
10-
: ${TRIPLET:=x86_64-linux-gnu}
1+
if [ -z "$1" ]
2+
then
3+
if [[ "$(echo uname -m)" == "arm64" ]];then
4+
TRIPLET=aarch64-linx-gnu
5+
echo TRIPLET=$TRIPLET
6+
else
7+
#echo 'You must provide TRIPLET as first parameter'
8+
#echo './install.sh x86_64-linux-gnu'
9+
echo
10+
fi
11+
echo "EXAMPLE:"
12+
echo " TRIPLET=x86_64-linux-gnu ./install.sh"
13+
echo "EXAMPLE:"
14+
echo " TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh"
15+
TRIPLET=$(uname -m)-linux-gnu
16+
echo TRIPLET=$TRIPLET
17+
echo services:$services
18+
echo
19+
else
20+
TRIPLET=$1
21+
: ${TRIPLET:=$TRIPLET}
1122
: ${services:=Null}
23+
fi
24+
1225

1326
#Remove any old version
14-
docker-compose down
27+
docker-compose down
1528

1629
python plebnet_generate.py TRIPLET=$TRIPLET services=$services
1730

plebnet_generate.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Generates docker-compose from command line.
23
#
34
# For each service identified at command line, this we identify other dependent services and add them to the config.

worklogs/asherp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Above command does not actually strip the newline character. When I decode in py
254254

255255
* fixed up arch table
256256
* `ARCH=aarch64-linux-gnu` works on my mac. bitcoind starts up
257-
* docker-compose was not stoping containers on my mac, but restarting docker desktop from tray icon worked
257+
* docker-compose was not stopping containers on my mac, but restarting docker desktop from tray icon worked
258258
* docker-compose up sometimes fails with tor still running: `docker system prune` resolved my issue
259259
* ignore data volumes and any dev-dependent hourly configs
260260
* added worklogs directory for dev time tracking

0 commit comments

Comments
 (0)