This doc introduce the usage of CovenantSQL block producer chain explorer server.
Make sure the $GOPATH/bin is in your $PATH, download/build the explorer binary.
$ go get github.com/CovenantSQL/CovenantSQL/cmd/cql-explorerAdapter requires a CovenantSQL config.yaml which can by generated by configuration generator.
Generate the main configuration file. Same as Generating Default Config File in Golang Client Doc. An existing configuration file can also be used.
Start the explorer by following commands:
$ cql-explorerThe available options are:
$ cql-explorer --help
Usage of cql-explorer:
-config string
Config file path (default "~/.cql/config.yaml")
-interval duration
New block check interval for explorer (default 2s)
-listen string
Listen address for http explorer api (default "127.0.0.1:4665")
-password string
Master key password for covenantsqlGET /v1/head
{
"success" : true,
"status" : "ok",
"data" : {
"block" : {
"txs" : [],
"hash" : "20ba21af54da3e17252fb4b6b7331fb6f36aca1b9b793597af6ef46faad34dea",
"timestamp" : 1540278575120.34,
"version" : 1,
"count" : 561,
"producer" : "8d7604acfdb391891a4c795f0939425b6d58bd50a81e579d15f06ecd381ad549",
"height" : 3040488,
"parent" : "f9c4f9c7a1dcbcf14a13eb91a007b33672f1f8a261738f5a25fee27c3ccaa584"
}
}
}GET /v1/count/{count}
count: count of specified block, 0 for genesis block
{
"success" : true,
"status" : "ok",
"data" : {
"block" : {
"version" : 1,
"height" : 0,
"count" : 0,
"timestamp" : 1534197599120,
"hash" : "f745ca6427237aac858dd3c7f2df8e6f3c18d0f1c164e07a1c6b8eebeba6b154",
"txs" : [],
"parent" : "0000000000000000000000000000000000000000000000000000000000000001",
"producer" : "0000000000000000000000000000000000000000000000000000000000000001"
}
}
}GET /v1/block/{hash}
hash: hash of specified block
{
"success" : true,
"status" : "ok",
"data" : {
"block" : {
"version" : 1,
"height" : 0,
"count" : 0,
"timestamp" : 1534197599120,
"hash" : "f745ca6427237aac858dd3c7f2df8e6f3c18d0f1c164e07a1c6b8eebeba6b154",
"txs" : [],
"parent" : "0000000000000000000000000000000000000000000000000000000000000001",
"producer" : "0000000000000000000000000000000000000000000000000000000000000001"
}
}
}GET /v1/height/{height}
height: height of specified block, 0 for genesis block (height is related to block produce time and interval)
{
"success" : true,
"status" : "ok",
"data" : {
"block" : {
"version" : 1,
"height" : 0,
"count" : 0,
"timestamp" : 1534197599120,
"hash" : "f745ca6427237aac858dd3c7f2df8e6f3c18d0f1c164e07a1c6b8eebeba6b154",
"txs" : [],
"parent" : "0000000000000000000000000000000000000000000000000000000000000001",
"producer" : "0000000000000000000000000000000000000000000000000000000000000001"
}
}
}GET /v1/tx/{hash}
hash: hash of specified tx
{
"success": true,
"status": "ok",
"data": {
"tx": {
"nonce": 11616,
"amount": 1225,
"sender": "00000bef611d346c0cbe1beaa76e7f0ed705a194fdf9ac3a248ec70e9c198bf9",
"receiver": "676b12fef8732ac78a97ea5dba0977bbbabc48f64eee66f09be89a589297e567",
"type": "Transfer"
}
}
}