forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 5
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
0 parents
commit 428397a
Showing
22,218 changed files
with
516,087 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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,6 @@ | ||
BasedOnStyle: LLVM | ||
IndentWidth: 8 | ||
UseTab: Always | ||
BreakBeforeBraces: Linux | ||
AllowShortIfStatementsOnASingleLine: false | ||
IndentCaseLabels: false |
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,7 @@ | ||
((c-mode . ((c-file-style . "linux") | ||
(indent-tabs-mode . t) | ||
(show-trailing-whitespace . t) | ||
(c-basic-offset . 8) | ||
(tab-width . 8) | ||
)) | ||
) |
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,3 @@ | ||
Dockerfile | ||
contrib/docker/Dockerfile.* | ||
target |
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,18 @@ | ||
# https://editorconfig.org/#file-format-details | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{**.c,**.h,Makefile}] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
[**.py] | ||
indent_style = space | ||
indent_size = 4 | ||
|
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,20 @@ | ||
# Declare files that will always have CRLF line endings on checkout. | ||
*.sh text eol=lf | ||
*.py text eol=lf | ||
Makefile text eol=lf | ||
configure text eol=lf | ||
.gitmodules text eol=lf | ||
# The following files are generated and should not be shown in the | ||
# diffs by default on Github. | ||
doc/lightning*.7 linguist-generated=true | ||
db_*_sqlgen.c linguist-generated=true | ||
statements_gettextgen.po linguist-generated=true | ||
*_wiregen.? linguist-generated=true | ||
*_printgen.? linguist-generated=true | ||
|
||
# The following are marked as binary and generated since they can be | ||
# easily overwritten and don't need deep review. | ||
cln-grpc/proto/node.proto -text -diff linguist-generated=true | ||
cln-grpc/src/convert.rs -text -diff linguist-generated=true | ||
cln-rpc/src/model.rs -text -diff linguist-generated=true | ||
contrib/pyln-testing/pyln/testing/node_pb2.py -text -diff linguist-generated=true |
Validating CODEOWNERS rules …
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,19 @@ | ||
# Code owners are automatically requested for review when someone | ||
# opens a pull request that modifies code that they own. When someone | ||
# with admin or owner permissions has enabled required reviews, they | ||
# also can optionally require approval from a code owner before the | ||
# author can merge a pull request in the repository. | ||
|
||
cln-grpc/ @cdecker | ||
cln-rpc/ @cdecker | ||
plugins/src/ @cdecker | ||
plugins/grpc-plugin/ @cdecker | ||
contrib/reprobuild/ @cdecker | ||
contrib/msggen/ @cdecker | ||
contrib/pyln-client/ @cdecker | ||
contrib/pyln-testing/ @cdecker | ||
# Needed to ensure hsmd wire compatibility between releases | ||
hsmd/hsmd_wire.csv @cdecker @ksedgwic @devrandom | ||
|
||
# See https://help.github.com/articles/about-codeowners/ for more | ||
# information |
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,4 @@ | ||
### Issue and Steps to Reproduce | ||
<!-- Describe your issue and tell us how to reproduce it (include any useful information). --> | ||
|
||
### `getinfo` output |
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,28 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
DIRNAME="bitcoin-${BITCOIN_VERSION}" | ||
EDIRNAME="elements-${ELEMENTS_VERSION}" | ||
FILENAME="${DIRNAME}-x86_64-linux-gnu.tar.gz" | ||
EFILENAME="${EDIRNAME}-x86_64-linux-gnu.tar.gz" | ||
|
||
cd /tmp/ | ||
|
||
# Since we inadvertently broke `elementsd` support in the past we only | ||
# want to download and enable the daemon that is actually going to be | ||
# used when running in CI. Otherwise we could end up accidentally | ||
# testing against `bitcoind` but still believe that we ran against | ||
# `elementsd`. | ||
if [ "$TEST_NETWORK" = "liquid-regtest" ]; then | ||
wget "https://github.com/ElementsProject/elements/releases/download/elements-${ELEMENTS_VERSION}/${EFILENAME}" | ||
tar -xf "${EFILENAME}" | ||
sudo mv "${EDIRNAME}"/bin/* "/usr/local/bin" | ||
rm -rf "${EFILENAME}" "${EDIRNAME}" | ||
else | ||
wget "https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${FILENAME}" | ||
tar -xf "${FILENAME}" | ||
sudo mv "${DIRNAME}"/bin/* "/usr/local/bin" | ||
rm -rf "${FILENAME}" "${DIRNAME}" | ||
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,102 @@ | ||
#!/bin/bash | ||
set -e | ||
export DEBIAN_FRONTEND=noninteractive | ||
export BITCOIN_VERSION=25.1 | ||
export ELEMENTS_VERSION=22.0.2 | ||
export RUST_VERSION=stable | ||
|
||
sudo useradd -ms /bin/bash tester | ||
sudo apt-get update -qq | ||
|
||
sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \ | ||
autoconf \ | ||
automake \ | ||
binfmt-support \ | ||
build-essential \ | ||
clang \ | ||
cppcheck \ | ||
docbook-xml \ | ||
eatmydata \ | ||
gcc-aarch64-linux-gnu \ | ||
gcc-arm-linux-gnueabihf \ | ||
gcc-arm-none-eabi \ | ||
gettext \ | ||
git \ | ||
libc6-dev-arm64-cross \ | ||
libc6-dev-armhf-cross \ | ||
libpq-dev \ | ||
libprotobuf-c-dev \ | ||
libsqlite3-dev \ | ||
libtool \ | ||
libxml2-utils \ | ||
locales \ | ||
net-tools \ | ||
postgresql \ | ||
python-pkg-resources \ | ||
python3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
qemu \ | ||
qemu-system-arm \ | ||
qemu-user-static \ | ||
shellcheck \ | ||
software-properties-common \ | ||
sudo \ | ||
tcl \ | ||
unzip \ | ||
valgrind \ | ||
wget \ | ||
xsltproc \ | ||
zlib1g-dev | ||
|
||
echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester | ||
sudo chmod 0440 /etc/sudoers.d/tester | ||
|
||
( | ||
cd /tmp/ || exit 1 | ||
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz | ||
wget https://github.com/ElementsProject/elements/releases/download/elements-${ELEMENTS_VERSION}/elements-${ELEMENTS_VERSION}-x86_64-linux-gnu.tar.gz | ||
tar -xf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz | ||
tar -xf elements-${ELEMENTS_VERSION}-x86_64-linux-gnu.tar.gz | ||
sudo mv bitcoin-${BITCOIN_VERSION}/bin/* /usr/local/bin | ||
sudo mv elements-${ELEMENTS_VERSION}/bin/* /usr/local/bin | ||
rm -rf \ | ||
bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \ | ||
bitcoin-${BITCOIN_VERSION} \ | ||
elements-${ELEMENTS_VERSION}-x86_64-linux-gnu.tar.gz \ | ||
elements-${ELEMENTS_VERSION} | ||
) | ||
|
||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ | ||
-y --default-toolchain ${RUST_VERSION} | ||
|
||
# We also need a relatively recent protobuf-compiler, at least 3.12.0, | ||
# in order to support the experimental `optional` flag. | ||
|
||
# BUT WAIT! Gentoo wants this to match the version from the Python protobuf, | ||
# which comes from the same tree. Makes sense! | ||
|
||
# And | ||
# grpcio-tools-1.54.0` requires `protobuf = ">=4.21.6,<5.0dev"` | ||
|
||
# Now, protoc changed to date-based releases, BUT Python protobuf | ||
# didn't, so Python protobuf 4.21.12 (in Ubuntu 23.04) corresponds to | ||
# protoc 21.12 (which, FYI, is packaged in Ubuntu as version 3.21.12). | ||
|
||
# So we're going to nail these versions as 21.12, which is what recent | ||
# Ubuntu has, and hopefully everyone else can get. And this means that | ||
# When CI checks that no files have changed under regeneration, you won't | ||
# get a fail just because the dev's protoc is a different version. | ||
|
||
# Honorable mention go to Matt Whitlock for spelunking this horror with me! | ||
|
||
PROTOC_VERSION=21.12 | ||
PB_REL="https://github.com/protocolbuffers/protobuf/releases" | ||
curl -LO $PB_REL/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip | ||
sudo unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/ | ||
sudo chmod a+x /usr/local/bin/protoc | ||
export PROTOC=/usr/local/bin/protoc | ||
export PATH=$PATH:/usr/local/bin | ||
env | ||
ls -lha /usr/local/bin |
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,92 @@ | ||
import os | ||
from time import sleep | ||
import requests | ||
import re | ||
|
||
# readme url | ||
URL = "https://dash.readme.com/api/v1/docs" | ||
# category id for API reference | ||
CATEGORY_ID = "63e4e160c60b2e001dd1cc4e" | ||
|
||
|
||
def checkIfDocIsPresent(title, headers): | ||
|
||
check_url = URL + "/" + title | ||
response = requests.get(check_url, headers=headers) | ||
|
||
if response.status_code == 200: | ||
return True | ||
else: | ||
return False | ||
|
||
|
||
def publishDoc(title, body, order): | ||
key = os.environ.get("README_API_KEY") | ||
payload = { | ||
"title": title, | ||
"type": "basic", | ||
"body": body, | ||
"category": CATEGORY_ID, | ||
"hidden": False, | ||
"order": order, | ||
} | ||
headers = { | ||
"accept": "application/json", | ||
"content-type": "application/json", | ||
"authorization": "Basic " + key, | ||
} | ||
|
||
isDocPresent = checkIfDocIsPresent(title, headers) | ||
if isDocPresent: | ||
# update doc | ||
update_url = URL + "/" + title # title == slug | ||
response = requests.put(update_url, json=payload, headers=headers) | ||
if response.status_code != 200: | ||
print(response.text) | ||
else: | ||
print("Updated ", title) | ||
else: | ||
# create doc | ||
response = requests.post(URL, json=payload, headers=headers) | ||
if response.status_code != 201: | ||
print(response.text) | ||
else: | ||
print("Created ", title) | ||
|
||
|
||
def extract_rpc_commands(rst_content): | ||
manpages_block = re.search( | ||
r"\.\. block_start manpages(.*?)" r"\.\. block_end manpages", | ||
rst_content, | ||
re.DOTALL, | ||
) | ||
if manpages_block: | ||
commands = re.findall( | ||
r"\b([a-zA-Z0-9_-]+)" r"\s+<([^>]+)>\n", manpages_block.group(1) | ||
) | ||
return commands | ||
return [] | ||
|
||
|
||
def main(): | ||
# path to the rst file from where we fetch all the RPC commands | ||
path_to_rst = "doc/index.rst" | ||
with open(path_to_rst, "r") as file: | ||
rst_content = file.read() | ||
|
||
commands = extract_rpc_commands(rst_content) | ||
if commands: | ||
order = 0 | ||
for name, file in commands: | ||
print(f"{name}\t\t{file}") | ||
with open("doc/" + file) as f: | ||
body = f.read() | ||
publishDoc(name, body, order) | ||
order = order + 1 | ||
sleep(3) | ||
else: | ||
print("No commands found in the Manpages block.") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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,87 @@ | ||
name: FreeBSD Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
pull_request: | ||
|
||
jobs: | ||
testfreebsd: | ||
runs-on: macos-10.15 | ||
name: Build and test on FreeBSD | ||
timeout-minutes: 120 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Test in FreeBSD | ||
id: test | ||
uses: vmactions/[email protected] | ||
with: | ||
usesh: true | ||
prepare: | | ||
pkg install -y \ | ||
wget \ | ||
py38-pip \ | ||
py38-sqlite3 \ | ||
gmake \ | ||
git \ | ||
python \ | ||
postgresql12-server \ | ||
autoconf \ | ||
automake \ | ||
libtool \ | ||
bash \ | ||
gettext \ | ||
sqlite3 \ | ||
lowdown \ | ||
curl | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2021-08-3z1 | ||
cd /tmp/ || exit 1 | ||
wget https://bitcoincore.org/bin/bitcoin-core-25.1/bitcoin-25.1-x86_64-linux-gnu.tar.gz | ||
tar -xf bitcoin-25.1-x86_64-linux-gnu.tar.bz2 | ||
sudo mv bitcoin-25.1/bin/* /usr/local/bin | ||
rm -rf \ | ||
bitcoin-25.1-x86_64-linux-gnu.tar.gz \ | ||
bitcoin-25.1 | ||
run: | | ||
PATH=/root/.local/bin:$PATH | ||
pip install --user -U wheel pip | ||
pip install --user -U -r requirements.txt | ||
# Install utilities that aren't dependencies, but make | ||
# running tests easier/feasible on CI (and pytest which | ||
# keeps breaking the rerunfailures plugin). | ||
pip install --user -U \ | ||
blinker \ | ||
flake8 \ | ||
mako \ | ||
pytest-sentry \ | ||
pytest-test-groups==1.0.3 \ | ||
pytest-custom-exit-code==0.3.0 \ | ||
pytest-json-report | ||
git clone https://github.com/lightning/bolts.git ../bolts | ||
# fatal: unsafe repository ('/Users/runner/work/lightning/lightning' is owned by someone else) | ||
git config --global --add safe.directory `pwd` | ||
git submodule update --init --recursive | ||
./configure CC="$CC" --disable-valgrind | ||
cat config.vars | ||
cat << EOF > pytest.ini | ||
[pytest] | ||
addopts=-p no:logging --color=yes --timeout=1800 --timeout-method=thread --test-group-random-seed=42 --junitxml=report.xml --json-report --json-report-file=report.json --json-report-indent=2 | ||
markers = | ||
slow_test: marks tests as slow (deselect with '-m "not slow_test"') | ||
EOF | ||
# Just run a "quick" test without memory checking | ||
gmake | ||
# Clean up to maximize rsync's chances of succeeding | ||
gmake clean | ||
Oops, something went wrong.