Skip to content
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

light-client: Disable lightstore-sled feature by default #977

Merged
merged 3 commits into from
Sep 16, 2021
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `[tendermint-light-client]` Disable the `lightstore-sled` feature by default ([#976](https://github.com/informalsystems/tendermint-rs/issues/976))
2 changes: 1 addition & 1 deletion light-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["std", "eyre_tracer", "rpc-client", "lightstore-sled"]
default = ["std", "eyre_tracer", "rpc-client"]
eyre_tracer = ["flex-error/eyre_tracer"]
rpc-client = ["tokio", "tendermint-rpc/http-client"]
secp256k1 = ["tendermint/secp256k1", "tendermint-rpc/secp256k1"]
Expand Down
17 changes: 5 additions & 12 deletions light-client/examples/light_client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
path::{Path, PathBuf},
time::Duration,
};
use std::{path::PathBuf, time::Duration};

use gumdrop::Options;

Expand All @@ -12,7 +9,7 @@ use tendermint_light_client::supervisor::{Handle as _, Instance};
use tendermint_light_client::{
builder::{LightClientBuilder, SupervisorBuilder},
light_client,
store::sled::SledStore,
store::memory::MemoryStore,
types::{Height, PeerId, TrustThreshold},
};

Expand Down Expand Up @@ -81,10 +78,9 @@ fn main() {
fn make_instance(
peer_id: PeerId,
addr: tendermint_rpc::Url,
db_path: impl AsRef<Path>,
opts: &SyncOpts,
) -> Result<Instance, Box<dyn std::error::Error>> {
let light_store = SledStore::open(db_path)?;
let light_store = MemoryStore::new();
let rpc_client = rpc::HttpClient::new(addr).unwrap();
let options = light_client::Options {
trust_threshold: TrustThreshold::default(),
Expand All @@ -111,11 +107,8 @@ fn sync_cmd(opts: SyncOpts) -> Result<(), Box<dyn std::error::Error>> {
let primary_addr = opts.address.clone();
let witness_addr = opts.address.clone();

let primary_path = opts.db_path.join(primary.to_string());
let witness_path = opts.db_path.join(witness.to_string());

let primary_instance = make_instance(primary, primary_addr.clone(), primary_path, &opts)?;
let witness_instance = make_instance(witness, witness_addr.clone(), witness_path, &opts)?;
let primary_instance = make_instance(primary, primary_addr.clone(), &opts)?;
let witness_instance = make_instance(witness, witness_addr.clone(), &opts)?;

let supervisor = SupervisorBuilder::new()
.primary(primary, primary_addr, primary_instance)
Expand Down