OSDN Git Service

feat: add node discovery and status check (#374)
authorHAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Tue, 3 Sep 2019 10:56:05 +0000 (18:56 +0800)
committerPaladz <yzhu101@uottawa.ca>
Tue, 3 Sep 2019 10:56:05 +0000 (18:56 +0800)
commit001e399d2d0eb8f6956b844e721e2f0a4680ff90
tree12bf873fe7432da1331a73eb7455ff86be280ad5
parent91c664e4bf08540d413f8cdd087d436c2bae2ac6
feat: add node discovery and status check (#374)

* clean up

* fix

* add

* wip

* Revert "wip"

This reverts commit 83076e5f7fb08a396786de89d073d0469c72f7ae.

* dododo

* do

* fk

* clean up

* fix netID

* rename

* clean up

* update config

* fix typos

* don't stop

* change

* fix

* add

* fix

* config networkID

* can dial peer

* add comments

* doing

* collect discv

* clean

* add

* host to ip

* clean

* more clean

* refactor

* clean

* for test

* skip

* add best_height for liveness

* minor

* clean

* Revert "clean"

This reverts commit 676391a8b3411ba66fa50841825650bb147199cb.

* clean

* add back seeds

* add

* clean

* clean

* update seeds

* rename

* rename

* rename

* dd

* fix

* refactor

* ??

* fix

* update todo

* ???

* add peers for reactors

* update

* update

* add mock

* more mock

* mock

* add

* disconnect

* refactor

* ....

* why disconnect?

* fk

* not panic anymore

* fix

* fix

* clean up

* fk

* fk

* clean up

* clean up

* clean

* rename

* clean

* rename

* clean

* clean yo

* rename

* add todo

* fk

* ???

* clean up

* fix

* clean

* fix

* fix

* fk

* fix deadlock

* add

* clean

* folder

* fix

* add comments

* clean

* add

* clean up

* rename

* add moniker

* update

* update todo

* fk

* fix

* fix

* add ping

* fix

* move around

* fk

* remove locks

* fk

* fk

* Revert "fk"

This reverts commit a24d9d6d08105f3db232c0a1c54e2a466ce779fd.

* dododo

* beter

* fk

* try_err....

* fix AvgLantencyMS

* try

* ???

* fl

* fix

* ???

* clean up

* clean

* clean up

* ???

* use dbTX

* clean

* rename

* add

* init gin

* wip

* fix config

* add todos

* add

* add locks

* init discvWg

* add locks for conn

* clean up

* init processDialResult

* mv nodeMap

* rollback upsert

* clean

* fix deadlock

* clean

* fix join

* dododo

* wip

* fix

* add avgLatency

* fix height

* fix

* fix dir

* clean up

* fix rm

* clean

* clean up

* refactot

* fix itme

* fox

* fix order

* LatestDailyUptimeMinutes

* clean

* fix CI

* fix ci

* clean up

* minor

* change check_frequency

* init s.ListNodes

* rename node.host to node.ip

* mv bestHeight

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318683697

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318680795

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318674582

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318677500

* fix log.Debug

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318669877

* fix for log

* fix log

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318673448

* fix

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r318681813

* fix

* refactor

* clean up

* clean up

* ix

* clean

* update

* clean up

* fix ListNodes

* update

* update

* updare

* add status

* fix status

* clean up

* add offset

* clean up

* init rm NodeLiveness

* fix for status

* minor fix for status

* fix

* clean

* fix

* clean up

* check

* fix

* fix

* clean up

* ???

* ip&port

* clean

* fk

* updare

* fk

* fix

* ...

* clean

* peerLisr

* clean

* clean

* fix

* minro

* fix

* fix bestHeight?

* fix nanoseconds

* fix rtt

* rename policy config

* fix status

* fix

* add RequiredRttMS

* clean

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r319836748

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r319840951

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r319840078

* fix for https://github.com/Bytom/vapor/pull/374#discussion_r319835254

* fix

* fix

* rename

* mv timestamp type def

* fix for timestamp

* rollback
32 files changed:
.gitignore
Makefile
cmd/precognitive/main.go [new file with mode: 0644]
crypto/ed25519/ed25519.go
docs/precognitive/README.md [new file with mode: 0644]
docs/precognitive/config_example.json [new file with mode: 0644]
docs/precognitive/sql_dump/precognitive_schema.sql [new file with mode: 0644]
netsync/chainmgr/tool_test.go
netsync/consensusmgr/handle_test.go
netsync/peers/peer.go
netsync/peers/peer_test.go
netsync/sync_manager.go
p2p/peer.go
p2p/switch.go
p2p/test_util.go
test/mock/chain.go
toolbar/common/types.go [moved from toolbar/federation/types/types.go with 96% similarity]
toolbar/federation/database/orm/asset.go
toolbar/federation/database/orm/chain.go
toolbar/federation/database/orm/cross_transaction.go
toolbar/federation/database/orm/cross_transaction_req.go
toolbar/precognitive/api/handler.go [new file with mode: 0644]
toolbar/precognitive/api/server.go [new file with mode: 0644]
toolbar/precognitive/common/const.go [new file with mode: 0644]
toolbar/precognitive/config/config.go [new file with mode: 0644]
toolbar/precognitive/database/orm/node.go [new file with mode: 0644]
toolbar/precognitive/database/orm/node_liveness.go [new file with mode: 0644]
toolbar/precognitive/monitor/connection.go [new file with mode: 0644]
toolbar/precognitive/monitor/discover.go [new file with mode: 0644]
toolbar/precognitive/monitor/mock.go [new file with mode: 0644]
toolbar/precognitive/monitor/monitor.go [new file with mode: 0644]
toolbar/precognitive/monitor/stats.go [new file with mode: 0644]