light: integrate with sync + serve_light CLI

This commit is contained in:
Robert Habermeier
2016-12-08 23:21:47 +01:00
parent efd66f566d
commit 6f5f1f5e26
20 changed files with 236 additions and 74 deletions

View File

@@ -32,6 +32,7 @@ warp = true
allow_ips = "all"
snapshot_peers = 0
max_pending_peers = 64
serve_light = true
reserved_only = false
reserved_peers = "./path_to_file"

View File

@@ -135,6 +135,8 @@ usage! {
flag_reserved_only: bool = false,
or |c: &Config| otry!(c.network).reserved_only.clone(),
flag_no_ancient_blocks: bool = false, or |_| None,
flag_serve_light: bool = false,
or |c: &Config| otry!(c.network).serve_light.clone(),
// -- API and Console Options
// RPC
@@ -334,6 +336,7 @@ struct Network {
node_key: Option<String>,
reserved_peers: Option<String>,
reserved_only: Option<bool>,
serve_light: Option<bool>,
}
#[derive(Default, Debug, PartialEq, RustcDecodable)]
@@ -543,6 +546,7 @@ mod tests {
flag_reserved_peers: Some("./path_to_file".into()),
flag_reserved_only: false,
flag_no_ancient_blocks: false,
flag_serve_light: true,
// -- API and Console Options
// RPC
@@ -713,6 +717,7 @@ mod tests {
node_key: None,
reserved_peers: Some("./path/to/reserved_peers".into()),
reserved_only: Some(true),
serve_light: None,
}),
rpc: Some(Rpc {
disable: Some(true),

View File

@@ -97,6 +97,7 @@ Networking Options:
--max-pending-peers NUM Allow up to NUM pending connections. (default: {flag_max_pending_peers})
--no-ancient-blocks Disable downloading old blocks after snapshot restoration
or warp sync. (default: {flag_no_ancient_blocks})
--serve-light Experimental: Serve light client peers. (default: {flag_serve_light})
API and Console Options:
--no-jsonrpc Disable the JSON-RPC API server. (default: {flag_no_jsonrpc})