pub fn open(ledger_path: &str) -> Result<Blocktree> {
        use std::path::Path;

        fs::create_dir_all(&ledger_path)?;
        let ledger_path = Path::new(&ledger_path).join(BLOCKTREE_DIRECTORY);

        // Open the database
        let db = Database::open(&ledger_path)?;

        let batch_processor = unsafe { Arc::new(RwLock::new(db.batch_processor())) };

        // Create the metadata column family
        let meta_cf = db.column();

        // Create the data column family
        let data_cf = db.column();

        // Create the erasure column family
        let erasure_cf = db.column();

        let erasure_meta_cf = db.column();

        // Create the orphans column family. An "orphan" is defined as
        // the head of a detached chain of slots, i.e. a slot with no
        // known parent
        let orphans_cf = db.column();

        // setup erasure
        let session = Arc::new(expunge::Session::default());

        let db = Arc::new(db);

        Ok(Blocktree {
            db,
            meta_cf,
            data_cf,
            erasure_cf,
            erasure_meta_cf,
            orphans_cf,
            session,
            new_blobs_signals: vec![],
            batch_processor,
            completed_slots_senders: vec![],
        })
    }
/// Opens a Ledger in directory, provides "infinite" window of blobs
Opens a Ledger in directory, provides "infinite" window of blobs
Opens a Ledger in directory provides " infinite " window of blobs
pub fn open(ledger_path: &str) -> Result<Blocktree> {
        use std::path::Path;
        fs::create_dir_all(&ledger_path)?;
        let ledger_path = Path::new(&ledger_path).join(BLOCKTREE_DIRECTORY);
        // Open the database
        let db = Database::open(&ledger_path)?;
        let batch_processor = unsafe { Arc::new(RwLock::new(db.batch_processor())) };
        // Create the metadata column family
        let meta_cf = db.column();
        // Create the data column family
        let data_cf = db.column();
        // Create the erasure column family
        let erasure_cf = db.column();
        let erasure_meta_cf = db.column();
        // Create the orphans column family. An "orphan" is defined as
        // the head of a detached chain of slots, i.e. a slot with no
        // known parent
        let orphans_cf = db.column();
        // setup erasure
        let session = Arc::new(expunge::Session::default());
        let db = Arc::new(db);
        Ok(Blocktree {
            db,
            meta_cf,
            data_cf,
            erasure_cf,
            erasure_meta_cf,
            orphans_cf,
            session,
            new_blobs_signals: vec![],
            batch_processor,
            completed_slots_senders: vec![],
        })
    }
pub fn open ( ledger_path : & str ) -> Result < Blocktree > { use std :: path :: Path ; fs :: create_dir_all ( & ledger_path ) ? ; let ledger_path = Path :: new ( & ledger_path ) . join ( BLOCKTREE_DIRECTORY ) ; // Open the database let db = Database :: open ( & ledger_path ) ? ; let batch_processor = unsafe { Arc :: new ( RwLock :: new ( db . batch_processor ( ) ) ) } ; // Create the metadata column family let meta_cf = db . column ( ) ; // Create the data column family let data_cf = db . column ( ) ; // Create the erasure column family let erasure_cf = db . column ( ) ; let erasure_meta_cf = db . column ( ) ; // Create the orphans column family. An "orphan" is defined as // the head of a detached chain of slots, i.e. a slot with no // known parent let orphans_cf = db . column ( ) ; // setup erasure let session = Arc :: new ( expunge :: Session :: default ( ) ) ; let db = Arc :: new ( db ) ; Ok ( Blocktree { db , meta_cf , data_cf , erasure_cf , erasure_meta_cf , orphans_cf , session , new_blobs_signals : vec ! [ ] , batch_processor , completed_slots_senders : vec ! [ ] , } ) }
Opens a Ledger in directory, provides "infinite" window of blobs
Opens a Ledger in directory provides " infinite " window of blobs
ledger_path
&str
ledger_path
&str