a SQL database with Blockchain features.
Branch: develop
Clone or download
Latest commit 63bff3a Feb 21, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
api Fix data race on api.server instance Jan 21, 2019
bin Use 114 DNS for default, docker default DNS will make runtime crash i… Jan 22, 2019
blockproducer Add more test cases for chain API Feb 20, 2019
chainbus Add cloudflare key Dec 5, 2018
client Rename bp.WaitDatabaseCreation to client.WaitBPDatabaseCreation. Feb 13, 2019
cmd Remove useless ErrEmptyAdapterConfig Feb 21, 2019
conf Make cql config.yaml generation include adapter Feb 21, 2019
consistent Format logging messages Dec 18, 2018
crypto Add test case for functions that added in last commit. Feb 11, 2019
docker Prune useless binary tools Jan 20, 2019
kayak Rollback rpc client pool Jan 30, 2019
keys add cpu_count, loadavg metric. normarlize crucial metrics to "mem_ava… Aug 1, 2018
logo Use new arch.png Oct 9, 2018
merkle Unify msgpack encode/decode Oct 19, 2018
metric Comment ntp.go code. Because collector.go had disable ntp collect. Feb 19, 2019
pow/cpuminer Format logging messages Dec 18, 2018
proto Imporve unit test cover for supportive code Feb 15, 2019
route Improve route package unit test ratio. Feb 19, 2019
rpc Move DupConf to utils package. Feb 13, 2019
sqlchain Refactor observer to pull mode Feb 18, 2019
storage Imporve unit test cover for supportive code Feb 15, 2019
test Move DupConf to utils package. Feb 13, 2019
twopc Prune unused codes Dec 29, 2018
types Imporve types package unit test cover. Feb 18, 2019
utils Imporve unit test cover for supportive code Feb 15, 2019
vendor Merge branch 'develop' into feature/jsonrpc Jan 22, 2019
worker Add comments for count in ObserverFetchBlock rpc Feb 18, 2019
xenomint Improve xenomint package unit test ratio. Feb 19, 2019
.dockerignore Reduce build stage docker image size Nov 15, 2018
.gitignore Remove conf* from gitignore Dec 27, 2018
.gitlab-ci.yml Remove '-x' for test_my_project in gitlabci. Jan 28, 2019
.gitmodules use readonly GNTE submodule Aug 2, 2018
.travis.yml Add make clean before make in auto scripts. Dec 29, 2018
CHANGELOG.md Add v0.3.0 changelog Jan 31, 2019
Gopkg.lock Merge branch 'develop' into feature/jsonrpc Jan 22, 2019
Gopkg.toml Add vendor/github.com/zserge/metric@master Jan 22, 2019
LICENSE update license to Apache2.0 May 5, 2018
Makefile Fix missing 'linux' building tags. Jan 28, 2019
README-zh.md Update README-zh.md Jan 30, 2019
README.md Update README.md Jan 30, 2019
alltest.sh Cover special packages for api module Jan 29, 2019
analysisVendor.sh add analysisVendor.sh to generate dep tree png May 2, 2018
cleanupDB.sh Support lastInsertID and affectedRows features Nov 2, 2018
codecov.yml Combine two dupConf func into test.DupConf Feb 12, 2019
docker-compose.yml Rename folder apinode_0 to fullnode_0 Jan 28, 2019
fmtGoDoc.sed Format comment Aug 29, 2018
genMarshalHash.sh Keep HashStablePack latest before generate code Jan 21, 2019


Go Report Card Coverage Build Status License GoDoc follow on Twitter Join the chat at https://gitter.im/CovenantSQL/CovenantSQL


CovenantSQL is a decentralized, crowdsourcing SQL database on blockchain with features:

  • SQL: most SQL-92 support.
  • Decentralize: decentralize with our consensus algorithm DH-RPC & Kayak.
  • Privacy: access with granted permission and Encryption Pass.
  • Immutable: query history in CovenantSQL is immutable and trackable.

We believe On the next Internet, everyone should have a complete Data Rights

One Line Makes Data on Blockchain

sql.Open("CovenantSQL", dbURI)

CovenantSQL 3 Layer design

  • Layer 1: Global Consensus Layer (the main chain, the middle ring in the architecture diagram):
    • There will only be one main chain throughout the network.
    • Mainly responsible for database Miner and the user’s contract matching, transaction settlement, anti-cheating, shard chain lock hash and other global consensus matters.
  • Layer 2: SQL Consensus Layer (shard chain, rings on both sides):
    • Each database will have its own separate shard chain.
    • Mainly responsible for: the signature, delivery and consistency of the various Transactions of the database. The data history of the permanent traceability is mainly implemented here, and the hash lock is performed in the main chain.
  • Layer 3: Datastore Layer (database engine with SQL-92 support):
    • Each Database has its own independent distributed engine.
    • Mainly responsible for: database storage & encryption, query processing & signature, efficient indexing.


Our team members published:

that inspired us:


Network Stack

DH-RPC := TLS - Cert + DHT

Layer Implementation
RPC net/rpc
Naming Consistent Secure DHT
Pooling Session Pool
Multiplex smux
Transport Security Enhanced TLS
Network TCP or KCP for optional later

Test Tools


CovenantSQL is still under construction and Testnet is already released, have a try.

Watch us or follow on Twitter for updates.