Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

threefoldtecharchive/bcdb

Repository files navigation

BCDB

BCDB pre-requirements

BCDB uses zdb that is always running on local host ZDB must be running in sequential mode. Please check out 0-db for more information on how to install zdb.

zdb --mode seq

Starting up BCDB

  • Build bcdb
make
  • check available options
# bcdb --help
bcdb

USAGE:
    bcdb [FLAGS] [OPTIONS] --threebot-id <id> --seed <seed> --seed-file <seed-file> [SUBCOMMAND]

FLAGS:
    -d, --debug      enable debug logging
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --explorer <explorer>        explorer URL for phonebook entries validations [default:
                                     https://explorer.devnet.grid.tf/explorer/]
    -g, --grpc <grpc>                listen on address for grpc api [default: 0.0.0.0:50051]
    -i, --threebot-id <id>           threebot ID for this bcdb instance
    -m, --meta <meta>                directory where metadata is stored [default: /home/azmy/.bcdb-meta]
        --peers-file <peers-file>    path to file with peers list, otherwise use explorer [env: PEERS_FILE=]
    -r, --rest <rest>                listen unix socket for rest api [default: /tmp/bcdb.sock]
    -s, --seed <seed>                mnemonic of the seed to be used for the identity [env: SEED=]
        --seed-file <seed-file>      path to the file containing the mnemonic [env: seed-file=]
    -z, --zdb <zdb>                  local zdb port [default: 9900]

SUBCOMMANDS:
    help       Prints this message or the help of the given subcommand(s)
    rebuild    rebuild index from zdb
  • Index rebuild
# bcdb rebuild --help
bcdb-rebuild
rebuild index from zdb

USAGE:
    bcdb --threebot-id <id> --seed <seed> --seed-file <seed-file> rebuild [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --from <from>    only rebuild index with records after given timestamp

Please make sure that --seed-file is pointing to a seed file generated by the tfuser utility.

Instead, you can provide both --threebot-id and --seed which must be valid identity registered on the provided explorer

playing with bcdb

BCDB exposes a grpc service(s). We already have some clients generated (with some examples) please check clients directory. In case there is no client generated in your preferred language, use the proto/bcdb.proto to generate one.

Example

Please check examples for some example clients that uses bcdb for specific operations.

Checklist

  • Set new object
  • Get object with ID
  • List objects that matches set of tags
  • Find objects that matches set of tags
    • find is similar to list, except list only returns object IDs, while find also return object full meta
  • Update object meta with ID
  • Authentication
  • ACL
    • Assign ACL to object on Set
    • Configure ACL (grant, revoke, and update permissions)
    • Check user access request against associated ACL
  • Peer 2 Peer
    • Routing calls to peers
    • Peers list
      • Peers files
      • Explorer
    • Peer verification
    • Peer connection pooling
  • GRPC Api
  • Rest Api
    • Only over unix socket, and does not require authentication
  • Index rebuild from zdb. In case u lost the local sqlite db

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5