Use cached topology for clients (#674)

* Add validator-api common client

* Call validator-api from different clients for gateway topology

* Call validator-api from different clients for mixnode topology

* Use consts for the validator-api queries

* Rename the new query_validator function to query_validator_api

* Add mut to mixnode validator client

* Add refreshValidatorAPIGateways as a way to get the gateways...

... from validator-api

* Add refreshValidatorAPIGateways as a way to get the mixnodes...

... from validator-api

* Add yet another mut

* Change the port to validator-api service when querying the topology

* Add parsing check on the config phase...

... to make sure the validator URLs are in the correct format.

* Fix another clippy error

* Use all provided validators instead of just the first one

* The mutable reference was not actually needed, so remove it

* Use global variable for validator-api port

* Use url crate for checking the format and changing the port

* Use URL for parsing and move constants of validator-api to index.ts...

... until we find a way to link to the values from the validator-api
crate.

* Change global variables naming and have the API version into each API query

* Revert the changes to the index on connect...

... as they were working correctly before.

* Use all provided validators for mixnodes as well

* Remove location and layer
This commit is contained in:
Bogdan-Ștefan Neacşu
2021-07-09 13:50:41 +03:00
committed by GitHub
parent 3886ec5291
commit 973c30592f
21 changed files with 4558 additions and 32 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ impl MixNode {
);
let validator_client = validator_client::Client::new(validator_client_config);
let existing_nodes = match validator_client.get_mix_nodes().await {
let existing_nodes = match validator_client.get_cached_mix_nodes().await {
Ok(nodes) => nodes,
Err(err) => {
error!("failed to grab initial network mixnodes - {}\n Please try to startup again in few minutes", err);