CovenantSQL Testnet Quickstart
CovenantSQL is a decentralized, crowdsourcing SQL database on blockchain with features:
- SQL: most SQL-92 support.
- Decentralized: 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 in the next Internet generation, everyone should have complete data rights
Here is how to start with CovenantSQL.
0. Download CovenantSQL Tools
Download latest release on Github.
1. Generate config file with cql-utils
to connect TestNet
$ cql-utils -tool confgen
Generating key pair...
Enter master key(press Enter for default: ""):
⏎
Private key file: conf/private.key
Public key's hex: 02296ea73240dcd69d2b3f1fb754c8debdf68c62147488abb10165428667ec8cbd
Generated key pair.
Generating nonce...
nonce: {{731613648 0 0 0} 11 001ea9c8381c4e8bb875372df9e02cd74326cbec33ef6f5d4c6829fcbf5012e9}
node id: 001ea9c8381c4e8bb875372df9e02cd74326cbec33ef6f5d4c6829fcbf5012e9
Generated nonce.
Generating config file...
Generated nonce.
After running cql-utils
, it will generate a configured file in ./conf
.
2. Generate wallet address from private key
The private key can be found in ./conf
.
$ cql-utils -tool addrgen -private ./conf/private.key
Enter master key(default: ""):
⏎
wallet address: 4jXvNvPHKNPU8Sncz5u5F5WSGcgXmzC1g8RuAXTCJzLsbF9Dsf9
3. Get your PTC on Faucet
The faucet address: CovenantSQL Testnet Faucet.
Use cql
to check your wallet balance:
$ cql -config conf/config.yaml -get-balance
INFO[0000] stable coin balance is: 100 caller="main.go:246 main.main"
INFO[0000] covenant coin balance is: 0 caller="main.go:247 main.main"
Here, I got “stable coin balance is: 100”.
4. Create a database using CLI
$ cql -config conf/config.yaml -create 1
INFO[0000] the newly created database is: covenantsql://0e9103318821b027f35b96c4fd5562683543276b72c488966d616bfe0fe4d213 caller="main.go:297 main.main"
Here, 1
refers that one node will be created for this database. covenantsql://...
is a database address which is used by SDK and CLI to locate the database on the blockchain.
5. Documents of CLI and SDK
After creating a database, there are some documents and examples to help you build an application with our database.
- CLI Document: CLI README.md
- SDK Document: SDK README.md
- SDK Demos: SDK Demos
6. SQLChain Explorer
Currently, the database on TestNet is permissionless, which means that if you know the DSN (address) of a database you can retrieve all modification history of the database and blocks information on blockchain through SQLChain Explorer.
For more technique details of testnet, please visit: