4

My peers.txt file for my private parity network looks like this.

enode://1111-redacted-6eaf@172.0.0.1:30303
enode://2222-redacted-6eaf@172.0.0.2:30303
enode://3333-redacted-6eaf@172.0.0.2:30303  

Is there any way to add inline comments for each line to remind me what each node is in my private network. I tried

# This is airport X node

but parity rejected it on startup.

2

Doesn't look like it at present, though IMO it'd be a sensible addition to allow it. Perhaps open a new ticket with the Parity folks.

The code is in configuration.rs. The only check it runs is using is_valid_node_url(), which doesn't allow anything except a URL.

    match self.args.flag_reserved_peers {
        Some(ref path) => {
            let mut buffer = String::new();
            let mut node_file = File::open(path).map_err(|e| format!("Error opening reserved nodes file: {}", e))?;
            node_file.read_to_string(&mut buffer).map_err(|_| "Error reading reserved node file")?;
            let lines = buffer.lines().map(|s| s.trim().to_owned()).filter(|s| !s.is_empty()).collect::<Vec<_>>();
            if let Some(invalid) = lines.iter().find(|s| !is_valid_node_url(s)) {
                return Err(format!("Invalid node address format given for a boot node: {}", invalid));
            }
            Ok(lines)
        },
        None => Ok(Vec::new())
    }
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.