Skip to content

Commit b67ec5a

Browse files
authored
Merge pull request #774 from jkczyz/2021-01-http-client
HTTP-based block source clients
2 parents e4b516d + 85fdfaa commit b67ec5a

File tree

9 files changed

+1789
-1
lines changed

9 files changed

+1789
-1
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
1.30.0,
1414
# 1.34.2 is Debian stable
1515
1.34.2,
16-
# 1.45.2 is MSRV for lightning-net-tokio and generates coverage
16+
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
1717
1.45.2]
1818
include:
1919
- toolchain: stable
@@ -48,6 +48,24 @@ jobs:
4848
- name: Build on Rust ${{ matrix.toolchain }}
4949
if: "! matrix.build-net-tokio"
5050
run: cargo build --verbose --color always -p lightning
51+
- name: Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features
52+
if: "matrix.build-net-tokio && !matrix.coverage"
53+
run: |
54+
cd lightning-block-sync
55+
cargo build --verbose --color always --features rest-client
56+
cargo build --verbose --color always --features rpc-client
57+
cargo build --verbose --color always --features rpc-client,rest-client
58+
cargo build --verbose --color always --features rpc-client,rest-client,tokio
59+
cd ..
60+
- name: Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
61+
if: matrix.coverage
62+
run: |
63+
cd lightning-block-sync
64+
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rest-client
65+
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client
66+
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client
67+
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client,tokio
68+
cd ..
5169
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio
5270
if: "matrix.build-net-tokio && !matrix.coverage"
5371
run: cargo test --verbose --color always
@@ -57,6 +75,24 @@ jobs:
5775
- name: Test on Rust ${{ matrix.toolchain }}
5876
if: "! matrix.build-net-tokio"
5977
run: cargo test --verbose --color always -p lightning
78+
- name: Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features
79+
if: "matrix.build-net-tokio && !matrix.coverage"
80+
run: |
81+
cd lightning-block-sync
82+
cargo test --verbose --color always --features rest-client
83+
cargo test --verbose --color always --features rpc-client
84+
cargo test --verbose --color always --features rpc-client,rest-client
85+
cargo test --verbose --color always --features rpc-client,rest-client,tokio
86+
cd ..
87+
- name: Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
88+
if: matrix.coverage
89+
run: |
90+
cd lightning-block-sync
91+
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rest-client
92+
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client
93+
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client,rest-client
94+
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client,rest-client,tokio
95+
cd ..
6096
- name: Install deps for kcov
6197
if: matrix.coverage
6298
run: |

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
members = [
44
"lightning",
5+
"lightning-block-sync",
56
"lightning-net-tokio",
67
"lightning-persister",
78
]

lightning-block-sync/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
name = "lightning-block-sync"
3+
version = "0.0.1"
4+
authors = ["Jeffrey Czyz", "Matt Corallo"]
5+
license = "Apache-2.0"
6+
edition = "2018"
7+
description = """
8+
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
9+
"""
10+
11+
[features]
12+
rest-client = [ "serde", "serde_json", "chunked_transfer" ]
13+
rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
14+
15+
[dependencies]
16+
bitcoin = "0.24"
17+
lightning = { version = "0.0.12", path = "../lightning" }
18+
tokio = { version = "1.0", features = [ "io-util", "net" ], optional = true }
19+
serde = { version = "1.0", features = ["derive"], optional = true }
20+
serde_json = { version = "1.0", optional = true }
21+
chunked_transfer = { version = "1.4", optional = true }
22+
futures = { version = "0.3" }
23+
24+
[dev-dependencies]
25+
tokio = { version = "1.0", features = [ "macros", "rt" ] }

0 commit comments

Comments
 (0)