Skip to content

Commit 29091aa

Browse files
Feature/rename nymd to nyxd (#2696)
* Renaming all instances of nymd to nyxd * Might as well get the changelogs too * Making it clearer that an ApiClient is a NymApiClient * Lining up config templates with struct keys on gateway * Changed the last references to validator_urls to nyxd_urls * Fixed up a few type errors after refactoring * Changed the changelog * Fixed typo in changelog * Further instances of renaming 'nymd' + introducing additional clap aliases * updated environmental variables and allowed usage of deprecated variants * missing occurences of coconut-locked environmental variables Co-authored-by: Jędrzej Stuczyński <[email protected]>
1 parent 5f4926d commit 29091aa

File tree

196 files changed

+1750
-1721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+1750
-1721
lines changed

.wellknown/wallet/validators.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"mainnet":[{
3-
"nymd_url":"https://rpc.nyx.nodes.guru/",
4-
"api_url":"https://api.nyx.nodes.guru/"
5-
}]
6-
}
2+
"mainnet": [
3+
{
4+
"nyxd_url": "https://rpc.nyx.nodes.guru/",
5+
"api_url": "https://api.nyx.nodes.guru/"
6+
}
7+
]
8+
}

CHANGELOG.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
1010

1111
### Changed
1212

13+
- renamed all references to validator_api to nym_api
14+
- renamed all references to nymd to nyxd
1315
- all-binaries: improved error logging ([#2686])
1416
- native client: bring shutdown logic up to the same level as socks5-client
1517
- nym-api, coconut-dkg contract: automatic, time-based dkg epoch state advancement ([#2670])
@@ -45,7 +47,7 @@ The release also include some additional work for distributed key generation in
4547
### Changed
4648

4749
- validator-api: can recover from shutdown during DKG process ([#1872])
48-
- clients: deduplicate gateway inititialization, part of work towards a rust-sdk
50+
- clients: deduplicate gateway initialization, part of work towards a rust-sdk
4951
- clients: keep all transmission lanes going at all times by making priority probabilistic
5052
- clients: ability to use multi-reply SURBs to send arbitrarily long messages fully anonymously whilst requesting additional reply blocks whenever they're about to run out ([#1796], [#1801], [#1804], [#1835], [#1858], [#1883]))
5153

@@ -120,7 +122,7 @@ The release also include some additional work for distributed key generation in
120122
- native-client/socks5-client/wasm-client: `use_extended_packet_size` Debug config option to make the client use 'ExtendedPacketSize' for its traffic (32kB as opposed to 2kB in 1.0.2) ([#1671])
121123
- network-requester: added additional Blockstream Green wallet endpoint to `example.allowed.list` ([#1611])
122124
- validator-api: add `interval_operating_cost` and `profit_margin_percent` to compute reward estimation endpoint
123-
- validator-client: added `query_contract_smart` and `query_contract_raw` on `NymdClient` ([#1558])
125+
- validator-client: added `query_contract_smart` and `query_contract_raw` on `NyxdClient` ([#1558])
124126
- wasm-client: uses updated wasm-compatible `client-core` so that it's now capable of packet retransmission, cover traffic and poisson delay (among other things!) ([#1673])
125127

126128
### Fixed
@@ -215,7 +217,7 @@ The release also include some additional work for distributed key generation in
215217
- All binaries and cosmwasm blobs are configured at runtime now; binaries are configured using environment variables or .env files and contracts keep the configuration parameters in storage ([#1463])
216218
- gateway, network-statistics: include gateway id in the sent statistical data ([#1478])
217219
- network explorer: tweak how active set probability is shown ([#1503])
218-
- validator-api: rewarder set update fails without panicking on possible nymd queries ([#1520])
220+
- validator-api: rewarder set update fails without panicking on possible nyxd queries ([#1520])
219221
- network-requester, socks5 client (nym-connect): send and receive respectively a message error to be displayed about filter check failure ([#1576])
220222

221223
[#1249]: https://github.com/nymtech/nym/pull/1249
@@ -588,14 +590,14 @@ The release also include some additional work for distributed key generation in
588590
- Feature/update wallet with stake rates [\#739](https://github.com/nymtech/nym/pull/739) ([neacsu](https://github.com/neacsu))
589591
- Add stake reward rates and bump version of client [\#738](https://github.com/nymtech/nym/pull/738) ([neacsu](https://github.com/neacsu))
590592
- Bump next from 10.1.3 to 11.1.0 in /wallet-web [\#737](https://github.com/nymtech/nym/pull/737) ([dependabot[bot]](https://github.com/apps/dependabot))
591-
- Feature/nymd client integration [\#736](https://github.com/nymtech/nym/pull/736) ([jstuczyn](https://github.com/jstuczyn))
593+
- Feature/nyxd client integration [\#736](https://github.com/nymtech/nym/pull/736) ([jstuczyn](https://github.com/jstuczyn))
592594
- Bug/fix parking lot on wasm [\#735](https://github.com/nymtech/nym/pull/735) ([neacsu](https://github.com/neacsu))
593595
- Explorer API: add new HTTP resource to decorate mix nodes with geoip locations [\#734](https://github.com/nymtech/nym/pull/734) ([mmsinclair](https://github.com/mmsinclair))
594-
- Feature/completing nymd client api [\#732](https://github.com/nymtech/nym/pull/732) ([jstuczyn](https://github.com/jstuczyn))
596+
- Feature/completing nyxd client api [\#732](https://github.com/nymtech/nym/pull/732) ([jstuczyn](https://github.com/jstuczyn))
595597
- Explorer API - add port check and node description/stats proxy [\#731](https://github.com/nymtech/nym/pull/731) ([mmsinclair](https://github.com/mmsinclair))
596-
- Feature/nymd client fee handling [\#730](https://github.com/nymtech/nym/pull/730) ([jstuczyn](https://github.com/jstuczyn))
598+
- Feature/nyxd client fee handling [\#730](https://github.com/nymtech/nym/pull/730) ([jstuczyn](https://github.com/jstuczyn))
597599
- Update DelegationCheck.tsx [\#725](https://github.com/nymtech/nym/pull/725) ([jessgess](https://github.com/jessgess))
598-
- Rust nymd/cosmwasm client [\#724](https://github.com/nymtech/nym/pull/724) ([jstuczyn](https://github.com/jstuczyn))
600+
- Rust nyxd/cosmwasm client [\#724](https://github.com/nymtech/nym/pull/724) ([jstuczyn](https://github.com/jstuczyn))
599601
- Removed wasm feature bypassing cyclic dependencies [\#723](https://github.com/nymtech/nym/pull/723) ([jstuczyn](https://github.com/jstuczyn))
600602
- Updated used sphinx dependency to the most recent revision [\#722](https://github.com/nymtech/nym/pull/722) ([jstuczyn](https://github.com/jstuczyn))
601603
- update state management and validation [\#721](https://github.com/nymtech/nym/pull/721) ([fmtabbara](https://github.com/fmtabbara))
@@ -614,7 +616,7 @@ The release also include some additional work for distributed key generation in
614616
- Bond and delegation alerts [\#698](https://github.com/nymtech/nym/pull/698) ([fmtabbara](https://github.com/fmtabbara))
615617
- Bugfix/network monitor version check [\#697](https://github.com/nymtech/nym/pull/697) ([jstuczyn](https://github.com/jstuczyn))
616618
- Feature/other containers [\#692](https://github.com/nymtech/nym/pull/692) ([neacsu](https://github.com/neacsu))
617-
- Using validator API instead of nymd [\#690](https://github.com/nymtech/nym/pull/690) ([futurechimp](https://github.com/futurechimp))
619+
- Using validator API instead of nyxd [\#690](https://github.com/nymtech/nym/pull/690) ([futurechimp](https://github.com/futurechimp))
618620
- Hang coconut issuance off the validator-api [\#679](https://github.com/nymtech/nym/pull/679) ([durch](https://github.com/durch))
619621
- Update hmac and blake3 [\#673](https://github.com/nymtech/nym/pull/673) ([durch](https://github.com/durch))
620622

clients/client-core/src/client/topology_control.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl TopologyRefresherConfig {
152152
}
153153

154154
pub struct TopologyRefresher {
155-
validator_client: validator_client::client::ApiClient,
155+
validator_client: validator_client::client::NymApiClient,
156156
client_version: String,
157157

158158
nym_api_urls: Vec<Url>,
@@ -168,7 +168,9 @@ impl TopologyRefresher {
168168
cfg.nym_api_urls.shuffle(&mut thread_rng());
169169

170170
TopologyRefresher {
171-
validator_client: validator_client::client::ApiClient::new(cfg.nym_api_urls[0].clone()),
171+
validator_client: validator_client::client::NymApiClient::new(
172+
cfg.nym_api_urls[0].clone(),
173+
),
172174
client_version: cfg.client_version,
173175
nym_api_urls: cfg.nym_api_urls,
174176
topology_accessor,

clients/client-core/src/config/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ impl<T> Config<T> {
172172
self.client.gateway_endpoint.gateway_id = id.into();
173173
}
174174

175-
pub fn set_custom_validators(&mut self, validator_urls: Vec<Url>) {
176-
self.client.validator_urls = validator_urls;
175+
pub fn set_custom_nyxd(&mut self, nyxd_urls: Vec<Url>) {
176+
self.client.nyxd_urls = nyxd_urls;
177177
}
178178

179179
pub fn set_custom_nym_apis(&mut self, nym_api_urls: Vec<Url>) {
@@ -234,7 +234,7 @@ impl<T> Config<T> {
234234
}
235235

236236
pub fn get_validator_endpoints(&self) -> Vec<Url> {
237-
self.client.validator_urls.clone()
237+
self.client.nyxd_urls.clone()
238238
}
239239

240240
pub fn get_nym_api_endpoints(&self) -> Vec<Url> {
@@ -420,9 +420,9 @@ pub struct Client<T> {
420420
#[serde(default)]
421421
disabled_credentials_mode: bool,
422422

423-
/// Addresses to nymd validators via which the client can communicate with the chain.
424-
#[serde(default)]
425-
validator_urls: Vec<Url>,
423+
/// Addresses to nyxd validators via which the client can communicate with the chain.
424+
#[serde(alias = "validator_urls")]
425+
nyxd_urls: Vec<Url>,
426426

427427
/// Addresses to APIs running on validator from which the client gets the view of the network.
428428
#[serde(alias = "validator_api_urls")]
@@ -476,7 +476,7 @@ impl<T: NymConfig> Default for Client<T> {
476476
version: env!("CARGO_PKG_VERSION").to_string(),
477477
id: "".to_string(),
478478
disabled_credentials_mode: true,
479-
validator_urls: vec![],
479+
nyxd_urls: vec![],
480480
nym_api_urls: vec![],
481481
private_identity_key_file: Default::default(),
482482
public_identity_key_file: Default::default(),

clients/client-core/src/init/helpers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub(super) async fn query_gateway_details(
2323
let nym_api = validator_servers
2424
.choose(&mut thread_rng())
2525
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
26-
let validator_client = validator_client::client::ApiClient::new(nym_api.clone());
26+
let validator_client = validator_client::client::NymApiClient::new(nym_api.clone());
2727

2828
log::trace!("Fetching list of gateways from: {}", nym_api);
2929
let gateways = validator_client.get_cached_gateways().await?;

clients/credential/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ credential-storage = { path = "../../common/credential-storage" }
2323
crypto = { path = "../../common/crypto", features = ["rand", "asymmetric", "symmetric", "aes", "hashing"] }
2424
network-defaults = { path = "../../common/network-defaults" }
2525
pemstore = { path = "../../common/pemstore" }
26-
validator-client = { path = "../../common/client-libs/validator-client", features = ["nymd-client"] }
26+
validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] }
2727

2828
[features]
2929
coconut = ["credentials/coconut"]

clients/credential/src/client.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ use bip39::Mnemonic;
66
use network_defaults::{NymNetworkDetails, VOUCHER_INFO};
77
use std::str::FromStr;
88
use url::Url;
9-
use validator_client::nymd;
10-
use validator_client::nymd::traits::CoconutBandwidthSigningClient;
11-
use validator_client::nymd::{Coin, Fee, NymdClient, SigningNymdClient};
9+
use validator_client::nyxd;
10+
use validator_client::nyxd::traits::CoconutBandwidthSigningClient;
11+
use validator_client::nyxd::{Coin, Fee, NyxdClient, SigningNyxdClient};
1212

1313
pub(crate) struct Client {
14-
nymd_client: NymdClient<SigningNymdClient>,
14+
nyxd_client: NyxdClient<SigningNyxdClient>,
1515
mix_denom_base: String,
1616
}
1717

1818
impl Client {
19-
pub fn new(nymd_url: &str, mnemonic: &str) -> Self {
20-
let nymd_url = Url::from_str(nymd_url).unwrap();
19+
pub fn new(nyxd_url: &str, mnemonic: &str) -> Self {
20+
let nyxd_url = Url::from_str(nyxd_url).unwrap();
2121
let mnemonic = Mnemonic::from_str(mnemonic).unwrap();
2222
let network_details = NymNetworkDetails::new_from_env();
23-
let config = nymd::Config::try_from_nym_network_details(&network_details)
23+
let config = nyxd::Config::try_from_nym_network_details(&network_details)
2424
.expect("failed to construct valid validator client config with the provided network");
25-
let nymd_client =
26-
NymdClient::connect_with_mnemonic(config, nymd_url.as_ref(), mnemonic, None).unwrap();
25+
let nyxd_client =
26+
NyxdClient::connect_with_mnemonic(config, nyxd_url.as_ref(), mnemonic, None).unwrap();
2727

2828
Client {
29-
nymd_client,
29+
nyxd_client,
3030
mix_denom_base: network_details.chain_details.mix_denom.base,
3131
}
3232
}
@@ -40,7 +40,7 @@ impl Client {
4040
) -> Result<String> {
4141
let amount = Coin::new(amount as u128, self.mix_denom_base.clone());
4242
Ok(self
43-
.nymd_client
43+
.nyxd_client
4444
.deposit(
4545
amount,
4646
String::from(VOUCHER_INFO),

clients/credential/src/commands.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use credentials::coconut::bandwidth::{BandwidthVoucher, TOTAL_ATTRIBUTES};
1313
use credentials::coconut::utils::obtain_aggregate_signature;
1414
use crypto::asymmetric::{encryption, identity};
1515
use network_defaults::{NymNetworkDetails, VOUCHER_INFO};
16-
use validator_client::nymd::tx::Hash;
16+
use validator_client::nyxd::tx::Hash;
1717
use validator_client::{CoconutApiClient, Config};
1818

1919
use crate::client::Client;
@@ -38,9 +38,9 @@ pub(crate) struct Run {
3838
#[clap(long)]
3939
pub(crate) client_home_directory: std::path::PathBuf,
4040

41-
/// The nymd URL that should be used
41+
/// The nyxd URL that should be used
4242
#[clap(long)]
43-
pub(crate) nymd_url: String,
43+
pub(crate) nyxd_url: String,
4444

4545
/// A mnemonic for the account that buys the credential
4646
#[clap(long)]
@@ -51,12 +51,12 @@ pub(crate) struct Run {
5151
pub(crate) amount: u64,
5252
}
5353

54-
pub(crate) async fn deposit(nymd_url: &str, mnemonic: &str, amount: u64) -> Result<State> {
54+
pub(crate) async fn deposit(nyxd_url: &str, mnemonic: &str, amount: u64) -> Result<State> {
5555
let mut rng = OsRng;
5656
let signing_keypair = KeyPair::from(identity::KeyPair::new(&mut rng));
5757
let encryption_keypair = KeyPair::from(encryption::KeyPair::new(&mut rng));
5858

59-
let client = Client::new(nymd_url, mnemonic);
59+
let client = Client::new(nyxd_url, mnemonic);
6060
let tx_hash = client
6161
.deposit(
6262
amount,

clients/credential/src/error.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use credential_storage::error::StorageError;
77
use credentials::error::Error as CredentialError;
88
use crypto::asymmetric::encryption::KeyRecoveryError;
99
use crypto::asymmetric::identity::Ed25519RecoveryError;
10-
use validator_client::nymd::error::NymdError;
10+
use validator_client::nyxd::error::NyxdError;
1111
use validator_client::ValidatorClientError;
1212

1313
pub type Result<T> = std::result::Result<T, CredentialClientError>;
1414

1515
#[derive(Error, Debug)]
1616
pub enum CredentialClientError {
17-
#[error("Nymd error: {0}")]
18-
Nymd(#[from] NymdError),
17+
#[error("Nyxd error: {0}")]
18+
Nyxd(#[from] NyxdError),
1919

2020
#[error("Validator client error: {0}")]
2121
ValidatorClientError(#[from] ValidatorClientError),

clients/credential/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cfg_if::cfg_if! {
3939
let db_path = r.client_home_directory.join(DATA_DIR).join(DB_FILE_NAME);
4040
let shared_storage = credential_storage::initialise_storage(db_path).await;
4141

42-
let state = deposit(&r.nymd_url, &r.mnemonic, r.amount).await?;
42+
let state = deposit(&r.nyxd_url, &r.mnemonic, r.amount).await?;
4343
get_credential(&state, shared_storage).await?;
4444
}
4545
Command::Completions(c) => c.generate(&mut crate::Cli::command(), bin_name),

clients/native/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ nymsphinx = { path = "../../common/nymsphinx" }
5151
pemstore = { path = "../../common/pemstore" }
5252
task = { path = "../../common/task" }
5353
topology = { path = "../../common/topology" }
54-
validator-client = { path = "../../common/client-libs/validator-client", features = ["nymd-client"] }
54+
validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] }
5555
version-checker = { path = "../../common/version-checker" }
5656
websocket-requests = { path = "websocket-requests" }
5757

clients/native/src/client/config/template.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ id = '{{ client.id }}'
2323
# to claim bandwidth without presenting bandwidth credentials.
2424
disabled_credentials_mode = {{ client.disabled_credentials_mode }}
2525
26-
# Addresses to nymd validators via which the client can communicate with the chain.
27-
validator_urls = [
28-
{{#each client.validator_urls }}
26+
# Addresses to nyxd validators via which the client can communicate with the chain.
27+
nyxd_urls = [
28+
{{#each client.nyxd_urls }}
2929
'{{this}}',
3030
{{/each}}
3131
]

clients/native/src/client/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ impl SocketClient {
5252
let mut client_config =
5353
validator_client::Config::try_from_nym_network_details(&details)
5454
.expect("failed to construct validator client config");
55-
let nymd_url = config
55+
let nyxd_url = config
5656
.get_base()
5757
.get_validator_endpoints()
5858
.pop()
59-
.expect("No nymd validator endpoint provided");
59+
.expect("No nyxd validator endpoint provided");
6060
let api_url = config
6161
.get_base()
6262
.get_nym_api_endpoints()
6363
.pop()
6464
.expect("No validator api endpoint provided");
6565
// overwrite env configuration with config URLs
66-
client_config = client_config.with_urls(nymd_url, api_url);
66+
client_config = client_config.with_urls(nyxd_url, api_url);
6767
let client = validator_client::Client::new_query(client_config)
6868
.expect("Could not construct query client");
6969
let coconut_api_clients =

clients/native/src/commands/init.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ pub(crate) struct Init {
2929
#[clap(long)]
3030
force_register_gateway: bool,
3131

32-
/// Comma separated list of rest endpoints of the nymd validators
32+
/// Comma separated list of rest endpoints of the nyxd validators
3333
#[cfg(feature = "coconut")]
34-
#[clap(long, value_delimiter = ',')]
35-
nymd_validators: Option<Vec<url::Url>>,
34+
#[clap(long, alias = "nymd_validators", value_delimiter = ',')]
35+
nyxd_urls: Option<Vec<url::Url>>,
3636

3737
/// Comma separated list of rest endpoints of the API validators
3838
#[clap(long, alias = "api_validators", value_delimiter = ',')]
@@ -77,7 +77,7 @@ impl From<Init> for OverrideConfig {
7777
no_cover: init_config.no_cover,
7878

7979
#[cfg(feature = "coconut")]
80-
nymd_validators: init_config.nymd_validators,
80+
nyxd_urls: init_config.nyxd_urls,
8181
#[cfg(feature = "coconut")]
8282
enabled_credentials_mode: init_config.enabled_credentials_mode,
8383
}

clients/native/src/commands/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub(crate) struct OverrideConfig {
5959
no_cover: bool,
6060

6161
#[cfg(feature = "coconut")]
62-
nymd_validators: Option<Vec<url::Url>>,
62+
nyxd_urls: Option<Vec<url::Url>>,
6363
#[cfg(feature = "coconut")]
6464
enabled_credentials_mode: bool,
6565
}
@@ -81,8 +81,8 @@ pub(crate) fn override_config(mut config: Config, args: OverrideConfig) -> Confi
8181
if let Some(nym_apis) = args.nym_apis {
8282
config.get_base_mut().set_custom_nym_apis(nym_apis);
8383
} else if std::env::var(network_defaults::var_names::CONFIGURED).is_ok() {
84-
let raw_validators = std::env::var(network_defaults::var_names::API_VALIDATOR)
85-
.expect("api validator not set");
84+
let raw_validators =
85+
std::env::var(network_defaults::var_names::NYM_API).expect("api validator not set");
8686
config
8787
.get_base_mut()
8888
.set_custom_nym_apis(config::parse_urls(&raw_validators));
@@ -98,14 +98,14 @@ pub(crate) fn override_config(mut config: Config, args: OverrideConfig) -> Confi
9898

9999
#[cfg(feature = "coconut")]
100100
{
101-
if let Some(nymd_validators) = args.nymd_validators {
102-
config.get_base_mut().set_custom_validators(nymd_validators);
101+
if let Some(nyxd_urls) = args.nyxd_urls {
102+
config.get_base_mut().set_custom_nyxd(nyxd_urls);
103103
} else if std::env::var(network_defaults::var_names::CONFIGURED).is_ok() {
104-
let raw_validators = std::env::var(network_defaults::var_names::NYMD_VALIDATOR)
105-
.expect("nymd validator not set");
104+
let raw_validators =
105+
std::env::var(network_defaults::var_names::NYXD).expect("nyxd validator not set");
106106
config
107107
.get_base_mut()
108-
.set_custom_validators(config::parse_urls(&raw_validators));
108+
.set_custom_nyxd(config::parse_urls(&raw_validators));
109109
}
110110
if args.enabled_credentials_mode {
111111
config.get_base_mut().with_disabled_credentials(false)

0 commit comments

Comments
 (0)