Commit Graph

54 Commits

Author SHA1 Message Date
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
Adam Babik ef160e8720
Add CallPrivateRPC binding (#825)
This PR provides CallPrivateRPC binding, which can call both public and private bindings but should not be used in web3.js provider implementations.
2018-04-16 10:01:37 +02:00
Adam Babik 0d652c3851
Expose only public APIs in inproc RPC client [breaking-change] (#815)
`CallRPC` binding, which is used as a provider for web3.js, exposes only public or whitelisted APIs.
2018-04-12 18:17:10 +02:00
Igor Mandrigin a9eb5a7d2b Generalize signing requests.
We need to be able to sign more than just transactions to make DApps
work properly. This change separates signing requests from the
transactions and make it more general to prepare to intoduce different
types of signing requests.

This change is designed to preserve status APIs, so it is
backward-comparible with the current API bindings.
2018-04-09 20:48:00 +02: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 aa0f2ede6d
[#795] : Remove geth/common package (#796) 2018-04-04 19:39:38 +02:00
Adrià Cidre 1b724a81a5
[#779] common.NodeManager removal 2018-03-28 17:39:09 +02:00
Adrià Cidre 13cb2daaa2
[#772] txQueueManager to not depend on AccountManager 2018-03-28 09:58:05 +02:00
Adrià Cidre 60d8ba5e62
Merge pull request #753 from status-im/feature/issue-403/account-package-cleanup
Account package cleanup
2018-03-23 14:16:27 +01:00
Adrià Cidre e22fa36111
[#755] Restructure notifier interfaces 2018-03-23 09:55:05 +01:00
Adrià Cidre 18fbebc942
[#issue-403] Account package cleanup 2018-03-23 08:21:40 +01:00
Alex Kohler 4a01a395b4 Move status-go over to go-ethereum/log #717 (#727) 2018-03-20 19:35:28 +01:00
Igor Mandrigin 804fe949f7 Fix state names and log messages for status changes API. 2018-03-19 19:52:55 +02:00
Igor Mandrigin 3b92b61ef1 Add API to listen to app state changes. 2018-03-15 12:48:22 +01:00
Alex Kohler 5fbacb49e1 Remove GetObjectValue from JailCell interface #691 (#693) 2018-03-01 17:48:30 +01:00
Igor Mandrigin f7baca7835 Don't hide RPC error reason. 2018-02-27 12:10:48 +01:00
Igor Mandrigin c06d58addd Remove `notifications` package from go-ethereum. 2018-02-22 11:10:21 +01:00
Dmitry Shulyak b2580c79d7
Add destructive tests (#646)
Network disconnect is introduced by removing default gateway, easily reversible condition.

On my local machine it takes 30 seconds for peers to reconnect after connectivity is restored. As you guess this is not an accident, and there is 30 seconds timeout for dial expiration. This dial expiration is used in p2p.Server to guarantee that peers are not dialed too often.

Additionally I added small script to Makefile to run such tests in docker environment, usage example:

```
make docker-test ARGS="./t/destructive/ -v -network=4"
```
2018-02-19 17:32:58 +02:00
Igor Mandrigin b83666a90e Fix linter warnings for StatusBackend. (#675) 2018-02-16 15:58:13 +02:00
Ivan Danyliuk 4982e1b8b8 Add ConnectionChange API call to backend for handling network state changes 2018-02-16 13:02:41 +01:00
Dmitry Shulyak 0b979c507d Fix async status api (#663) 2018-02-14 17:32:36 +01: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
Dmitry Shulyak 653da5bcd0 Result of tx processing returned as QueuedTxResult
Currently it is quite easy to introduce concurrency issues while working
with transaction object. For example, race issue will exist every time
while transaction is processed in a separate goroutine and caller will
try to check for an error before event to Done channel is sent.

This change removes all the data that is updated on transaction and leaves
it with ID, Args and Context (which is not used at the moment).

Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-02 09:47:56 +02:00
Dmitry Shulyak ba0b20e53f Remove mocks for transaction manager and transaction queue
It is very unlikely that there will be 2 or more implementations
of tx manager and queue, as they are tailored specifically to status project
requirements.
2018-01-26 15:21:34 +01:00
Dmitry Shulyak 680d0513b7 Refactoring of TxQueue and Manager (#530) 2018-01-25 21:59:21 -08:00
Dmitry Shulyak 0771e7d1b7 Use single codepath for sending transactions to a local and remote nodes (#527)
- new EthereumTransactor that provides higher level API for working with ethereum network, and it is fully conformant with ethclient
- new test rpc service that improves flexibility and coverage of txqueue manager tests
- run complete transaction sequantially for each address
- go-ethereum: Get pending nonce from transaction pool
- add a patch with getting nonce from transaction pool
2018-01-18 17:55:17 +01:00
Adam Babik b7fb51d92a
Refactor shh_requestMessages method (#513) 2017-12-21 11:26:01 +01:00
b00ris ba6c96532b add enode to request messages params (#508) 2017-12-12 12:00:17 +01:00
b00ris 9559ff074a Support for historic messages from MailServer (#503)
Add `shh_requestMessages` RPC method. It sends a message to MailServer that can return cached, possibly expired, Whisper message.
2017-12-07 14:37:43 +01:00
Ivan Tomilov 21beb685b4 Add -network flag for Makefile to chose a network to run tests on #430
PR adds test flag -network to e2e pacakge, for the selection of the desired blockchain network for running tests. It updates readme to demonstrates usage of flag.
2017-10-26 22:51:04 +03:00
Alexander Ewetumo 8145412d1c Ensure to return err for nil RPCCLient 2017-10-26 14:25:38 +01:00
Evgeny Danienko c823acfd04
All notifiers remaned into notification 2017-10-22 20:39:57 +03:00
Evgeny Danienko 9efed591da
Notifier constructor renamed 2017-10-22 20:39:57 +03:00
Eugene 42cb6446b9
Return error for notify 2017-10-22 20:39:56 +03:00
Eugene 804ed7c10c
Remove provider interface 2017-10-22 20:39:56 +03:00
Eugene 7195fe3f92
Create message provider interface 2017-10-22 20:39:55 +03:00
Eugene 4aaeeb6ebf
Extract notification into separete package and interface 2017-10-22 20:39:51 +03: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
Adam Babik 281b304edb Extract e2e tests to a separate package (#375)
This change moves our e2e tests into a separate package to make room for proper unit and integration tests.

This is Phase 1 described in #371.

Changes:

Makefile has separate directives to run unit/integration tests and e2e tests,
CI runs unit/integration tests first and then e2e tests,
E2e tests are in reliability order, i.e. the least reliable tests are run in the end to be sure that nothing else is broken,
Some tests are fixed or quarantined.
2017-10-11 17:20:51 +03:00
Ivan Daniluk 3540972f0e Refactor and cleanup Jail (#368)
Refactor and clean up Jail package:

 Removes account.Manager and txqueue.Manager from Jail as they are not used anymore
 Removes messageID related code from Jail.Send
 Simplifies Jail.Send to be a wrapper around RPC client's CallRaw
 Renames jail_cell* to cell*
 Related cleanups
2017-10-06 19:52:26 +03:00
Ivan Daniluk 9cc5fd2112 Move transaction queue code into separate package (#365) 2017-09-27 02:50:41 +02:00
Ivan Daniluk 93492cf606 Move accounts to separate package (#360) 2017-09-26 15:44:26 +02:00
Ivan Daniluk 2acf1a1a6a Refactor/signals package (#359)
Move signals code to the separate package.
2017-09-25 20:22:57 +02:00
Ivan Tomilov fc8f59e121 Fixed eth_sendTransaction routing to the local node (#351)
* Fixed eth_sendTransaction routing to the local node
* Add local RPC handlers for eth_accounts and eth_sendTransaction
2017-09-25 18:04:40 +02:00
Oskar Thorén f88de68f86 Push notifications: ability to trigger notifications via public API (#327)
This PR provides a way for status-react to trigger push notifications to contacts whose FCMToken they possess. It thus solves the basic user story as outlined in #326
2017-09-15 18:57:34 +03:00
Ivan Daniluk 9a5c1774c3 Refactor RPC client #304 (#311)
This PR refactors RPC subsystem for status-go:

cleans up two different RPC client implementations (RPCManager and rpc.Client)
creates new package under geth/rpc
moves routing logic into this package (rpc.(*router))
add tests for routing
cleans up NodeManager
2017-09-14 23:14:31 +03:00
Adam Babik 8fb2424ea5 Port the transactions queue from go-ethereum to status-go (#261)
Now all transactions in both cases are waiting for CompleteTransaction or DiscardTransaction to proceed independently from their destination: upstream of local
2017-09-04 15:56:58 +03:00
Adam Babik 9f57cf422f bugfix: properly handle no LES service (#272) 2017-08-26 15:42:34 +08:00
Ewetumo Alexander 1fb7d47c66 JSON RPC Proxy configuration (#193)
IMPORTANT: The known issue is that in case of configured UpstreamRPCServer transactions are sent immediately not waiting for CompleteTransaction or DiscardTransaction which brings inconsistency in behaviour and acts as a security breach.

* new UpstreamRPConfig in geth/params to provide upstream configuration
* conditional start of ethereum blockchain sequence based on NodeConfig.UpstreamConfig.Enabled flag state
2017-08-15 17:27:12 +07:00
Marin 3b316c0700 Beta/refactor logging#221 (#244)
Added a lightweight logger wrapper around go-ethereum/log which adds StatusIM prefix to all messages and allows to clearly distinguish between status-go and go-ethereum logs.

Logs under vendor/go-ethereum left unchanged because those pieces of code might undergo huge refactoring in the near term.
2017-08-10 20:35:58 +07:00