p2p.json - HelloZeroNet/Plugin-PeerMessage GitHub Wiki

p2p.json is a configuration file for PeerMessage and some other plugins in the future.

Here are available properties:

  • filter (required) - a regular expression which is used to validate incoming messages. Before validation messages are json-encoded, so you can use ^{}$ regular expression to test for empty object, and ^"abc"$ to test for string abc. Pass .*, which means "everything" to disable validation.

  • freq_limit (optional) - count of seconds that must pass between each message of a peer. So, if peer A sends a message and then another one in less than freq_limit seconds, the message won't be handled by other peers, and they will be likely to ban peer A after more invalid messages.

  • size_limit (optional) - maximum message size (in bytes) after json-encoded

  • cert_signers (optional) - if set, when signing messages (see Tutorials ‐ Signatures) you'll also get cert property, set to {cert_type}/{username}@{authprovider}, e.g. web/[email protected]. The object must look like:

{
    "auth_provider": ["address1", "address2", ...],
    ...
}

For example:

{
    "zeroid.bit": ["1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"]
}
  • signed_only (optional) - if set to true, only signed messages (i.e. those which were sent with privatekey property) will be handled. If this is a string, only messages signed by signed_only will be handled. If this is an array, only messages which are signed by someone in singed_only list, will be handled.