Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

support setting ZMQ socks proxy #2400

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions libindy/src/api/pool.rs
Expand Up @@ -79,6 +79,7 @@ pub extern fn indy_create_pool_ledger_config(command_handle: CommandHandle,
/// "number_read_nodes": int (optional) - the number of nodes to send read requests (2 by default)
/// By default Libindy sends a read requests to 2 nodes in the pool.
/// If response isn't received or `state proof` is invalid Libindy sends the request again but to 2 (`number_read_nodes`) * 2 = 4 nodes and so far until completion.
/// "socks_proxy": string (optional) - ZMQ socks proxy host name and port (example: proxy1.intranet.company.com:1080)
/// }
///
/// #Returns
Expand Down
5 changes: 5 additions & 0 deletions libindy/src/domain/pool.rs
Expand Up @@ -33,6 +33,8 @@ pub struct PoolOpenConfig {
pub preordered_nodes: Vec<String>,
#[serde(default = "PoolOpenConfig::default_number_read_nodes")]
pub number_read_nodes: u8,
#[serde(default = "PoolOpenConfig::default_socks_proxy")]
pub socks_proxy: String,
}

impl Validatable for PoolOpenConfig {
Expand Down Expand Up @@ -65,6 +67,7 @@ impl Default for PoolOpenConfig {
conn_active_timeout: PoolOpenConfig::default_conn_active_timeout(),
preordered_nodes: PoolOpenConfig::default_preordered_nodes(),
number_read_nodes: PoolOpenConfig::default_number_read_nodes(),
socks_proxy: PoolOpenConfig::default_socks_proxy(),
}
}
}
Expand All @@ -91,4 +94,6 @@ impl PoolOpenConfig {
}

fn default_number_read_nodes() -> u8 { NUMBER_READ_NODES }

fn default_socks_proxy() -> String { String::new() }
}