Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/multicash/mcxd/peer/v3

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/multicash/mcxd/peer/v3

  • v3.0.0-20210225111724-14ed8accef56
  • Source
  • Go
  • Socket score

Version published
Created
Source

peer

Build Status ISC License Doc

Package peer provides a common base for creating and managing MultiCash network peers.

This package has intentionally been designed so it can be used as a standalone package for any projects needing a full featured MultiCash peer base to build on.

Overview

This package builds upon the wire package, which provides the fundamental primitives necessary to speak the MultiCash wire protocol, in order to simplify the process of creating fully functional peers. In essence, it provides a common base for creating concurrent safe fully validating nodes, Simplified Payment Verification (SPV) nodes, proxies, etc.

A quick overview of the major features peer provides are as follows:

  • Provides a basic concurrent safe MultiCash peer for handling MultiCash communications via the peer-to-peer protocol
  • Full duplex reading and writing of MultiCash protocol messages
  • Automatic handling of the initial handshake process including protocol version negotiation
  • Asynchronous message queueing of outbound messages with optional channel for notification when the message is actually sent
  • Flexible peer configuration
    • Caller is responsible for creating outgoing connections and listening for incoming connections so they have flexibility to establish connections as they see fit (proxies, etc)
    • User agent name and version
    • MultiCash network
    • Service support signalling (full nodes, etc)
    • Maximum supported protocol version
    • Ability to register callbacks for handling MultiCash protocol messages
  • Inventory message batching and send trickling with known inventory detection and avoidance
  • Automatic periodic keep-alive pinging and pong responses
  • Random nonce generation and self connection detection
  • Snapshottable peer statistics such as the total number of bytes read and written, the remote address, user agent, and negotiated protocol version
  • Helper functions pushing addresses, getblocks, getheaders, and reject messages
    • These could all be sent manually via the standard message output function, but the helpers provide additional nice functionality such as duplicate filtering and address randomization
  • Ability to wait for shutdown/disconnect
  • Comprehensive test coverage

Installation and Updating

This package is part of the github.com/multicash/mcxd/peer/v2 module. Use the standard go tooling for working with modules to incorporate it.

Examples

  • New Outbound Peer Example Demonstrates the basic process for initializing and creating an outbound peer. Peers negotiate by exchanging version and verack messages. For demonstration, a simple handler for the version message is attached to the peer.

License

Package peer is licensed under the copyfree ISC License.

FAQs

Package last updated on 25 Feb 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc