mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-22 19:49:33 +00:00
fix imports
This commit is contained in:
parent
0b6bd2c3c0
commit
94f6b67724
6 changed files with 31 additions and 18 deletions
|
@ -3,7 +3,9 @@ use std::{fmt::Write, fs::write};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use tower::{Service, ServiceExt};
|
use tower::{Service, ServiceExt};
|
||||||
|
|
||||||
use cuprate_blockchain::{config::ConfigBuilder, service::DatabaseReadHandle, RuntimeError};
|
use cuprate_blockchain::{
|
||||||
|
config::ConfigBuilder, cuprate_database::RuntimeError, service::DatabaseReadHandle,
|
||||||
|
};
|
||||||
use cuprate_types::blockchain::{BCReadRequest, BCResponse};
|
use cuprate_types::blockchain::{BCReadRequest, BCResponse};
|
||||||
|
|
||||||
use cuprate_fast_sync::{hash_of_hashes, BlockId, HashOfHashes};
|
use cuprate_fast_sync::{hash_of_hashes, BlockId, HashOfHashes};
|
||||||
|
|
|
@ -19,6 +19,14 @@ or at the very least the [`ops`] module instead of interacting with the `cuprate
|
||||||
# `cuprate_database`
|
# `cuprate_database`
|
||||||
Consider reading `cuprate_database`'s crate documentation before this crate, as it is the first layer.
|
Consider reading `cuprate_database`'s crate documentation before this crate, as it is the first layer.
|
||||||
|
|
||||||
|
If/when this crate needs is used, be sure to use the version that this crate re-exports, e.g.:
|
||||||
|
```rust
|
||||||
|
use cuprate_blockchain::{
|
||||||
|
cuprate_database::RuntimeError,
|
||||||
|
};
|
||||||
|
```
|
||||||
|
This ensures the types/traits used from `cuprate_database` are the same ones used by `cuprate_blockchain` internally.
|
||||||
|
|
||||||
# Feature flags
|
# Feature flags
|
||||||
The `service` module requires the `service` feature to be enabled.
|
The `service` module requires the `service` feature to be enabled.
|
||||||
See the module for more documentation.
|
See the module for more documentation.
|
||||||
|
@ -52,13 +60,12 @@ For examples of the higher-level APIs, see:
|
||||||
- [`service`]
|
- [`service`]
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use cuprate_database::{
|
use cuprate_blockchain::{
|
||||||
|
cuprate_database::{
|
||||||
ConcreteEnv,
|
ConcreteEnv,
|
||||||
Env, EnvInner,
|
Env, EnvInner,
|
||||||
DatabaseRo, DatabaseRw, TxRo, TxRw,
|
DatabaseRo, DatabaseRw, TxRo, TxRw,
|
||||||
};
|
},
|
||||||
|
|
||||||
use cuprate_blockchain::{
|
|
||||||
config::ConfigBuilder,
|
config::ConfigBuilder,
|
||||||
tables::{Tables, TablesMut},
|
tables::{Tables, TablesMut},
|
||||||
OpenTables,
|
OpenTables,
|
||||||
|
|
|
@ -14,9 +14,10 @@
|
||||||
//!
|
//!
|
||||||
//! # Example
|
//! # Example
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use cuprate_database::{Env, config::SyncMode};
|
//! use cuprate_blockchain::{
|
||||||
//!
|
//! cuprate_database::{Env, config::SyncMode},
|
||||||
//! use cuprate_blockchain::config::{ConfigBuilder, ReaderThreads};
|
//! config::{ConfigBuilder, ReaderThreads},
|
||||||
|
//! };
|
||||||
//!
|
//!
|
||||||
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
//! let tmp_dir = tempfile::tempdir()?;
|
//! let tmp_dir = tempfile::tempdir()?;
|
||||||
|
|
|
@ -121,6 +121,8 @@ pub mod ops;
|
||||||
pub mod tables;
|
pub mod tables;
|
||||||
pub mod types;
|
pub mod types;
|
||||||
|
|
||||||
|
pub use cuprate_database;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------- Feature-gated
|
//---------------------------------------------------------------------------------------------------- Feature-gated
|
||||||
#[cfg(feature = "service")]
|
#[cfg(feature = "service")]
|
||||||
pub mod service;
|
pub mod service;
|
||||||
|
|
|
@ -55,13 +55,12 @@
|
||||||
//! use hex_literal::hex;
|
//! use hex_literal::hex;
|
||||||
//!
|
//!
|
||||||
//! use cuprate_test_utils::data::block_v16_tx0;
|
//! use cuprate_test_utils::data::block_v16_tx0;
|
||||||
//! use cuprate_database::{
|
//! use cuprate_blockchain::{
|
||||||
|
//! cuprate_database::{
|
||||||
//! ConcreteEnv,
|
//! ConcreteEnv,
|
||||||
//! Env, EnvInner,
|
//! Env, EnvInner,
|
||||||
//! DatabaseRo, DatabaseRw, TxRo, TxRw,
|
//! DatabaseRo, DatabaseRw, TxRo, TxRw,
|
||||||
//! };
|
//! },
|
||||||
//!
|
|
||||||
//! use cuprate_blockchain::{
|
|
||||||
//! OpenTables,
|
//! OpenTables,
|
||||||
//! config::ConfigBuilder,
|
//! config::ConfigBuilder,
|
||||||
//! tables::{Tables, TablesMut},
|
//! tables::{Tables, TablesMut},
|
||||||
|
|
|
@ -65,9 +65,11 @@
|
||||||
//!
|
//!
|
||||||
//! use cuprate_types::blockchain::{BCReadRequest, BCWriteRequest, BCResponse};
|
//! use cuprate_types::blockchain::{BCReadRequest, BCWriteRequest, BCResponse};
|
||||||
//! use cuprate_test_utils::data::block_v16_tx0;
|
//! use cuprate_test_utils::data::block_v16_tx0;
|
||||||
//! use cuprate_database::Env;
|
|
||||||
//!
|
//!
|
||||||
//! use cuprate_blockchain::config::ConfigBuilder;
|
//! use cuprate_blockchain::{
|
||||||
|
//! cuprate_database::Env,
|
||||||
|
//! config::ConfigBuilder,
|
||||||
|
//! };
|
||||||
//!
|
//!
|
||||||
//! # #[tokio::main]
|
//! # #[tokio::main]
|
||||||
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
Loading…
Reference in a new issue