Open wxf4150 opened 2 years ago
now tracker's websocket server-api can switch to grc-server. but need more test.
Related dicussions have been put in the following issues:
https://github.com/omnilaboratory/obd/issues/55
https://github.com/omnilaboratory/obd/issues/56
issues:
service-interface :fixed old service-interfce:
The old intrerfaces: have no document; input/output parameters are week types; mixed gin-handler and data-api service
New service definition applies protobuf. Details are in tracker/tkrpc/info-tracker.proto
New interfaces:
Strong-typed data structure. Added/updated some comments as document in the proto definition file, and the document is displayed synchronously in proto genrated go-files, and will be automatically integrated in swagger document too, or obd js-sdk which invokes the rpc-service.
(fixed) one user connects to multiple obd-nodes ( tracker? ) which call getUserP2pNodeId from remote trackers. This will not work. Fixed: now an obd only connects one tracker when sync/query data.
(fixed) Tracker side updateUsers does not set userinfo.ObdP2pNodeId. userInfo should sync this field.
(fixed) omnibolt-report-final.pdf refer: OBD uses not maintained dependencies ( ile-rotatelogs, asdine/storm, etc.). Fixed: storm is delete, tracker uses gorm database model now.
(fixed) Tracker/dao/pojo.go UserInfo.ObdNodeId fieldname hard to understand.
(fixed) func (manager htlcManager) getPath(obdClient ObdNode, msgData string) (path interface{}, err error) at tracker/service/htlc_service.go lines 40.
the retured paramter path may be a string or a map; When consume returned value, you should use reflect to detect type of the return value at lightclient/connect_tracker.go lines 107, which is a bad desgin https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/lightclient/connect_tracker.go#L98-L114
(fixed) userState mananger, userOnlineOfOtherObdMap .fixed
old code
https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/tracker/service/p2p_service.go#L213-L245 it's hard to understand the the meaning of the var-params at line 225 from the context, you must seek the message source to understand the exact meaning of this variable, which is hard to maintain the source code. Concurrent map access is a problom too, which is now discarded.
the new code version :
(fixed) Two duplicated function: tracker/service/p2p_service.go sendChannelUnlockInfoToObd SendChannelLockInfoToObd
https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/tracker/service/p2p_service.go#L266-L300 https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/tracker/service/p2p_service.go#L349-L385
(to to)channelInfo will be updated on both sides of tracker and obd-server; When an obd starts, obd's channels-Info data will cover the data from the tracker, the tracker's update will lost. The sync mechanism between obd and tracker causes data error.
(to to) channelInfo's fields on tracker are different to the obd.
When obd commits channelInfo to a tracker, now we have the code to convert:
We should modify channelInfo's fields to be the same as the tracker. It will be easy when updates the sync mode between the obd and tracker.
channelInfo.IsAlice should be a function, it's a computed field. For example:
(to to) func (manager *htlcManager) getPath(msgData string) (path interface{}, err error) shoud have a document: the main flow,and how to use the returned value.
https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/tracker/service/htlc_service.go#L40-L83
(fixed) obd/service/user.go line 60 calls noticeTrackerUserLogin().sendMsgToTracker() . https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/service/user.go#L20-L76
(to to) may be we should design the obd-tracker info sync-mode and security first. Maybe new mechanism won't need the above work.