|
|
@@ -149,6 +149,8 @@ struct NetInfo {
|
|
|
pub peers: Vec<Url>,
|
|
|
/// Supported network version
|
|
|
pub version: Version,
|
|
|
+ /// App Identifier for the app running on the network
|
|
|
+ pub app_name: String,
|
|
|
/// Enable localnet hosts
|
|
|
pub localnet: bool,
|
|
|
/// Path to P2P datastore
|
|
|
@@ -328,6 +330,12 @@ fn parse_configured_networks(data: &str) -> Result<HashMap<String, NetInfo>> {
|
|
|
semver::Version::parse(option_env!("CARGO_PKG_VERSION").unwrap_or("0.0.0"))?
|
|
|
};
|
|
|
|
|
|
+ let app_name = if table.contains_key("app_name") {
|
|
|
+ table["app_name"].as_str().unwrap().to_string()
|
|
|
+ } else {
|
|
|
+ String::new()
|
|
|
+ };
|
|
|
+
|
|
|
let datastore: String = table["datastore"].as_str().unwrap().to_string();
|
|
|
|
|
|
let hostlist: String = table["hostlist"].as_str().unwrap().to_string();
|
|
|
@@ -346,6 +354,7 @@ fn parse_configured_networks(data: &str) -> Result<HashMap<String, NetInfo>> {
|
|
|
seeds,
|
|
|
peers,
|
|
|
version,
|
|
|
+ app_name,
|
|
|
localnet,
|
|
|
datastore,
|
|
|
hostlist,
|
|
|
@@ -377,6 +386,7 @@ async fn spawn_net(name: String, info: &NetInfo, ex: Arc<Executor<'static>>) ->
|
|
|
outbound_connect_timeout: 30,
|
|
|
inbound_connections: 512,
|
|
|
app_version: info.version.clone(),
|
|
|
+ app_name: info.app_name.clone(),
|
|
|
localnet: info.localnet,
|
|
|
p2p_datastore: Some(info.datastore.clone()),
|
|
|
hostlist: Some(info.hostlist.clone()),
|