DEV Community

xutweety for DB3 Network

Posted on

Create An EVM Compatible Blockchain Bridge——DB3 Network build in public weekly update (20230213-20230218)

Brief intro

We began to refactor our bill and gas system based, use the EVM chain to settle, and prepare for our network's economic model and the token release.

Besides, more CLI and db3.js features are implemented, such as:

  • release a new version
  • Feat/delete doc in CLI
  • Create wallet/database/collection using db3.js

Brief pic about the EVM chain settlement design:

db3-bridge


Key PRs:

use u64 to store the balance of bill and credit

Code:

db3>-$ new-db
 database address                           | transaction id 
--------------------------------------------+----------------------------------------------
 0xa15c58bf6ee75980b753396adb4d878129a47468 | qx7NsYyUOKondVHQjG0/itneIAujJofKsUc39Sy0Bpc= 
db3>-$ show-account
 address                                    | bills        | credits       | storage_used | mutations | session | nonce 
--------------------------------------------+--------------+---------------+--------------+-----------+---------+-------
 0x539a6192e4fcd61f53772a3284c7734bc0f6f1d6 | 0.000000 db3 | 10.000000 db3 | 102.00       | 1         | 0       | 0 
db3>-$ show-state
 name       | state 
------------+---------
 database   | 1 
 collection | 0 
 documemt   | 0 
 account    | 1 
 mutation   | 1 
 session    | 0 
 storage    | 102.00  
db3>-$ 
Enter fullscreen mode Exit fullscreen mode

Detail:

Show network status in CLI; CLI could show the status of the following concept:

DB-related concepts:

  • ​ Database
  • ​ Collection: aka 'table'
  • ​ Document: aka 'record'
  • ​ Mutation: aka 'write into / update'
  • ​ Session: aka ‘query’
  • ​ Storage: the storage size of your data

Account-related concepts:

  • ​ Address:
  • ​ Bills: bills are generated by the consumption of data mutation and storage
  • ​ Credits: The credits are set by the initial number 10

refactor the bill and gas system

refactor the bill and gas system, 1 MB data storage will cost 1DB3, you can experience it in our CLI tool.

Add EVM chain bridge


Key issues opened:

refactor the bill and gas system

We began to refactor our bill and gas system and prepare for an economic model and the token release.

Help spread the work by giving us a star🌟 on Github

Top comments (0)