npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@caldera-network/chia-network-scanner

v6.0.4

Published

Scans a Chia algorithm network for active full nodes

Downloads

9

Readme

Chia Network Scanner

Updated for Caldera Network's Usage in the DNS Seeder


Performs an asyncronous scan of the Chia network.

Rather than implementing a full node it communicates with another full node and requests it's peers - from there a graph traversal of the network is performed.

This powers the node count charts of Chia Explorer.

Usage

This can be installed as a module using npm:

npm install chia-network-scanner

Here is an example of how to scan the Chia Network:

import { ChiaNetworkScanner } from 'chia-network-scanner';

const chiaNetworkScanner = new ChiaNetworkScanner({
    // The network to scan and protocol to use
    network: {
        networkId: 'd4735eaa2ffe1cceeeef59718b9eed0ee19cc7d8bbc51ff0da226611ec44a555',
        protocolVersion: '0.0.29',
        softwareVersion: '0.2.2'
    },

    startNodes: [{
        hostname: 'sumo.chia.net',
        port: 58444,
    }, {
        hostname: 'beast.chia.net',
        port: 58444,
    }],

    // Identifies this peer on the network
    peer: {
        nodeType: 1,
    },

    // Used to timeout on various operations such as handshake
    connectionTimeout: 2500,

    // Number of peers to scan concurrently. Bigger is faster but uses more sockets and memory :)
    concurrency: 50,

    // Full node public key
    keyPath: '/root/123.key',

    // Full node public cert
    certPath: '/root/123.crt'
});

const peers = await chiaNetworkScanner.scan();

The result of the scan is an array of peer objects that have a hostname, port and timestamp.

Logs

You will see lots of logs about connections refused and not handling messages that other peers have sent to you. This is fine. Example:

{"level":30,"time":1604247342367,"pid":72087,"hostname":"chiaexplorer","msg":"Sending handshake message"}
{"level":30,"time":1604247342406,"pid":72087,"hostname":"chiaexplorer","msg":"Established TCP connection to Chia node 92.29.105.141:8444"}
{"level":30,"time":1604247342442,"pid":72087,"hostname":"chiaexplorer","msg":"Sending handshake_ack message"}
{"level":30,"time":1604247342442,"pid":72087,"hostname":"chiaexplorer","msg":"Sending request_peers message"}
{"level":40,"time":1604247342465,"pid":72087,"hostname":"chiaexplorer","msg":"No handler for new_tip message. Discarding it."}
{"level":40,"time":1604247342482,"pid":72087,"hostname":"chiaexplorer","msg":"No handler for new_tip message. Discarding it."}
{"level":40,"time":1604247342482,"pid":72087,"hostname":"chiaexplorer","msg":"No handler for new_tip message. Discarding it."}
{"level":40,"time":1604247342482,"pid":72087,"hostname":"chiaexplorer","msg":"No handler for request_mempool_transactions message. Discarding it."}
{"level":30,"time":1604247342528,"pid":72087,"hostname":"chiaexplorer","msg":"Connection closed"}
{"level":30,"time":1604247342652,"pid":72087,"hostname":"chiaexplorer","errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"2003:db:772e:500:5ce7:935c:aa0b:8834","port":8444,"stack":"Error: connect ECONNREFUSED 2003:db:772e:500:5ce7:935c:aa0b:8834:8444\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)","type":"Error","msg":"Connection closed"}
{"level":30,"time":1604247342652,"pid":72087,"hostname":"chiaexplorer","msg":"Connection closed"}
{"level":30,"time":1604247342681,"pid":72087,"hostname":"chiaexplorer","errno":"ENETUNREACH","code":"ENETUNREACH","syscall":"connect","address":"2a01:c23:78b3:2801:4085:7f6f:5cbf:ba5","port":8444,"stack":"Error: connect ENETUNREACH 2a01:c23:78b3:2801:4085:7f6f:5cbf:ba5:8444\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)","type":"Error","msg":"Connection closed"}
{"level":30,"time":1604247342682,"pid":72087,"hostname":"chiaexplorer","msg":"Connection closed"}
{"level":30,"time":1604247342698,"pid":72087,"hostname":"chiaexplorer","visited":false,"hostname":"165.227.56.10","port":8444,"timestamp":1602428570,"msg":"Visiting peer"}
{"level":30,"time":1604247342699,"pid":72087,"hostname":"chiaexplorer","msg":"Sending handshake message"}

Contributions welcome

Feel free to contribute with PRs or even by throwing ideas into the issue tab.