id stringlengths 18 18 | chunk_id stringlengths 16 16 | repo stringclasses 6
values | repo_url stringclasses 6
values | commit stringclasses 6
values | license stringclasses 4
values | path stringlengths 10 68 | kind stringclasses 1
value | name stringlengths 5 44 | context stringlengths 10 68 | start_line int32 1 1 | end_line int32 3 1.42k | num_lines int32 3 1.42k | question stringlengths 133 1.46k | answer stringlengths 44 54.5k | model stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3f0c0ab0374ef09-0 | d3f0c0ab0374ef09 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-liquidity/src/utils/mod.rs | file | mod.rs | lightning-liquidity/src/utils/mod.rs | 1 | 60 | 60 | I need a Rust module for LSPS5 service utilities that includes a function `scid_from_human_readable_string` which parses a human-readable short channel ID string formatted as 'block tx vout' (three parts separated by 'x') and converts it into a u64 packed as (block << 40) | (tx << 16) | vout. The function should accept... | //! Utilities for LSPS5 service.
use alloc::string::String;
use core::fmt::Write;
use lightning::sign::EntropySource;
use crate::lsps0::ser::LSPSRequestId;
#[allow(dead_code)]
#[allow(unused_imports)]
pub(crate) mod async_poll;
pub mod time;
/// Converts a human-readable string representation of a short channel ID... | nvidia/nemotron-3.5-lightning-30b-a3b |
d1b5b290a6f00966-0 | d1b5b290a6f00966 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-persister/src/utils.rs | file | utils.rs | lightning-persister/src/utils.rs | 1 | 84 | 84 | I need a Rust function `check_namespace_key_validity` that takes `primary_namespace: &str`, `secondary_namespace: &str`, `key: Option<&str>`, and `operation: &str`, and validates them for use in a key-value store persistence layer. If `key` is `Some`, it must be non-empty, consist only of characters from `KVSTORE_NAMES... | use lightning::types::string::PrintableString;
use lightning::util::persist::{KVSTORE_NAMESPACE_KEY_ALPHABET, KVSTORE_NAMESPACE_KEY_MAX_LEN};
pub(crate) fn is_valid_kvstore_str(key: &str) -> bool {
key.len() <= KVSTORE_NAMESPACE_KEY_MAX_LEN
&& key.chars().all(|c| KVSTORE_NAMESPACE_KEY_ALPHABET.contains(c))
}
pub(c... | nvidia/nemotron-3.5-lightning-30b-a3b |
80e0e2df853b2ad7-0 | 80e0e2df853b2ad7 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-transaction-sync/src/electrum.rs | file | electrum.rs | lightning-transaction-sync/src/electrum.rs | 1 | 578 | 578 | I need a Rust implementation of an Electrum sync client for LDK that implements the `Filter` interface to register transactions and outputs for on-chain monitoring. The client should connect to an Electrum server, periodically sync confirmed and unconfirmed transactions, handle block tip updates and reorgs, validate me... | // This file is Copyright its original authors, visible in version control history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. You may not u... | nvidia/nemotron-3.5-lightning-30b-a3b |
18760f4553ed6c74-0 | 18760f4553ed6c74 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-transaction-sync/src/esplora.rs | file | esplora.rs | lightning-transaction-sync/src/esplora.rs | 1 | 596 | 596 | I'm building a Lightning node component with rust-lightning and need a struct that syncs on-chain transaction data from an Esplora-compatible server (like electrs). It must implement LDK's `Filter` to register transactions and outputs, and expose a `sync` method that repeatedly fetches confirmed and unconfirmed transac... | // This file is Copyright its original authors, visible in version control history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. You may not u... | nvidia/nemotron-3.5-lightning-30b-a3b |
5d13500628dc9bbd-0 | 5d13500628dc9bbd | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-types/src/payment.rs | file | payment.rs | lightning-types/src/payment.rs | 1 | 101 | 101 | I need a Rust module that defines Lightning payment types `PaymentHash`, `PaymentPreimage`, and `PaymentSecret`, each wrapping `[u8; 32]` and implementing `Borrow<[u8]>`, `Hash`, and `fmt_traits` (with `LENGTH: 32`). Additionally, I need a `From<PaymentPreimage> for PaymentHash` conversion that hashes the preimage with... | // This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may... | nvidia/nemotron-3.5-lightning-30b-a3b |
f508bb1a0f1a0146-0 | f508bb1a0f1a0146 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-transaction-sync/src/lib.rs | file | lib.rs | lightning-transaction-sync/src/lib.rs | 1 | 90 | 90 | I need a Rust library crate root `lib.rs` for a crate that provides utilities for syncing LDK via the transaction-based `Confirm` interface. The crate must support optional features `esplora-blocking`, `esplora-async`, and `_electrum` for Esplora and Electrum backends. When enabled, conditional modules `esplora`, `elec... | // This file is Copyright its original authors, visible in version control history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. You may not u... | nvidia/nemotron-3.5-lightning-30b-a3b |
50a7e0220e06cc7b-0 | 50a7e0220e06cc7b | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | possiblyrandom/src/lib.rs | file | lib.rs | possiblyrandom/src/lib.rs | 1 | 32 | 32 | I need a Rust `no_std` crate that provides a function `getpossiblyrandom` to fill a `&mut [u8]` buffer with possibly random data. If the `getrandom` feature is enabled and the target platform supports it, the function should use `getrandom::getrandom`; otherwise, it should fill the buffer with zeros. The function shoul... | // This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may... | nvidia/nemotron-3.5-lightning-30b-a3b |
8969b927a7d4fac4-0 | 8969b927a7d4fac4 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-transaction-sync/src/error.rs | file | error.rs | lightning-transaction-sync/src/error.rs | 1 | 80 | 80 | I need a Rust module for transaction sync error handling. Define a public `TxSyncError` enum with a `Failed` variant. Define a private `InternalError` enum with `Failed` and `Inconsistency` variants. Both must implement `std::fmt::Display` and `std::error::Error`. Add `From<InternalError> for TxSyncError` mapping to `F... | // This file is Copyright its original authors, visible in version control history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. You may not u... | nvidia/nemotron-3.5-lightning-30b-a3b |
8dec716374ff8cf6-0 | 8dec716374ff8cf6 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-types/src/routing.rs | file | routing.rs | lightning-types/src/routing.rs | 1 | 50 | 50 | I need Rust types for Lightning Network routing hints and fees. I'm defining a `RoutingFees` struct with a `base_msat: u32` flat fee in millisatoshis and a `proportional_millionths: u32` liquidity-based fee. I also need a `RouteHint` newtype wrapping `alloc::vec::Vec<RouteHintHop>`, and a `RouteHintHop` struct with `sr... | // This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may... | nvidia/nemotron-3.5-lightning-30b-a3b |
f1fa6150f8600dc5-0 | f1fa6150f8600dc5 | lightningdevkit/rust-lightning | https://github.com/lightningdevkit/rust-lightning | 48e8d4745e5fd54398e24bcce2921c2b075f99c5 | Apache-2.0 OR MIT | lightning-net-tokio/src/lib.rs | file | lib.rs | lightning-net-tokio/src/lib.rs | 1 | 1,422 | 1,422 | I need a Rust library for Tokio-based socket integration with rust-lightning's PeerManager. It must define a `SocketDescriptor` struct implementing `lightning::ln::peer_handler::SocketDescriptor` to wrap a `Connection` that holds a `TcpStream`, read/write wakers via `mpsc` channels, and a pause flag. Expose `setup_inbo... | // This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may... | nvidia/nemotron-3.5-lightning-30b-a3b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.