Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@ jobs:
- name: Run cargo fmt
run: cargo +nightly fmt --all --check

- name: Run cargo doc
- name: Run cargo doc (each crate)
run: |
RUSTDOCFLAGS="--cfg docsrs -D warnings" \
cargo +nightly doc --workspace --no-deps --lib --all-features --document-private-items
#!/usr/bin/env bash
set -e
CRATES=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.source == null and (.targets | map(.kind | contains(["lib"])) | any)) | .name' | tr '\n' ' ')
echo "Building docs for crates: $CRATES"
for crate in $CRATES; do
echo "Running cargo doc for: $crate"
RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc -p "$crate" --no-deps --lib --all-features --document-private-items || exit 1
done
Comment on lines +48 to +55
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we need to make sure we can build docs for https://docs.gefloresta.sh


- name: Run cargo clippy
run: ./contrib/feature_matrix.sh clippy '-- -D warnings'
Expand Down Expand Up @@ -131,9 +137,11 @@ jobs:
${{ runner.os }}-cargo-${{ env.CACHE_VERSION }}-
${{ runner.os }}-cargo-

# Build only the binaries
# Build only the binaries (florestad and floresta-cli separately to avoid feature conflicts)
- name: Build binaries
run: cargo build --release --bins --verbose
run: |
cargo build --release -p florestad --verbose
cargo build --release -p floresta-cli --verbose

# Run the feature testing script
- name: Run feature tests
Expand Down
13 changes: 12 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ COPY fuzz/ fuzz/
COPY metrics/ metrics/
COPY doc/ doc/
RUN --mount=type=cache,target=/usr/local/cargo/registry \
echo "Building florestad..." && \
if [ -n "$BUILD_FEATURES" ]; then \
cargo build --release --features "$BUILD_FEATURES"; \
cargo build --release -p florestad --features "$BUILD_FEATURES"; \
else \
cargo build --release; \
fi
cargo build --release -p florestad; \
fi && \
echo "Building floresta-cli..." && \
cargo build --release -p floresta-cli

FROM debian:13.2-slim@sha256:18764e98673c3baf1a6f8d960b5b5a1ec69092049522abac4e24a7726425b016

Expand Down
22 changes: 13 additions & 9 deletions bin/floresta-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ use bitcoin::Txid;
use clap::Parser;
use clap::Subcommand;
use floresta_rpc::jsonrpc_client::Client;
use floresta_rpc::rpc::FlorestaRPC;
use floresta_rpc::rpc_interfaces::BlockchainRpc;
use floresta_rpc::rpc_interfaces::ControlRpc;
use floresta_rpc::rpc_interfaces::NetworkRpc;
use floresta_rpc::rpc_interfaces::RawTransactionRpc;
use floresta_rpc::rpc_interfaces::WalletRpc;
use floresta_rpc::rpc_types::AddNodeCommand;
use floresta_rpc::rpc_types::RescanConfidence;

Expand Down Expand Up @@ -63,24 +67,24 @@ fn do_request(cmd: &Cli, client: Client) -> anyhow::Result<String> {
Methods::GetBestBlockHash => serde_json::to_string_pretty(&client.get_best_block_hash()?)?,
Methods::GetBlockCount => serde_json::to_string_pretty(&client.get_block_count()?)?,
Methods::GetTxOut { txid, vout } => {
serde_json::to_string_pretty(&client.get_tx_out(txid, vout)?)?
serde_json::to_string_pretty(&client.get_tx_out(txid, vout, false)?)?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this false for?

}
Methods::GetTxOutProof { txids, blockhash } => {
serde_json::to_string_pretty(&client.get_txout_proof(txids, blockhash))?
serde_json::to_string_pretty(&client.get_txout_proof(&txids, blockhash)?)?
}
Methods::GetTransaction { txid, .. } => {
serde_json::to_string_pretty(&client.get_transaction(txid, Some(true))?)?
Methods::GetTransaction { txid, verbose } => {
serde_json::to_string_pretty(&client.get_raw_transaction(txid, verbose)?)?
}
Methods::RescanBlockchain {
start_block,
stop_block,
use_timestamp,
confidence,
} => serde_json::to_string_pretty(&client.rescanblockchain(
} => serde_json::to_string_pretty(&client.rescan_blockchain(
Some(start_block),
Some(stop_block),
use_timestamp,
confidence,
Some(confidence),
)?)?,
Methods::SendRawTransaction { tx } => {
serde_json::to_string_pretty(&client.send_raw_transaction(tx)?)?
Expand Down Expand Up @@ -215,7 +219,7 @@ pub enum Methods {

/// Returns the transaction, assuming it is cached by our watch only wallet
#[command(name = "gettransaction")]
GetTransaction { txid: Txid, verbose: Option<bool> },
GetTransaction { txid: Txid, verbose: Option<u32> },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verbosity then


#[doc = include_str!("../../../doc/rpc/rescanblockchain.md")]
#[command(
Expand Down Expand Up @@ -362,7 +366,7 @@ pub enum Methods {
)]
DisconnectNode {
node_address: String,
node_id: Option<usize>,
node_id: Option<u32>,
},

#[command(name = "findtxout")]
Expand Down
6 changes: 3 additions & 3 deletions bin/florestad/docs/tutorial(EN).md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ cd Floresta/
compile with:

```bash
cargo build --release
# Build florestad and floresta-cli separately
cargo build --release -p florestad
cargo build --release -p floresta-cli
```
if everything is ok, it will compile the program and save the executable in `./target/release/`.

Expand Down Expand Up @@ -83,5 +85,3 @@ descriptors = [
### Screenshot of Program Running

![A screenshot of logs from a Floresta instance running in a terminal on a GNU/Linux distribution](./assets/Screenshot_ibd.jpg)


4 changes: 3 additions & 1 deletion bin/florestad/docs/tutorial(PT-BR).md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ cd Floresta/
compile com:

```bash
cargo build --release
# Build florestad and floresta-cli separately
cargo build --release -p florestad
cargo build --release -p floresta-cli
```

se tudo estiver ok, irá compilar o programa e salvar o executável em `./target/release/`.
Expand Down
10 changes: 7 additions & 3 deletions contrib/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,19 @@ build_floresta() {
echo "🌳 Extracting floresta $tarDest to /tmp..."
tar -xzf $tarDest -C /tmp

echo "🦀 Building florestad and floresta-cli $defaultTag..."
echo "🦀 Building florestad $defaultTag..."
cd $bdlDir
RUSTFLAGS="-C link-arg=-fuse-ld=mold -C target-cpu=native"
cargo build --release \
--bin florestad \
--bin floresta-cli \
-p florestad \
--features json-rpc \
--locked

echo "🦀 Building floresta-cli $defaultTag..."
cargo build --release \
-p floresta-cli \
--locked

echo "🌳 Copying binaries to /usr/local/bin (need sudo)..."
sudo install -m 0755 -t /usr/local/bin/ $bdlDir/target/release/florestad
sudo install -m 0755 -t /usr/local/bin/ $bdlDir/target/release/floresta-cli
Expand Down
2 changes: 1 addition & 1 deletion crates/floresta-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ authors = ["Floresta Developers <contact@getfloresta.org>"]
[dependencies]
axum = { workspace = true, optional = true }
bitcoin = { workspace = true }
corepc-types = { workspace = true }
dns-lookup = { workspace = true }
miniscript = { workspace = true, features = ["std"] }
rcgen = { workspace = true }
Expand All @@ -31,6 +30,7 @@ floresta-electrum = { workspace = true }
floresta-mempool = { workspace = true }
floresta-watch-only = { workspace = true }
floresta-wire = { workspace = true }
floresta-rpc = { workspace = true, features = ["async"] }
metrics = { workspace = true, optional = true }

[dev-dependencies]
Expand Down
Loading
Loading