Git Product home page Git Product logo

db3's Introduction

GitHub Workflow Status (with event) coverage GitHub commit activity contribution GitHub issues GitHub issues by-label GitHub release (latest by date)Twitter Follow GitPOAP Badge Discord Java SDK npm

DB3 Network

DB3 Network is a Lightweight, Permanent JSON document database for Web3. It is designed to store and retrieve data for decentralized applications built on blockchain technology. DB3 Network has two core features:

  1. Using DB3 Network as a JSON document database.
  2. Periodically rolling up the JSON document to the Arweave at a very low cost.

Have a try

Set up self-hosted Node

1. Start docker container

sudo docker run -p 26639:26639 -p 26619:26619 -p 26629:26629 \
                -e ADMIN_ADDR=0xF78c...29679 \ # use your own wallet address
                -it ghcr.io/dbpunk-labs/db3:latest 

you should see the following output

start store node...
start index node...
the ar account address e_i_JLA8toEr5HaHCpkZJUIXp3kypCAd5NNAvfWNOgE
start ar testnet ...
10000000000000Start the local db3 nodes successfully
The storage node url: http://127.0.0.1:26619
The index node url: http://127.0.0.1:26639
The console node url: http://127.0.0.1:26629/console
The setup url: http://127.0.0.1:26629/welcome

2. Setup the node

  • open the http://127.0.0.1:26629/welcome to setup your node
  • open the http://127.0.0.1:26629/console/database to create database or collection
  • open the http://127.0.0.1:26629/console/node/dashboard to vist the dashboard

3. Playground

open the http://127.0.0.1:26629/console/database to create database or collection, then use the playgound http://127.0.0.1:26629/console/database/playground with the following code

// create a account
const account = createRandomAccount()
// create the client
const client = createClient('http://127.0.0.1:26619',
                            'http://127.0.0.1:26639', 
                             account)

// get the collection
// please replace the database address and collection name with yours
const collection = await getCollection("0xF7..79", "book", client)

// add a document
const {id} = await addDoc(collection, {
                name:"The Three-Body Problem"
                author:"Cixin-Liu",
                rate:"4.8"} as Book)
// query the document
const resultSet = await queryDoc<Book>(collection, "/[author=Cixin-Liu]")

if you have any questions, please feel free to ask us for help and you can find more detail about the example

Try Our Cloud Sandbox

You can connect to the Data Rollup Node and Data Index Node with db3.js

Note: the cloud sandbox is just for testing and unstable

How it works

The DB3 Network has two roles:

  1. The Data Rollup Node accepts write operations, compresses the data, rolls it up to Arweave, and stores the metadata in the smart contract.
  2. The Data Index Node synchronizes data from the Data Rollup Node in real-time or recovers the index with metadata in the smart contract and files in Arweave. It serves the index as a queryable API.

To prevent tampering, every JSON document must be signed by its owner. Only the owner can update or delete the JSON document.

The Plan to support public chain list

Public Chains Testnet Mainnet
Arweave ✔️ ✔️
Polygon ✔️ Mumbai 🔜
Zksync 🔜 🔜
Scroll 🔜 🔜
Arbitrum 🔜 🔜
Optimism 🔜 🔜

If you want us to support the other public chains, just give us an issue

What can we build with the db3 network?

Now building a fully on-chain application is an easy thing. You can create a fully on-chain game or a fully on-chain social network, or any other application you desire.

FAQ

Q: Is the DB3 Network a blockchain? A: No, the DB3 Network is not a blockchain. It is simply a developer tool that can be hosted locally or used through our cloud service.

Q: What are the differences between MongoDB and DB3 Network? A: MongoDB uses centralized data storage, whereas DB3 Network uses decentralized data storage. Additionally, DB3 Network ensures that data is permanently available.

Q: Will my data be lost if the Data Rollup Node or Data Index Node is not available? A: No, you can set up your data index node and recover your data from the blockchain.

License

Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. See CONTRIBUTING.md.

db3's People

Contributors

db3fans avatar dependabot[bot] avatar imbjdd avatar imotai avatar jingchen2222 avatar muraneth avatar omahs avatar pgrimaud avatar rock-lee-520 avatar widat avatar xiyangjun avatar xuman2019 avatar

Watchers

 avatar

db3's Issues

添加一个grpc接口支持查询文档的拥有者的地址

接口名称

grpc 接口名称GetDocOwnerAddress

接口的输入参数

文档id

返回参数

地址

处理逻辑

需要在存储节点上面查询出文档的拥有者地址信息,再通过grpc返回

实现代码上准守以下规则

  1. 接口需要放到db3_storage.proto里面,接口实现在storage_node_light_impl.rs中实现
  2. 你必需从db_store_v2.rs中的create_doc_ownership方法中理解文档与owner地址的对应关系,然后实现你需要的方法

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.