db3.js is the db3 network javascript API and you can use it to write and query JSON documents against the db3 network. and you can build fully decentralized applications combining web3.js and db3.js
The goal of db3.js is compatible with the indexeddb api and you can use db3.js like using indexeddb, even you can use all libraries based on indexeddb e.g. rxdb
/*
|----------------------------|
| use db3js open a database |
|----------------------------|
*/
// build sign function
const sign = await getSign()
// build database factory
const dbFactory = new DB3Factory({
node: 'http://127.0.0.1:26659',
sign,
nonce
})
// open database with an address
const db = dbFactory.open("0x5ca8d43c15fb366d80e221d11a34894eb0975da6")
Please ⭐️ this repository if this project helped you!
git clone https://github.com/dbpunk-labs/db3.js.git
git submodule update --recursive
cd tools && bash start_localnet.sh
git submodule update
# install the dependency
yarn
# generate the protobuf
make
# run test
yarn test
# format the code
yarn prettier --write src
# run benchmark
yarn benny-sdk
please setup the wpt environment with these steps
yarn build:wpt
cd thirdparty/wpt && ./wpt serve