Commit Graph

51 Commits

Author SHA1 Message Date
Dmitry Shulyak 375d5ec8c3
Explicitly disable discovery (#886)
* Make it possible to explicitly disable discovery

Discovery will be disabled in following cases:
- if there are not bootnodes - v5 server will be disabled
because there is no point in running it
- if user defined in config NoDiscovery=true this value will be preserved
even if we have bootnodes

So, basically discovery will be always enabled by default on mobile, unless
it is explicitly specified otherwise.

When statusd is used current behavior is that discovery is disabled by default.
I kept it in this change, but it would be better to change it.

* Fix leftovers

* Add wait group to peer pool to protect from races with p2p.Server

* Change fields only when all goroutines finished

* Turn off discovery after topic searches are stopped

* Don't set period to nil to avoid race with SearchTopic

* Close period chan only when all writers are finished
2018-05-10 14:45:51 +03:00
Andrea Franz f7dac0bcc4
add ipcfile flag to specify IPC file path (#896) 2018-05-10 01:59:05 +02:00
Andrea Franz c673148bf4
add `-status` flag to enable the Status service (#902)
* add `-status` flag to enable the Status service

* remove status from default APIModules and add it only from statusd if specified

* remove AddAPIModule method

* allow -status flag values to be http or ipc
2018-05-08 23:57:29 +02:00
Frank Mueller c85e0802eb
Remove mention of DevMode (#869)
* Remove mention of DevMode

* Remove prodMode
2018-04-26 19:59:57 +02:00
Andrea Franz 5f45f6498d
Add LogEnabled attribute to NodeConfig to, used in the call from status-react (#866)
* add LogEnabled attribute to NodeConfig, used in the call from status-react

* fix use of OverrideRootLogin in tests

* enable logger in tests based on LogLevel

* move LogEnabled before LogFile
2018-04-26 18:28:42 +02:00
Adam Babik 5f075eeaba
Enable logs in tests (#852)
Pass `-log` option to `go test` in order to change the log level. By default, it's `INFO`.
2018-04-22 18:50:34 +02:00
Adam Babik 364f88efd9
Allow to start ephemeral StatusNode (#829)
This change will greatly simplify writing unit tests when a node is required but data persistence is irrelevant.

I also Introduced some refactoring and unit tests for `StatusNode`.
2018-04-16 14:36:09 +02:00
Dmitry Shulyak fc3decf661 Add tests for topic flags 2018-04-10 16:18:02 +03:00
Dmitry Shulyak 02309e81e9
Peer pool to manage v5 peers (#736) 2018-04-10 09:44:09 +03:00
Adrià Cidre 359b3621e9 [#797] Simplify node.Manager public api and rename it to StatusNode
- [x] [#797] : Remove unused methods PopulateStaticPeers, ReconnectStaticPeers, removeStaticPeers, removePeer
- [x] [#797] : Rename node.Manager to node. StatusNode and simplify its public api
- [x] [#797] : Rename all references to nodeManager to statusNode
2018-04-05 16:47:27 +02:00
Adrià Cidre 1b724a81a5
[#779] common.NodeManager removal 2018-03-28 17:39:09 +02:00
Frank Mueller 9bb732d981 Add profiling with pprof (#754) 2018-03-23 14:58:40 +01:00
Andrea Franz 70d153bb60
add log handler for Stdout and file (#751)
* add log handler for Stdout

* enhance logger based on node config

* write logs to stderr

* remove unused `return` after call to Fatal
2018-03-23 14:26:28 +01:00
Ivan Daniluk 01769e9ee8 Fix flags descriptions in statusd command (#747) 2018-03-21 09:45:50 +01:00
Alex Kohler 4a01a395b4 Move status-go over to go-ethereum/log #717 (#727) 2018-03-20 19:35:28 +01:00
Frank Mueller dc4a0a98ed Fix setting of bootstrap nodes (#744)
Fix dropped bootstrap nodes setting and rename of cluster config and separation of nodes
2018-03-20 16:05:21 +02:00
Frank Mueller 8e42014671
Static peers are now also optionally configurable (#738)
* Rename bootnode to static peers

Also add some groupings between types.

* Remove not needed genesisHash

* More cleanup of bootnodes with static peers

* Add option of cluster configuration file

* New generated bindata.go

* Changes after npm install

* Add argument for cluster configuration file

* Add test for dynamic cluster loading

Not yet sure with name "cluster config".

* Solved conflicts

* Renaming of static peers

* Remove static peers population

* Missing argument for config

* Renaming of static peers to boot nodes for consistency

* Fix of name change

* Cluster config is now cluster data

* Load static nodes from configuration

* Final renaming of var for file content
2018-03-19 17:22:09 +01:00
Pedro Pombeiro 6cdea4ef97
Update codebase to leverage Whisper v6 (#703)
* Update project to use Whisper v6. Part of #638

* Revert "Add patch to downgrade usage of Whisper v6 to v5 in some geth 1.8.1 vendor files. Part of #665" - this reverts commit 6aefb4c8fd02dbcfffac6b69e8bb22b13ef86b6b.

* Enable light mode on Whisper v6 for non-mail servers. Part of #638

* Fix race condition in whisperv6/peer.go. Part of #665 (PR already accepted upstream for 1.8.2)

* Update bootnode addresses in staticnodes.json. Part of #638

* Add `shh.lightclient` flag and tests for bloom filter setting logic. Part of #638

* Move MakeTestNodeConfig to utils. Part of #638

* Reduce PoW in `whisper_jail_test.go` to fix flaky test. Part of #638
2018-03-02 10:25:30 +01:00
Adam Babik 0a15c9ff9a
Configure mainnet nodes (#701)
Add mainnet static peers to static/config/staticpeers.json.
2018-02-26 19:36:04 +01:00
Pedro Pombeiro b8eaffb0f6
Fix nil pointer dereference in `main.startCollectingStats` 2018-02-22 17:51:19 +01:00
Igor Mandrigin c06d58addd Remove `notifications` package from go-ethereum. 2018-02-22 11:10:21 +01:00
Alex Kohler 228bda9fb3 Remove //nolint: gas directives from fmt.Fprintf #590 (#656)
Summary:
Filter out gas linter error checks for fmt.Fprintf commands. This required defining a custom linter around gas that additionally included the offending code.

Notes:

Gas format, without piping it through gometalinter, gives output like this:

$ gas -fmt=csv geth/jail/console/console.go
geth/jail/console/console.go,21,Errors unhandled.,LOW,HIGH,"fmt.Fprintf(w, ""%s: %s"", consoleEventName, formatForConsole(fn.ArgumentList))"
Gometalinter, by default, does not grab the line of code when it filters gas errors. To resolve this, I created a wrapper around gas (I wasn't sure what to call this "gas wrapper", I opted for gasv2, open to other names).

The first part of the regular expression was taken directly from gometalinter (see https://github.com/alecthomas/gometalinter/blob/master/linters.go#L236), and I then appended ,\".*\" to additionally grab the line of code of the offending line. Lastly, I excluded ".*Errors unhandled.*fmt.Fprintf.*" to filter out only fmt.Fprintf errors around omitted errors.

Also as a result of this change, gas lint output will now include the offending code.

Closes #590
2018-02-14 19:58:20 +02:00
Adam Babik 24aa1b0f1c add node_peers Prometheus metric 2018-02-13 15:18:29 +01:00
Dmitry Shulyak 6526bace85
Add cmd flag to specify http host of json rpc server (#651) 2018-02-12 16:17:10 +02:00
Dmitry Shulyak 2d964bfe9f Remove async operations from node manager (#584)
The main goal of this change is to remove async operations from node manager.
Additionally all of the signals from node manager are moved to status backend.

All of the async operation now will have the following behaviour:
- If node in the correct state exit immediatly without error
- If node not in the correct state exit immediatly with error
- In all other cases spawn a goroutine with wanted operation
- All the progress regarding that operation will be reported
  by using signals
- Signals should be handled in once place, which is StatusBackend

There are 2 potentially breaking changes:
- Empty event field will be ommited when Envelope is sent to a client
- All errors will be delivered to a client as an Envelope, previously
  some errors (NodeExists, NoRunningNode) were delivered synchronously

Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-09 14:37:56 +01:00
Adam Babik 9885d74db0 Fix sync-and-exit option logic (#628)
* fix sync-and-exit logic

* fix reading from doneSync channel

* clean up

* make statusd before using it

* move syncAndStopNode to different file

* change log level in travis chain sync command

* do not use fmt but log

* add progress log and set timeout to 20 mins

* set datadir to .ethereumtest

* fix datadir
2018-02-08 10:51:53 +02:00
Caner Çıdam ca719af71c Sync blockchain before running e2e tests on public testnet #568 (#612) 2018-02-07 11:48:03 +01:00
Adam Babik c00e5c9c58 Fix command line flags (#623) 2018-02-06 14:53:04 +02:00
Dmitry Shulyak f90e65820c
Fix linter after ethmetrics were merged (#622) 2018-02-06 13:59:40 +02:00
Dmitry Shulyak ca5a8f6669 Enable ethereum metrics collection (#616) 2018-02-05 21:25:40 +02:00
Dmitry Shulyak d699d35107 Make max amount of peers configurable (#611) 2018-02-05 11:12:57 +01:00
Denis Makogon 230e4febb1 Fixing test imports (#593) 2018-02-05 00:07:47 +01:00
Dmitry Shulyak ecf74e2189 Make whisper nodes reachable from prometheus by sharing a network
Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-02 15:22:22 +02:00
Adam Babik 89d89681a3
Add support for metrics (#558)
It adds support for metrics (expvar and Prometheus) along with docker-compose files to run a Whisper test cluster.
2018-01-30 12:51:48 +01:00
Adam Babik e214e1e270
Manage discovery from flags and refactor handling interrupt signals (#557) 2018-01-22 21:16:13 -08:00
Ivan Daniluk ea55ac0744
Cleanup after merging wnode-status and statusd (#554) 2018-01-17 22:40:14 +01:00
phcurtis 5a5c5d3a5c Merge wnode-status into statusd (#549) (#550) 2018-01-17 21:07:45 +01:00
F. Eugene Aumson 83763e0401 Make gas linter happy (#544) 2018-01-17 17:46:21 +01:00
Frank Mueller bddf15d74f Add internal RPC server and statusd-cli client (#463) 2017-12-02 19:51:55 +01:00
Ivan Daniluk 4536e99275 Improve statusd CLI usage (#441)
This PR refactors CLI API, removes obsolete commands and splits status code into smaller pieces:

* get rid of subcommands API (no ./status <command>)
* get rid of custom cli app package
* use stdlib flag package for handling command line flags
* move cross-compilation / mobile related code to lib/ package
* move wnode command into separate binary (cmd/node-status, name is subject to discuss)
* remove faucet command as obsolete
* update/add docs/READMES/wikis for new command line flags

It makes statusd code much simpler and smaller, separates concerns (lib, wnode and statusd are different things).
2017-11-03 18:07:13 -04:00
b00ris e911666b5d Fix make lint warnings (#417)
fixed make lint warnings
cleared linter_exclude_list.txt
removed some commented code
fixed comments from #388
2017-10-20 12:06:22 +03:00
Ivan Daniluk 0c4603d825 Add file logger support (#269) 2017-09-02 01:44:50 +07:00
Ivan Daniluk 4321f9b2e5 Fix log levels and enable ethereum-go logger (#256) 2017-08-24 15:50:16 +07:00
Ivan Tomilov ebd77aabe2 Merging bug/whisper-on-geth1.6.1 (#236) which acts like develop
* static: updates Whisper test (to work with Geth 1.6.1)
* jail: VM persistence implemented
* jail: sendMessage/showSuggestions minor fixes (to be squashed)
* node: CHT and boot nodes auto-load implemented
* Replaced CHT data file from farazdagi's to tiabc's
* Rewrote config_test.go using testify having reduced it twice in size
* Increased SyncTime and panic timeout in tests
* Fixed test - remove go default test to testify/suite (#207)
* Add flag setup for RPCEnabled and add comment (#225)
* jail: register method handlers before running initial js in jail (#226)
* Console Jail Mod #179 (#228)
* Added ./statusd-data into .gitignore
* Increased log level for the test node from INFO to ERROR
* Add call to loop.Run to evaluate all setTimeout/setIntervals methods. (#208)
* Rebase onto geth1.6.7 (#232)
* Got back sync duration from 60s to 30s, updated bindata.go
2017-08-04 23:14:17 +07:00
Victor Farazdagi 349103de1a major refactoring: node manager, tx queue, accounts, jail
- node: signals and node reset, fixes #152
- tests update (testify is used)
- node manager refactored, race conditions fixed
- node wrapper has been removed, we rely on go-ethereum node now
- tx queue refactored
- jail refactored
- backend and API introduced
2017-05-24 00:29:20 +03:00
Victor Farazdagi 4f27a79d83 config: homestead and rinkeby confg + allow dev/prod modes 2017-05-16 10:51:11 +03:00
Victor Farazdagi 88394690c2 cmd/statusd: faucet sub-command added, refs #159 2017-05-16 10:51:11 +03:00
Victor Farazdagi 2f0c93fd3b refactor: linters + recommendations applied, closes #146 2017-05-15 08:19:46 +03:00
Victor Farazdagi ecea845d88 rebase: minor fixes to integrate with Geth 1.6.1 2017-05-03 16:00:36 +03:00
Victor Farazdagi 9a68fd211f whisper: `statusd wnode` sub-command, closes #140 2017-04-28 11:50:12 +03:00