-
Notifications
You must be signed in to change notification settings - Fork 13
chore: deprecate core module #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| //! Usual sync on Testnet. | ||
|
|
||
| use kyoto::{chain::checkpoints::HeaderCheckpoint, core::builder::NodeBuilder}; | ||
| use kyoto::{builder::NodeBuilder, chain::checkpoints::HeaderCheckpoint}; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not shown in the diff, but
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah missed that ok, I am gonna try and add that feature flag matrix to CI in a separate PR too. |
||
| use kyoto::{Address, Client, Event, Log, Network, PeerStoreSizeConfig, TrustedPeer}; | ||
| use std::collections::HashSet; | ||
| use std::{net::Ipv4Addr, str::FromStr}; | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,10 +71,6 @@ | |
| //! } | ||
| //! ``` | ||
| //! | ||
| //! # Getting started | ||
| //! | ||
| //! The [`core`] module documentation is likely the best place to start when developing an application with Kyoto. | ||
| //! | ||
| //! # Features | ||
| //! | ||
| //! `database`: use the default `rusqlite` database implementations. Default and recommend feature. | ||
|
|
@@ -85,12 +81,34 @@ | |
|
|
||
| #![warn(missing_docs)] | ||
| pub mod chain; | ||
| pub mod core; | ||
| pub mod db; | ||
|
|
||
| mod filters; | ||
| mod network; | ||
| mod prelude; | ||
|
|
||
| mod broadcaster; | ||
| /// Convenient way to build a compact filters node. | ||
| pub mod builder; | ||
| pub(crate) mod channel_messages; | ||
| /// Structures to communicate with a node. | ||
| pub mod client; | ||
| /// Node configuration options. | ||
| pub(crate) mod config; | ||
| pub(crate) mod dialog; | ||
| /// Errors associated with a node. | ||
| pub mod error; | ||
| /// Messages the node may send a client. | ||
| pub mod messages; | ||
| /// The structure that communicates with the Bitcoin P2P network and collects data. | ||
| pub mod node; | ||
|
|
||
| /// Receive an [`IndexedBlock`] from a request. | ||
| #[cfg(feature = "filter-control")] | ||
| pub type BlockReceiver = tokio::sync::oneshot::Receiver<Result<IndexedBlock, FetchBlockError>>; | ||
|
|
||
| #[cfg(feature = "filter-control")] | ||
| use crate::error::FetchBlockError; | ||
| #[cfg(feature = "filter-control")] | ||
| use filters::Filter; | ||
| #[cfg(feature = "filter-control")] | ||
|
|
@@ -123,11 +141,12 @@ pub use tokio::sync::mpsc::UnboundedReceiver; | |
|
|
||
| #[doc(inline)] | ||
| pub use { | ||
| crate::core::builder::NodeBuilder, | ||
| crate::core::client::{Client, Requester}, | ||
| crate::core::error::{ClientError, NodeError}, | ||
| crate::core::messages::{Event, Log, Progress, RejectPayload, SyncUpdate, Warning}, | ||
| crate::core::node::{Node, NodeState}, | ||
| crate::builder::NodeBuilder, | ||
| crate::client::{Client, Requester}, | ||
| crate::error::{ClientError, NodeError}, | ||
| crate::messages::{Event, Log, Progress, RejectPayload, SyncUpdate, Warning}, | ||
| crate::network::PeerTimeoutConfig, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was previously used internally and did not hit the public API, but I think another method on the builder to allow users to use the |
||
| crate::node::{Node, NodeState}, | ||
| }; | ||
|
|
||
| #[doc(inline)] | ||
|
|
@@ -439,6 +458,16 @@ pub enum LogLevel { | |
| Warning, | ||
| } | ||
|
|
||
| /// Should the node immediately download filters or wait for a command | ||
| #[derive(Debug, Default)] | ||
| pub enum FilterSyncPolicy { | ||
| /// The node will wait for an explicit command to start downloading and checking filters | ||
| Halt, | ||
| /// Filters are downloaded immediately after CBF headers are synced. | ||
| #[default] | ||
| Continue, | ||
| } | ||
|
|
||
| macro_rules! log { | ||
| ($dialog:expr, $expr:expr) => { | ||
| match $dialog.log_level { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is jumping from H1 to H3 a style choice?