Commit Graph

70 Commits

Author SHA1 Message Date
Jakub Sokołowski 98c861cfe2 make sure Version is always set in loadNodeConfig()
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-10-29 12:53:27 +01:00
Adam Babik 26880b83d7
Upgrade geth to 1.9.5 and Whisper (#1617) 2019-10-04 17:21:24 +02:00
yenda 963ea94e08 Update account timestamp when login with keycard (#1614)
Closes #1613
2019-09-24 08:32:32 +02:00
Dmitry Novotochinov d263be10c4
[#1599] send 'node.login' signal when login with keycard (#1600) 2019-09-06 17:23:33 +03:00
Adam Babik d7f454fe4c
Add mailservers service (#1595) 2019-09-04 08:25:33 +02:00
Andrea Maria Piana 42199e682f
Add error to login signal (#1594)
We add an error to login signal so that the caller can tell whether
login was successful or not
2019-09-03 15:00:14 +02:00
Dmitry Shulyak 63dcdd4e94 Statefull login with keycard (#1587) 2019-09-02 21:03:15 +02:00
dmitry bf95a71f6f Verify valid sub-accounts using database 2019-08-30 14:11:00 +03:00
Dmitry Shulyak 0165b028c9
Watch new accounts aftter they were saved to accounts table (#1569)
* Watch new accounts once they are saved in accounts table

* Add test that reactor can be restarted and watch new accounts
2019-08-28 10:49:03 +03:00
Andrea Maria Piana e118e89107
Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
Dmitry a67184adbd Wallet database isolated by the network id
Wallet database refactored so that every query ensures isolation by the network id.
Network id provided when database object is created, thus it is transparent to other parts
of the wallet module.

Additionally every uniqueness index is changed to ensure that it doesn't prevent adding
object with same id but from a different network.
2019-08-21 10:44:50 +03:00
Dmitry 494cb5bb33 Create single database appdatase 2019-08-21 10:44:50 +03:00
Dmitry Shulyak be9c55bc16
Accounts data management (#1530)
* WIP accounts implementation

* Accounts datasore and changes to status mobile API

* Add library changes and method to update config

* Handle error after account selection

* Add two methods to start account to backend

* Use encrypted database for settings and add a service for them

* Resolve linter warning

* Bring back StartNode StopNode for tests

* Add sub accounts and get/save api

* Changes to accounts structure

* Login use root address and fetch necessary info from database

* Cover accounts store with tests

* Refactor in progress

* Initialize status keystore instance before starting ethereum node

* Rework library tests

* Resolve failures in private api test and send transaction test

* Pass pointer to initialized config to unmarshal

* Use multiaccounts/accounts naming consistently

Multiaccount is used as a login identifier
Account references an address and a key, if account is not watch-only.

* Add login timestamp stored in the database to accounts.Account object

* Add photo-path field for multiaccount struct

* Add multiaccoutns rpc with updateAccount method

Update to any other account that wasn't used for login will return an error

* Fix linter in services/accounts

* Select account before starting a node

* Save list of accounts on first login

* Pass account manager to accounts service to avoid selecting account before starting a node

* Add logs to login with save and regualr login
2019-08-20 18:38:40 +03:00
Andrea Maria Piana cb769ccca9 Revert "Initialize status keystore instance before starting ethereum node"
This reverts commit 476240fbd1.
2019-08-05 16:03:18 +02:00
Dmitry 476240fbd1 Initialize status keystore instance before starting ethereum node 2019-08-01 11:01:02 +03:00
Andrea Franz acfe9a721c
Multi account login (#1525)
* multi-account login and signing

put methods count threshold back to 20

* validate login params

* refactoring

* use common.Address

* remove unused var in test
2019-07-26 16:45:10 +02:00
Andrea Franz dcb0fa5262
add multi-account support (#1500)
* add multiaccount support

add multi account ImportPrivateKey and StoreAccount

test derivation from normal keys

* add multiaccount to mobile pkg

* use multiaccount params structs from the mobile pkg

* move multiaccount tests together with the other lib tests

* fix codeclimate warning and temporarily increase methods threshold

* split library_test_utils.go to avoid linter warnings
2019-07-24 20:59:15 +02:00
Adam Babik e93d994460 integrate status-protocol-go 2019-07-24 18:46:43 +02:00
Dmitry Shulyak 9723b64827
Permissions api (#1524)
* Add permissions api

* Integrate permissions service

* Reduce cyclomatic complexity of the MakeNode function
2019-07-21 08:41:30 +03:00
Dmitry Shulyak 9dbf5a0c86
Add browsers API (#1523)
Add browsers API
2019-07-17 08:28:37 +03:00
Adam Babik dbaf622e12
Refactor messaging (#1510)
This change flattens messaging/chat package. It also removes dependency between multidevice and chat/protobuf packages.

The Publisher interface was also changed a bit to support more native types.

Version got bumped to 0.29.0-beta.3.
2019-07-03 21:13:11 +02:00
Andrea Maria Piana 3a1e244bdf
Restore installation endpoints (#1509) 2019-07-01 15:15:13 +02:00
Andrea Franz dd17860302
create random accounts in memory for onboarding (#1464)
* add account onboarding struct

* add onboarding to account manager

* allow resetting onboarding

* add onboarding functions to lib and mobile

* fix lint warnings

* update mnemonic test

* remove unused fmt

* reset onboarding before selecting account

* expose ResetOnboaring to lib and mobile

* refactoring

* add comment

* update StartOnboarding function

* remove unused var

* update VERSION

* fix returned accounts slice
2019-06-27 00:28:16 +02:00
Adam Babik e28d4ef1a3
Create messaging package and move some packages into it (#1505) 2019-06-26 20:17:41 +02:00
Andrea Maria Piana 5335a2b4fd
Move installations to status-go (#1499)
* Move installations to status-go

This commit moves installations management/storage to status-go.
We remove the native binding and provide RPC endpoints to set the
metadata and return a list of our own installations.
2019-06-26 11:32:59 +02:00
Andrea Maria Piana f6fba1d3d6 Publish contact code periodically 2019-06-19 17:38:45 +02:00
Andrea Maria Piana 1aa3e2812a Add support for partitioned topic 2019-06-19 17:38:45 +02:00
Dmitry Shulyak 047c9b5263
Download transfers starting from latest block header (#1467) 2019-06-14 13:16:30 +03:00
Dmitry Shulyak d5a172a358
All envelopes might be delivered in multiple batches (#1483) 2019-06-08 11:04:18 +03:00
Igor Mandrigin 10fc860a5f
fix parameters parsing for eth_* filters subscriptions (#1461) 2019-05-10 12:56:58 +02:00
Igor Mandrigin 4c1f96d255
Implement subscription for eth and shh filters using signals. (#1455) 2019-05-07 09:05:38 +02:00
Andrea Franz 28ec255d77
fix HashMessage to decode hex only if needed (#1450)
* hash message expects a string and not a hex string

* refactor HashMessage

* swap returned values
2019-04-30 01:26:41 +02:00
Igor Mandrigin 056bf367a7
Expose vanilla ECDSA signing (#1444) 2019-04-18 15:52:08 +02:00
Andrea Maria Piana f5875d62c5
Fetch multiple nodes from contract (#1430) 2019-03-29 18:49:01 +01:00
Andrea Maria Piana 8baae97e2e Add GetNodesFromContract endpoint
We added an endpoint that given an RPC url and a contract will fetch a
list of nodes and return them to the client.
2019-03-29 12:55:54 +01:00
Andrea Franz 8fe14e8f23
hash typed data (#1426)
* add HashTypedData to backend

* add HashTypedData to backand, lib, and mobile

* rename typeddata.Hash to typeddata.ValidateAndHash
2019-03-28 15:56:21 +01:00
Andrea Franz a61c0368bc
add HashMessage to backend, lib, and mobile. (#1421)
* add HashMessage to backend, lib, and mobile.

* move HashMessage out of the backend struct

* fix comment typo
2019-03-21 11:48:47 +01:00
Andrea Franz c869160ee7
add HashTransaction (#1379)
* add HashTransaction

* add buildTransaction

* test HashTransaction

* add HashTransaction to backend, lib, and mobile

* refactor buildTransaction

* add getTransactionNonce

* add log funtions
2019-02-21 10:53:39 +01:00
Andrea Franz 72906ac655
send tx with signature (#1374)
* add SendTransactionWithSignature to Transactor

* add comment to SendTransactionWithSignature

* add SendTransactionWithSignature to StatusBackend

*  add SendTransactionWithSignature to lib

* add SendTransactionWithSignature to mobile pkg

* increment nonce if needed

* add TestSendTransactionWithSignature_IncrementingNonce

* add NoError assertion

* validate tx args

* debug CI adding `env`

* CI debug

* remove debug

* return error if tx nonce is not the expected one

* fix lint warning
2019-02-15 12:31:20 +01:00
Andrea Maria Piana 2a4382369a
Add GetContactCode call, add DH flag (#1367)
This PR does a few things:

1) Add a call GetContactCode to check whether we have a bundle for a
given user.

2) Add a DH flag to the API (non-breaking change), for those messages
that we want to target all devices (contact-requests for example).

3) Fixes a few small issues with installations, namely if for example a
messages is sent without a bundle (currently not done by any client),
we still infer installation info, so that we can communicate securely
and making it truly optional.
2019-02-12 12:07:13 +01:00
Andrea Franz 0e0c3cd859
add shhext.InitProtocolWithEncryptionKey (#1362)
* add shhext.InitProtocolWithEncryptionKey

* update test to avoid lint error
2019-01-25 11:31:51 +01:00
Andrea Franz 929a5de757
Login with keycard (#1358)
* add InjectChatAccount to account manager

* add InjectChatAccount to Backend

* add comments to LoginWithKeycard

* add LoginWithKeycard test to lib

* fix export comment to avoid lint errors

* ensure wallet and chat keys are empty before injecting chat key

* rename InjectChatAccount to SetChatAccount

* add TestBackendInjectChatAccount

* stop node in TestBackendInjectChatAccount

* SetChatAccount doesn't return error

* add comment to InjectChatAccount

* fix account test
2019-01-24 16:44:46 +01:00
Pedro Pombeiro 55b3f31318 Add `SendDataNotification` method (#1352) 2019-01-18 14:03:32 +01:00
Andrea Franz 4939268edf
Unlock wallet and chat keys (#1346)
* select account decrypting wallet and chat keys

* adapt account tests to use chat and wallet account/keys

* fix tests using chat address

* changes after review

* fix status service e2e tests

* add account.Info struct returned when creating and recovering an account

* use s.EqualValues to compare recovered accounts

* return Info instead of *Info

* add both address and walletAddress to responses

* Update lib/types.go

Co-Authored-By: gravityblast <andrea@gravityblast.com>

* Update lib/types.go

Co-Authored-By: gravityblast <andrea@gravityblast.com>

* update comment to fix lint
2019-01-18 10:01:14 +01:00
Dmitry Shulyak 0b72aea56a Ensure that all discovery compoenents are set to nil on stop (#1351)
Previously we always tried to stop discovery if it was enabled according to
configuration. Now we check if it was started, because it can be started separataly from
a node.
2019-01-17 12:02:45 +01:00
Andrea Maria Piana 61bbbdde58
Revert "Change `NotifyUsers` to allow only data JSON element. Part of status-im/status-react#6772" (#1347)
This reverts commit cddf2e1c6c.
2019-01-14 13:09:51 +01:00
Andrea Franz 06d4a99c09
add selected wallet and selected chat accounts (#1326)
* use keyStore.ImportExtendedKeyForPurpose when creating keys

* rename selectecAccount to selectedWalletAccount

* add selectedChatAccount

* update e2e test to check that injected whisper key is the chat public key

* update TestSelectedAccountOnRestart to check that chat key is used in whisper

* use chat account in api/backend

* update mocks

* temporarily update VERSION to build a release

* check that chat/wallet keys are the same in a different test

* add account test to check that wallet and chat keys are the same

* test only that the chat key is injected in whisper

* put back the right VERSION
2019-01-09 09:47:06 +01:00
Roman Volosovskyi :: Darkviolet Lightgreen Halcyon 66fb99d5d6 Start discovery after sending "node.ready" signal (#1333)
We would like to optimize sending "node.ready" signal and do it as soon as possible. The peers discovery protocol can be started after the signal is sent.
2019-01-02 19:57:36 +01:00
Adam Babik 08931fb761
Handle gracefully RPC calls when node is stopped (#1329) 2018-12-20 09:31:17 +01:00
Dmitry Shulyak f2c6fef64c
Persist selected mail server using separate monitor (#1303)
This change allows to connect to the mail server that we were using before the app was restarted. Separate loop is listening for whisper events, and when we receive event that request was completed we will update time on a peer record.

Records are stored in leveldb. Body of the record is marshaled using json. At this point the only field is a timestamp when record was used.

This loop doesn't control connections, it only tracks what mail server we ended up using. It works asynchronously to connection management loop. Which tracks events that are related to connection state and expiry of the requests.

When app starts we look into the database and select the most recently used record. This record is added to connection management loop first. So if this server is available we will stick to using it. If we weren't able to connect to the same server in configured timeout (5s) we will try to connect to any other server from list of active servers.

closes: #1285
2018-12-12 11:39:00 +02:00