Commit graph

472 commits

Author SHA1 Message Date
Nelson R. Perez
af5896a160 Replaced the PriorityQueue by the PriorityBlockingQueue in the LatencyNodeProvider class due to the fact that multiple threads can access the same provider 2018-11-08 17:59:01 -05:00
Severiano Jaramillo
b6aab142b6 - Added a method to remove nodes from LatencyNodeProvider and implemented a HashSet to keep track of such removed nodes. The reason is that calls to this class are asynchronous and only removing a node from the mFullNodeHeap was not enough to guarantee that it was not going to be added again.
- Added a isRemoved variable to FullNode class, so that the object can carry itself the removal status information and be able to use the same publish subject to broadcast the status of the FullNode.
- Added a method to remove nodes from NodeLatencyVerifier, removed such nodes from pending node latency measurements map 'nodeURLMap' and publish/broadcast the FullNode information with isRemoved=true so that components listening can act accordingly.
- Make proper changes to sample app's RemoteNodeActivity so that it removes 'removed' nodes from the list.
2018-11-08 15:14:01 -06:00
Severiano Jaramillo
21311ea5a3 Create RemoveNodeActivity in the sample project that shows an updated list of nodes sorted by latency. This whole activity while be used to add and test the functionallity of removing a node from the nodes list when the app that uses graphenej decides so, and then reconnects to the next best node. 2018-11-08 13:01:09 -06:00
Severiano Jaramillo
94511daea9 Simple improvements to sample app layouts 2018-11-08 10:44:47 -06:00
Severiano Jaramillo
dee17a12be Moving away of NetworkService and graphenej in general the decision to close connection to the current node and retry with another one just because the node does not provide the info needed in PalmPay. Graphenej has to be as app agnostic as possible so a new public method 'removeCurrentNodeAndReconnect()' was implemeted to do the removal and reconnection, and the app that uses graphenej has to decide by its own metrics to remove the current connected node and call such public method. 2018-11-07 21:20:36 -06:00
Severiano Jaramillo
214891fcc9 Added proper methods to deal with bitshares nodes that send 'trash info', which are nodes that potentially do not have installed the history plugin and thus do not respond properly to history related requests. As this information is needed for PalmPay we cannot rely on such nodes and have to try to connect to a different node. 2018-11-07 16:22:29 -06:00
Severiano Jaramillo
76713f0623 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-11-06 11:37:08 -06:00
Severiano Jaramillo
c6cd21cdf0 Fix crash in NetworkService due to components other than NetworkServiceManager binding to the service without the proper initialization information. This initialization was moved to another method named bootstrapService which is only called from NetworkServiceManager after the NetworkService has been properly connected. 2018-11-06 11:36:11 -06:00
Nelson R. Perez
7a19220c51 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-11-01 16:54:30 -05:00
Nelson R. Perez
f940d49cfc Added support for the 'get_account_balances' API call in the single-connection mode 2018-11-01 16:54:03 -05:00
Nelson R. Perez
eecc945259 Added a toString() to the AssetAmount class 2018-11-01 16:53:19 -05:00
Severiano Jaramillo
0b1caeb372 Update targetSdkVersion and compileSdkVersion. 2018-10-31 09:45:24 -06:00
Nelson R. Perez
d66c8f0ff8 Removed unneeded log 2018-10-24 19:52:50 -05:00
Nelson R. Perez
0fa75dcf22 Removed unneeded system log 2018-10-23 15:32:47 -05:00
Nelson R. Perez
878bc52d78 Fixed problem with the comparation function between two FullNode instances 2018-10-23 15:30:37 -05:00
Nelson R. Perez
b70881dfb5 Updated build tools version 2018-10-23 12:05:00 -05:00
Nelson R. Perez
a6e5910144 Fixing issues with the LatencyNodeProvider#getSortedNodes() method 2018-10-22 13:53:47 -05:00
Nelson R. Perez
8fb9bc57d6 Automatically trying to connect to the best node after DEFAULT_INITIAL_DELAY milliseconds, regardless of the completion of the node latency verifications 2018-10-19 00:10:11 -05:00
Nelson R. Perez
a5f0ba1345 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-10-18 18:00:19 -05:00
Nelson R. Perez
d37d35e0c6 Returning latency as Long.MAX_VALUE instead of zero to non-initialized FullNode instances 2018-10-18 17:57:27 -05:00
Nelson R. Perez
63eebf11c4 Exposing an interface that allows the fine tuning of the alpha parameter used to calculate the exponential moving average of measured latencies 2018-10-18 17:36:34 -05:00
Nelson R. Perez
3a19808ac5 Moved the node list information out of the library, this must be provided by the application now 2018-10-18 12:14:05 -05:00
Nelson R. Perez
36420e7f56 Trying to fix a NullPointerException by checking the refeence and enclosing the whole chunk of code into a syncronized block 2018-10-15 18:35:26 -05:00
Nelson R. Perez
d25a1f3fa0 Reduced the connection timeout from the default of 10 seconds to 2 seconds 2018-10-12 18:36:11 -05:00
Nelson R. Perez
d75957e5d1 Adding a new constructor to the GetFullAccounts API wrapper class 2018-10-11 19:46:03 -05:00
Nelson R. Perez
69e5740d00 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-10-09 18:54:51 -05:00
Nelson R. Perez
c773926ef7 Givingh the AccountOptionsDeserializer class more control over when it should de-serialize its UserAccount attribute and when it should skip it in order to prevent infinite recursion loops 2018-10-09 18:54:41 -05:00
Severiano Jaramillo
5ffda797b7 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-10-09 11:33:08 -05:00
Severiano Jaramillo
8bbf68ce6d Solve issue that caused Asset id's being saved localized into the database. It should always be saved in plain english. 2018-10-09 11:32:46 -05:00
Nelson R. Perez
b361cf5830 Added support for the 'get_key_references' API call in the single-connection mode 2018-10-08 19:55:49 -05:00
Nelson R. Perez
2618a6a3a0 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-10-04 13:44:11 -05:00
Nelson R. Perez
5a113ad7cc Added support fot the get_dynamic_global_properties API call in the single-connection mode 2018-10-04 10:13:55 -05:00
Nelson R. Perez
857236a1ea Moved the service binding to the onActivityResumed callback 2018-10-02 12:36:36 -05:00
Nelson R. Perez
25b7e6c8c6 Adding a very high latency to nodes that fail their connection 2018-10-02 01:35:53 -05:00
Nelson R. Perez
694572b18d Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-10-01 23:59:34 -05:00
Nelson R. Perez
740a75ae30 Updated the gradle plugin version 2018-10-01 23:58:23 -05:00
Nelson R. Perez
5ef4ebfca7 Preventing a NullPointerException by checking the nodeLatencyVerifier reference first 2018-10-01 23:58:03 -05:00
Severiano Jaramillo
a2e1bbd19c Remove non-working dexnode.net bitshares node 2018-09-28 22:32:01 -05:00
Severiano Jaramillo
94423470ce Update gradle version and remove app version number from the Manifest 2018-09-28 20:54:33 -05:00
Nelson R. Perez
b37bb9dce0 Merge branch 'develop' of github.com:Agorise/graphenej into develop 2018-09-27 17:43:45 -05:00
Nelson R. Perez
e357ffba66 Removed debug logs 2018-09-27 17:42:51 -05:00
Severiano Jaramillo
9374b125a1 Use a more descriptive value (simulating infinite) when the node could not be reached, in NodeLatencyVerifier 2018-09-27 13:10:28 -05:00
Severiano Jaramillo
bb14110b09 Fix small issue in the NodeLatencyVerifier that caused incorrect (very small) readings to no-reachable nodes due to no internet connection. 2018-09-27 11:33:18 -05:00
Nelson R. Perez
d109d86bf3 - Storing connectivity status at the FullNode class
- Flipping this flag accordingly at the NetworkService whenever we connect/disconnect from a specific node
- Notifying the NodeLatencyVerifier of this change
2018-09-26 17:17:31 -05:00
Severiano Jaramillo
3bdfb777bf Avoid adding repeated nodes to the list of nodes in NetworkService. 2018-09-26 12:05:00 -05:00
Nelson R. Perez
e107c014f0 The network service will retry a connection after 5 seconds in case of socket failure 2018-09-23 20:50:39 -05:00
Nelson R. Perez
35570cb4a6 Fixing a potential NullPointerException at the NetworkService 2018-09-21 13:29:47 -05:00
Nelson R. Perez
a28775d464 Merge branch 'feat_ping_nodes' into develop 2018-09-21 13:19:13 -05:00
Nelson R. Perez
a3288165de - Activating the latency verificaton at the SampleApplication 2018-09-20 21:51:41 -05:00
Nelson R. Perez
ede7265989 NodeLatencyVerifier
- Using an HttpUrl instance as a key to the map of FullNode instances, we were using simple String here before, but turned out not to be too reliable

NetworkService
- Introducing the NodeLatencyVerifier instance into the NetworkService, and making its use optional
- In case the user opts to use the node-latency verification, the initial connection is delayed until we obtain a measurement of all nodes
- Exposing a PublishSubject, this allows users of the library to get notified of the node latency measurements

NetworkServiceManager
- A boolean flag is now used to decide whether or not to start a NetworkService instance with the node-latency verification feature ON
2018-09-20 21:51:14 -05:00