Skip to content

AndresSepar/db3.js

 
 

Repository files navigation

What is db3.js

npm npm

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

How to use 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")

Show Your Support

Please ⭐️ this repository if this project helped you!

Build

0. Checkout

git clone https://github.com/dbpunk-labs/db3.js.git
git submodule update --recursive

1. Run DB3 Localnet

cd tools && bash start_localnet.sh

2. Run Testcase

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

3. Run WPT Case

please setup the wpt environment with these steps

yarn build:wpt
cd thirdparty/wpt && ./wpt serve

About

DB3 Network Javascript API

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.3%
  • Shell 2.1%
  • Makefile 0.6%