Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Implements the RPLx transport.
#API
Network
new Network([options])
Creates new Network object with the following arguments
options
- An object with the Network configuration. See Network
optionsNetwork
optionsWhen creating a Network the following options can be used to configure its behavoir.
timeout
- The lenght of time in milliseconds to wait for a peer to response after connecting to itmaxPeers
- The max number of peer the network will try to connect toclientId
- specifies the client software identity, as a human-readable stringpublicIp
- The public ip of this nodesecretKey
- a 32 byte Buffer
use to encrypte packets and identify the node.subprotocols
- a hash containing the subprotocol name and its corisponding version numberNetwork
methodsnetwork.listen([port], [host])
start the tcp server
host
- The hostname or IP address the server is bound to. Defaults to 0.0.0.0
which means any available networkport
- The TPC port the server is listening to. Defaults to port 30303
network.connect(peer, [callback])
connect to a peer
peer
- a POJO containing
host
- the hostname or IP of the peerport
- the port of the peerid
- the id/public key of the peercallback
- a callback functionnetwork.close([callback])
stops the tcp server and disconnects any peers
Network
eventsThe Network object inherits from Events.EventEmitter
and emits the following events.
connection
- fires whever we connect with a peetr
peer
- The peer that emitted the eventPeer
The peer represents a peer on the ethereum network. Peer objects cannot be created directly.
Peer
methodspeer.sendHello([callback])
Sends the hello message
peer.sendDisconnect(reason, [callback])
Sends the disconnect message, where reason is one of the following integers
0x00
- Disconnect requested0x01
- TCP sub-system error0x02
- Bad protocol0x03
- Useless peer0x04
- Too many peers0x05
- Already connected0x06
- Wrong genesis block0x07
- Incompatible network protocols0x08
- Client quittingpeer.sendPing([callback])
Send Ping
peer.sendPong([callback])
Send Pong
##Peer
events
peer events are the same as Network
events
GPL
FAQs
A javascript libary implementing RPLx the ethereum p2p protocol
We found that devp2p demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.