aboutsummaryrefslogtreecommitdiffstats
path: root/node/api.go
Commit message (Collapse)AuthorAgeFilesLines
* cmd/geth, internal, node, vendor: nuke geth monitorPéter Szilágyi2019-04-051-147/+0
|
* all: new p2p node representation (#17643)Felix Lange2018-09-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package p2p/enode provides a generalized representation of p2p nodes which can contain arbitrary information in key/value pairs. It is also the new home for the node database. The "v4" identity scheme is also moved here from p2p/enr to remove the dependency on Ethereum crypto from that package. Record signature handling is changed significantly. The identity scheme registry is removed and acceptable schemes must be passed to any method that needs identity. This means records must now be validated explicitly after decoding. The enode API is designed to make signature handling easy and safe: most APIs around the codebase work with enode.Node, which is a wrapper around a valid record. Going from enr.Record to enode.Node requires a valid signature. * p2p/discover: port to p2p/enode This ports the discovery code to the new node representation in p2p/enode. The wire protocol is unchanged, this can be considered a refactoring change. The Kademlia table can now deal with nodes using an arbitrary identity scheme. This requires a few incompatible API changes: - Table.Lookup is not available anymore. It used to take a public key as argument because v4 protocol requires one. Its replacement is LookupRandom. - Table.Resolve takes *enode.Node instead of NodeID. This is also for v4 protocol compatibility because nodes cannot be looked up by ID alone. - Types Node and NodeID are gone. Further commits in the series will be fixes all over the the codebase to deal with those removals. * p2p: port to p2p/enode and discovery changes This adapts package p2p to the changes in p2p/discover. All uses of discover.Node and discover.NodeID are replaced by their equivalents from p2p/enode. New API is added to retrieve the enode.Node instance of a peer. The behavior of Server.Self with discovery disabled is improved. It now tries much harder to report a working IP address, falling back to 127.0.0.1 if no suitable address can be determined through other means. These changes were needed for tests of other packages later in the series. * p2p/simulations, p2p/testing: port to p2p/enode No surprises here, mostly replacements of discover.Node, discover.NodeID with their new equivalents. The 'interesting' API changes are: - testing.ProtocolSession tracks complete nodes, not just their IDs. - adapters.NodeConfig has a new method to create a complete node. These changes were needed to make swarm tests work. Note that the NodeID change makes the code incompatible with old simulation snapshots. * whisper/whisperv5, whisper/whisperv6: port to p2p/enode This port was easy because whisper uses []byte for node IDs and URL strings in the API. * eth: port to p2p/enode Again, easy to port because eth uses strings for node IDs and doesn't care about node information in any way. * les: port to p2p/enode Apart from replacing discover.NodeID with enode.ID, most changes are in the server pool code. It now deals with complete nodes instead of (Pubkey, IP, Port) triples. The database format is unchanged for now, but we should probably change it to use the node database later. * node: port to p2p/enode This change simply replaces discover.Node and discover.NodeID with their new equivalents. * swarm/network: port to p2p/enode Swarm has its own node address representation, BzzAddr, containing both an overlay address (the hash of a secp256k1 public key) and an underlay address (enode:// URL). There are no changes to the BzzAddr format in this commit, but certain operations such as creating a BzzAddr from a node ID are now impossible because node IDs aren't public keys anymore. Most swarm-related changes in the series remove uses of NewAddrFromNodeID, replacing it with NewAddr which takes a complete node as argument. ToOverlayAddr is removed because we can just use the node ID directly.
* Merge pull request #16333 from shazow/addremovetrustedpeerFelföldi Zsolt2018-08-061-1/+32
|\ | | | | rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.
| * rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.Andrey Petrov2018-06-221-1/+32
| | | | | | | | | | | | | | | | These RPC calls are analogous to Parity's parity_addReservedPeer and parity_removeReservedPeer. They are useful for adjusting the trusted peer set during runtime, without requiring restarting the server.
* | rpc: make HTTP RPC timeouts configurable, raise defaults (#17240)Ryan Schneider2018-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rpc: Make HTTP server timeout values configurable * rpc: Remove flags for setting HTTP Timeouts, configuring via .toml is sufficient. * rpc: Replace separate constants with a single default struct. * rpc: Update HTTP Server Read and Write Timeouts to 30s. * rpc: Remove redundant NewDefaultHTTPTimeouts function. * rpc: document HTTPTimeouts. * rpc: sanitize timeout values for library use
* | node: remove formatting from ResettingTimer metrics if requested in rawAndrea Franz2018-06-271-6/+6
|/
* metrics: expvar support for ResettingTimer (#16878)Anton Evangelatov2018-06-041-0/+30
| | | | | | | | * metrics: expvar support for ResettingTimer * metrics: use integers for percentiles; remove Overall * metrics: fix edge-case panic for index-out-of-range
* node: all golint warnings fixed (#16773)kiel barry2018-05-221-1/+1
| | | | | | | | * node: all golint warnings fixed * node: rm per peter * node: rm per peter
* node: fill StandardCounters as part of debugapi/metrics (#16054)Anton Evangelatov2018-02-271-0/+10
|
* metrics: pull library and introduce ResettingTimer and InfluxDB reporter ↵Anton Evangelatov2018-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | (#15910) * go-metrics: fork library and introduce ResettingTimer and InfluxDB reporter. * vendor: change nonsense/go-metrics to ethersphere/go-metrics * go-metrics: add tests. move ResettingTimer logic from reporter to type. * all, metrics: pull in metrics package in go-ethereum * metrics/test: make sure metrics are enabled for tests * metrics: apply gosimple rules * metrics/exp, internal/debug: init expvar endpoint when starting pprof server * internal/debug: tiny comment formatting fix
* rpc: dns rebind protection (#15962)Martin Holst Swende2018-02-121-2/+10
| | | | | | | | | | | | | | | | * cmd,node,rpc: add allowedHosts to prevent dns rebinding attacks * p2p,node: Fix bug with dumpconfig introduced in r54aeb8e4c0bb9f0e7a6c67258af67df3b266af3d * rpc: add wildcard support for rpcallowedhosts + go fmt * cmd/geth, cmd/utils, node, rpc: ignore direct ip(v4/6) addresses in rpc virtual hostnames check * http, rpc, utils: make vhosts into map, address review concerns * node: change log messages to use geth standard (not sprintf) * rpc: fix spelling
* p2p: add network simulation framework (#14982)Lewis Marshall2017-09-251-1/+41
| | | | | | This commit introduces a network simulation framework which can be used to run simulated networks of devp2p nodes. The intention is to use this for testing protocols, performing benchmarks and visualising emergent network behaviour.
* cmd/utils, node: remove unused solc references and improve RPC config (#14324)bas-vk2017-04-131-6/+16
| | | | | Currently http cors and websocket origins are a comma separated string in the config object. These are replaced with string arrays that are more expressive in case of a config file.
* node: fix pointer dereference issue in StartRPC (#3532)Victor Farazdagi2017-01-081-1/+1
|
* rpc: remove HexNumber, replace all uses with hexutil typesFelix Lange2016-12-201-7/+6
| | | | | This change couldn't be automated because HexNumber was used for numbers of all sizes.
* node: improve error handling for web3_sha3 RPC methodBas van Kervel2016-11-291-3/+3
|
* common, node: move datadir defaults into package nodeFelix Lange2016-09-161-2/+2
|
* node: ensure datadir can be co-inhabited by different instancesFelix Lange2016-09-161-9/+9
| | | | | This change ensures that nodes started with different Name but same DataDir values don't use the same nodekey and IPC socket.
* node, p2p, internal: Add ability to remove peers via admin interfaceFirescar962016-07-151-0/+16
|
* node: start RPC/WS interface on localhost by defaultBas van Kervel2016-05-061-2/+10
|
* rpc: various fixes/enhancementsBas van Kervel2016-04-121-4/+43
| | | | | | | | rpc: be less restrictive on the request id rpc: improved documentation console: upgrade web3.js to version 0.16.0 rpc: cache http connections rpc: rename wsDomains parameter to wsOrigins
* all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-221-1/+1
| | | | As we aren't really using the standarized SHA-3
* cmd, node, rpc: readd inproc RPC client, expose via nodePéter Szilágyi2016-02-091-1/+1
|
* cmd, node, rpc: move websockets into node, break singletonPéter Szilágyi2016-02-051-33/+16
|
* cmd, common, node, rpc: move HTTP RPC into node, drop singletone aspectPéter Szilágyi2016-02-051-30/+16
|
* internal/debug: APIs for profiling and tracingFelix Lange2016-01-281-27/+1
| | | | | | The debug package provides an RPC wrapper for glog settings and the debugging facilities of the Go runtime. They can be triggered through both command line flags and the IPC listener.
* rpc: migrated the RPC insterface to a new reflection based RPC layerBas van Kervel2016-01-261-16/+97
|
* node, rpc/api: add debug_vmodule, move admin_verbosity to debug_verbosityFelix Lange2016-01-211-0/+5
|
* core, eth, node, rpc: port the admin and debug APIPéter Szilágyi2015-12-151-0/+244