🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

p4p

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p4p

```javascript Node.create({ storagePath: string, // Persistent storage path p2p: { // Actual addresses where the server will be listening, ex. 0.0.0.0, 8080 listeningAddresses: { host: string, port: string }[],

latest
npmnpm
Version
0.1.4
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Protocol Node

Node.create({
  storagePath: string, // Persistent storage path
  p2p: {
    // Actual addresses where the server will be listening, ex. 0.0.0.0, 8080
		listeningAddresses: {
      host: string,
      port: string
    }[],
    
    // Addresses where the server can be found (Ej. Public Addresses, LAN Addresses, etc)
		advertisingAddresses: {
      host: string,
      port: string
    }[],
    
    // Known peers that are used as entry point for peer discovery
		knownPeers: {
      host: string,
      port: string,
      did: string
    }[],
  },
  
  // Network which the node will connect
  // If a string is passed, it will ask the knownPeers for the network settings
  // If a Network Object is passed, it will take it at it is
  // If a NetworkSettings Object is passed, it will create the network
  network: string | Network | <NetworkSettings>{
    name: string, // Custom name for your network
    salt: string, // Random salt to prevent similar networks to point to the same
    
    // Whitelist / Blacklist of which IP addresses can work on the network
    // Whitelist: "AA.BB.CC.DD/XX", Blacklist: "!AA.BB.CC.DD/XX"
    // Ex. ["0.0.0.0/0", "!127.0.0.1/8"] Allows all networks except localhost
    netmasks: string[]
  },
  
  http: {
    host: string,
    port: string
  },
  
  // List of `Protocol` objects, that extends the functionalities of the node
  // All node custom behavior and logic are defined as protocols.
  protocols: Protocol[]
})

FAQs

Package last updated on 04 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts