crystalstore
crystalstore
A library that creates a virtual file system over BCDB It can be used directly or through a fuse interface
Installation
-
Add the dependency to your
shard.yml:dependencies: crystalstore: github: crystaluniverse/crystalstore -
Run
shards install
Usage
Download, compile & run 0-db (Backend for BCDB)
git clone git@github.com:threefoldtech/0-db.gitcd 0-db && make./zdb --mode seq
Download, compile & run BCDB (Backend for BCDB)
- Install Rust programming language
git clone git@github.com:threefoldtech/bcdb.gitcd bcdb && make- copy bcdb binary anywhere
cp bcdb/target/x86_64-unknown-linux-musl/release/bcdb . - download
tfuserutility from here - use
tfuserto register your 3bot user to explorer and generate seed fileusr.seedusing./tfuser id create --name {3bot_username.3bot} --email {email} - run bcdb :
./bcdb --seed-file user.seed - now you can talk to
bcdbthrough http via unix socket/tmp/bcdb.sock
Use the library in your application
-
Initialize use default settings or provide your own.
-
store = CrystalStore::Store.new -
store = CrystalStore::Store.new block_size: 1024_u64, max_no_blocks: 20000000_u64, max_no_files: 20000000_u64, max_filename: 1000_u64, mount_flags: 0_u64, db_name: "db", db_namespace: ns, db_unixsocket: "/tmp/bcdb.sock" -
note that initializing store with certain block size makes it permanent you can not re-initialize with different size , however if you re-initialize store instance with same settings used before no problem about that so you could do something like
store = CrystalStore::Store.new
store = CrystalStore::Store.new
- Complete list of API are in the file crystalstore.cr
- Examples in the file crystalstore_spec.cr
crystalstore
- 0
- 1
- 0
- 0
- 1
- over 5 years ago
- July 8, 2020
MIT License
Tue, 16 Dec 2025 21:20:12 GMT