-
Notifications
You must be signed in to change notification settings - Fork 20.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node: refactor package node #21105
Merged
Merged
node: refactor package node #21105
Changes from all commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
3b2c927
created a new package node_2 where i am experimenting w/ interfaces a…
renaynay d44ac53
httpHandler -> httpServer
renaynay ec0c791
saving progress, working on ethstats impl
renaynay 7f36098
committing progress, eth.ethereum + les.lightethereum impl backend
renaynay bc838a2
not working yet, but committing progress
renaynay a607196
fixed some registration for services
renaynay c842bf8
semi-functional impl
renaynay 8dbba60
fixed dev mode start-up, should be working fine now
renaynay 2b67abf
registerrpc and regiterprotocols
renaynay bf8a05b
fixed RegisterLifecycle to be generic
renaynay fc7bff8
reverted capitalization of endpoint -- accident
renaynay ca32adf
removed TODO
renaynay 8290243
remove unnecessary constructor types
renaynay 95bc256
fixes http/ws servers not being able to be started on given host/port
renaynay 0ba43ec
registerHTTP but not w the signature felix suggested
renaynay 4985505
enable rpc/ws
renaynay 62ec847
changed RegisterHTTP and cleaned up some code, now gql can start on s…
renaynay 104ca9c
some clean up
renaynay 6e53f68
changed console http startup
renaynay deb1a8c
allow ws to be enabled on same port as http from console
renaynay 06a8de8
added todos
renaynay 4dd45c9
first steps implementing new design
renaynay c4f1d63
functional geth
renaynay e15007e
registering all apis
renaynay 3993923
added todo
renaynay 0a3f9a2
removed todo
renaynay 2888ca4
Register http (#16)
renaynay 1f1bc0d
remove unnecessary RegisterHTTP method
renaynay ae58c94
added docs, removed err return from register lifecycle
renaynay 7acc43f
HTTPServer implements Lifecycle and can be started by the lifecycle l…
renaynay 35460fd
removed unnecessary ListenerAddr
renaynay ccadac3
stopServer removes stopped server from list of httpservers on node an…
renaynay e3f2bd1
starting to remove use of node.Service throughout codebase
renaynay 1f5f52e
WIP, trying to remove node.Service from tests
renaynay 5866e01
fixes node tests (#18)
renaynay 1badd5d
http server array now a map (#19)
renaynay fbc9a64
removed unnecessary change to pass host, port instead of endpoint
renaynay 60ced1c
added some more tests for http servers
renaynay 53a2c8f
moved some gql-specific tests to gql package
renaynay 331d0a6
removed todo
renaynay 45eecce
whisper tests working
renaynay a380ff6
create a standalone whisper service for wnode purposes
renaynay 076a9a5
p2p/simulations uses `node.Lifecycle` instead of `node.Service` (#21)
renaynay 3eb4fc8
fixed mailserver tests
renaynay 6e41e41
les tests passing
renaynay 2df58f7
changes after rebasing on master, likely bc of serverpool pr
renaynay fd6623e
fixed p2p testing package
renaynay ebde331
removing unnecessary methods and fixing todos
renaynay 06bf009
removing more unnecessary methods
renaynay 4ce4c40
instead of passing both les and eth explicitly, fetch backend from node
renaynay cc3daf6
typo
renaynay 3f132b5
fetch backend from service context rather than node since node isnt s…
renaynay 306f390
fixing some broken tests
renaynay fddc6bd
linted
renaynay 6c91bb4
not passing backends to startnode
renaynay 5d67845
fixing docs
renaynay b8c5dc4
fixed dao_test
renaynay 885a7d4
lint
renaynay abbe6f8
fixed current tests, but need to add more
renaynay ae92dee
new test to check for proper creation of http servers on node
renaynay f2fcf69
added more test coverage, removed some useless code
renaynay 204514c
minor changes, removing spaces, cleaninng up
renaynay 41a25c3
some changes to graphql and other misc
renaynay 666db04
linted
renaynay 828646c
no need to pass gen state to makefullnode
renaynay 3443202
missing register apis and protocols
renaynay 9ed169e
register http before starting
renaynay fb8e5b0
added some documentation
renaynay e897df9
minor fixes
renaynay cfae6ed
Changes requested from PR review (#23)
renaynay d49a5be
attempt at fixing http test (#24)
renaynay 52896ae
fixed broken http test, waiting whether it passes on all builds
renaynay dce4780
use int32 instead of bool when checking whether to handle requests (#25)
renaynay 0e7b866
make sure to register all APIs when registering services apis on node
renaynay a5204a4
store int32
renaynay 71d9590
remove P2PServer method from les, unnecessary
renaynay 7661eb8
refactor http servers + graphql (#26)
renaynay d96b280
removed some TODOs
renaynay ff002b1
init leth handler
renaynay bafc12a
register protocols and apis of les on eth backend
renaynay 975061c
node: make Node.Attach work before Node.Start
fjl 8a568a4
all: excise SetContractBackend
fjl e930d38
revert blackbox test for ethclient
renaynay 54b8389
les: fix setOracle for chains without checkpoint
fjl 212bb78
les --> lifecycle decoupled from ethbackend (#29)
renaynay 1844d22
remove Fatalf from node, should panic instead
renaynay a24c7b8
eth: remove AddLesServer
fjl aaee36b
cmd/utils: remove duplicate protocol/API registration
fjl ebc7061
remove newgqlhandler from rpcstack
renaynay 5d2e755
node: stop lifecycles in reverse order
fjl 1b50b55
node: simplify RegisterLifecycle
fjl 489bb05
donnt check ls
renaynay b2931b6
Explicit type check for backend (#27)
renaynay e7602e3
go mod tidy
renaynay 9ee9bbe
linted
renaynay b26ea83
changes requested by gary
renaynay dd06152
node: unexport CreateHTTPServer
fjl 57ffd7c
graphql: don't check for HTTP server creation
fjl c8b01c4
node: unexport ExistingHTTPServer
fjl 783ad61
node: add new lifecycle docs
fjl af82314
node: fix comment on Start
fjl 33ffe5b
node: move datadir cleanup from Stop to Close
fjl 767e3b1
node: simplify stop channel
fjl ce38ec6
node: remove Stop
fjl cd46fce
all: Node.Stop -> Node.Close
fjl d2c2474
mobile: add TODO for restart
fjl 4fdd72b
node: add more runstate checks
fjl 068fe78
node: ensure Register* can only be used in initializing state
fjl 81ecb44
removed unnecessary use of fmt.Sprintf
renaynay 0ea3bb4
revert accidental q
renaynay f3f1178
fixed ethstats backend interface
renaynay 3c0fb99
node: whitespace changes
fjl 7801fad
p2p/simulations/adapters: use Node.Attach where possible
fjl d4e2173
node: avoid setting server to nil
fjl dab27f6
node: use simple lock
fjl b8d7587
node: more cosmetic fixes
fjl b6c60cf
node: track open databases
fjl 4ae4172
core/rawdb: make Freezer.Close idempotent
fjl 8400a5d
node: avoid auto-closing DB if service closes it first
fjl fa88f30
p2p/simulations/adapters: delete snapshotService
fjl 4da9ef7
p2p: delete Server.Running
fjl e1f4668
cmd/geth, cmd/utils: gofmt -w -s
fjl a30d401
p2p/simulations/examples: remove unused APIs callback
fjl 5a3cf7a
p2p/testing: delete unused package
fjl e6cd0e3
node: unexport RegisterHTTPServer
fjl aba0667
node: clean up instrumented service tests
fjl a23b650
node: add test for database auto-closing
fjl 0a5312a
node: WIP TestNodeOpenDatabaseFromLifecycle
fjl 39dbf65
node: move Start up
fjl 6a16cbe
node: simplify Start/Stop concurrency handling
fjl cc9fddd
node: unexport built-in API handler objects
fjl 390e8a3
node: move RegisterApisFromWhitelist
fjl 908268d
miner: fix test scripts
fjl 891b286
miner: simplify test scripts
fjl c70d5e6
miner: simplify test scripts even more
fjl 45f162c
node: remove atomic operations on n.state
fjl 4a6faff
node: WIP rewrite HTTP server setup
fjl a1a4454
descriptive logging
renaynay 2d81929
removed ws log
renaynay c985bd4
node: add test for StartRPC API
fjl f2dbf7e
node: fix test
fjl 47315c0
node: delete redundant websocket enabling test
fjl 9a1131c
node: fix all the HTTP server API tests
fjl 6d544c6
node: improve comments
fjl d7c1258
node: fix starting RPC after it failed to listen
fjl b8b1046
changed node tests
renaynay 8580962
rpcstack tests
renaynay 68cc90c
linted and new tests
renaynay 917135f
reshuffling some funcs in rpcstack
renaynay 3664dd5
node: move disableWS down as well
fjl de11bb1
node: improve comments
fjl 98cf053
go.mod: revert dependency updates
fjl b265e2c
eth: fix compile issue in backend.go
fjl 1c639bd
node: fix IPC API registration
fjl e11bc43
graphql: fix test
fjl f1b1b33
node: remove blank line
fjl 3001cf5
node: sort+dedup logged HTTP handlers
fjl 4d42e9f
node: fix lint issue
fjl 2b5bd5e
node: rename RegisterPath -> RegisterHandler
fjl 74e2aa9
node: explain RegisterHandler 'name' parameter in docs
fjl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything in this block is code that only works for full nodes.
We should create an auxiliary function for setting up
*eth.Ethereum
specificallyand then put a type assertion for
*eth.Ethereum
here.