Skip to content

Commit 820266b

Browse files
author
Zeqing Guo
authored
Merge pull request #214 from CovenantSQL/feature/clientLogOptimize
Client log optimize
2 parents cf292b4 + 20cfd16 commit 820266b

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

README-zh.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CovenantSQL 是应用区块链技术构建的去中心化 SQL 云数据库。
3232

3333
CovenantSQL 具备以下特点:
3434

35-
- **SQL接口**: 支持 SQL-92 标准,传统 App 几乎0修改即可数据上链
35+
- **SQL接口**: 支持 SQL-92 标准,传统 App 几乎 0 修改即可数据上链
3636
- **去中心化**: 基于独有的高效拜占庭容错共识算法 Kayak 实现的去中心化结构
3737
- **不可篡改**: CovenantSQL 中的 Query 历史记录是可追溯的
3838
- **隐私**: 如果 Bitcoin 是用户的钱包,那么 CovenantSQL 就是是用户的去中心化数据库
@@ -123,8 +123,7 @@ CovenantSQL仍在建设中,测试网已经发布,[尝试一下](https://test
123123

124124
## 测试网
125125

126-
- [快捷入口](https://testnet.covenantsql.io/quickstart)
127-
- [测试网水龙头](https://testnet.covenantsql.io/)
126+
- [快捷入口](https://developers.covenantsql.io)
128127

129128
## 联系我们
130129

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ Watch us or [![follow on Twitter](https://img.shields.io/twitter/url/https/twitt
106106

107107
## TestNet
108108

109-
- [Quick Start](https://testnet.covenantsql.io/quickstart)
110-
- [TestNet faucet](https://testnet.covenantsql.io/)
109+
- [Quick Start](https://developers.covenantsql.io)
111110

112111
## Contact
113112

client/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ ackWorkerLoop:
158158
var ackRes types.AckResponse
159159
// send ack back
160160
if err = pc.Call(route.DBSAck.String(), ack, &ackRes); err != nil {
161-
log.WithError(err).Warning("send ack failed")
161+
log.WithError(err).Debug("send ack failed")
162162
continue
163163
}
164164
}

client/driver.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,12 @@ func runPeerListUpdater() (err error) {
430430
if _, err = getPeers(dbID, privKey); err != nil {
431431
log.WithField("db", dbID).
432432
WithError(err).
433-
Warning("update peers failed")
433+
Debug("update peers failed")
434434

435435
// TODO(xq262144), better rpc remote error judgement
436436
if strings.Contains(err.Error(), bp.ErrNoSuchDatabase.Error()) {
437437
log.WithField("db", dbID).
438-
Warning("database no longer exists, stopped peers update")
438+
Warning("database no longer exists, stopping peers update")
439439
peerList.Delete(dbID)
440440
}
441441
}
@@ -493,14 +493,13 @@ func getPeers(dbID proto.DatabaseID, privKey *asymmetric.PrivateKey) (peers *pro
493493
profileReq.DBID = dbID
494494
err = rpc.RequestBP(route.MCCQuerySQLChainProfile.String(), profileReq, profileResp)
495495
if err != nil {
496-
log.WithError(err).Warning("get sqlchain profile failed in getPeers")
496+
err = errors.Wrap(err, "get sqlchain profile failed in getPeers")
497497
return
498498
}
499499

500500
nodeIDs := make([]proto.NodeID, len(profileResp.Profile.Miners))
501501
if len(profileResp.Profile.Miners) <= 0 {
502-
err = ErrInvalidProfile
503-
log.WithError(err).Warning("unexpected error in getPeers")
502+
err = errors.Wrap(ErrInvalidProfile, "unexpected error in getPeers")
504503
return
505504
}
506505
for i, mi := range profileResp.Profile.Miners {
@@ -514,7 +513,7 @@ func getPeers(dbID proto.DatabaseID, privKey *asymmetric.PrivateKey) (peers *pro
514513
}
515514
err = peers.Sign(privKey)
516515
if err != nil {
517-
log.WithError(err).Warning("sign peers failed in getPeers")
516+
err = errors.Wrap(err, "sign peers failed in getPeers")
518517
return
519518
}
520519

0 commit comments

Comments
 (0)