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

@solana/blockexplorer

v1.87.10

Published

[![Build status][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![npm-downloads][npm-downloads-image]][npm-url] [![semantic-release][semantic-release-image]][semantic-release-url]

Downloads

242

Readme

Build status npm npm-downloads semantic-release

Solana Block Explorer

Prerequisites

Redis

  • Ubuntu: apt-get install redis-server
  • MacOS: brew install redis

NodeJS

  • Install node.js via your favorite mechanism
  • Install yarn (typically npm install -g yarn)

Quick Start

Ensure Redis is running with redis-cli ping. If the ping fails, start redis with:

$ redis-server &

Then install the block explorer:

$ npm install -g @solana/blockexplorer

Build and run a local Solana node:

$ git clone https://github.com/solana-labs/solana.git
$ cd solana/
$ cargo build --all
$ ./run.sh

In another terminal start the block explorer:

$ solana-blockexplorer

Development Info

Setup the workspace:

$ yarn

Start the API service and Web UI manually with:

$ yarn start:api
$ yarn start:ui

Then configure and start a local Solana node. From the main solana repository:

$ cargo build --all
$ ./run.sh

and if desired for UI testing:

$ ./multinode-demo/client.sh --tx_count 40 --threads 2 -z 400

High Performance Use Cases

Redis via Unix Domain Socket

Redis is known as a very fast in-memory data structure server. To keep up with Solana speeds, it may be useful to enable Unix Domain Socket communication for added performance (potentially 10-40% or more depending on the operations).

Add configuration similar to the following to your /etc/redis/redis.conf (or equivalent):

unixsocket /var/run/redis/redis-server.sock
unixsocketperm 770

Increasing max socket connections on Linux may also prove useful:

sudo sysctl net.core.somaxconn=16384

Remember to restart redis-server to pick up the new configuration:

sudo service redis-server restart

Ensure that your API unix user is in the same group as your redis user so it can read the file. For example, you may need to do something like this:

sudo chgrp -R ubuntu /var/run/redis

Finally, update the redis section of api/config.js to enable the path configuration which takes precedence over the host/port options:

  ...
  redis: {
    ...
    path: '/var/run/redis/redis-server.sock',
  },
  ...

If you would like to test Redis performance, the redis-benchmark tool is very handy for quick sanity checks while tuning configuration.

Results using localhost TCP socket:

$ redis-benchmark -q -n 2000000 -c 1000 -P 40
PING_INLINE: 567215.00 requests per second
PING_BULK: 1021450.50 requests per second
SET: 587026.69 requests per second
GET: 741839.75 requests per second
INCR: 619195.06 requests per second
LPUSH: 671366.19 requests per second
RPUSH: 810701.25 requests per second
LPOP: 473372.78 requests per second
RPOP: 769230.81 requests per second
SADD: 925925.88 requests per second
HSET: 693721.81 requests per second
SPOP: 914494.75 requests per second
LPUSH (needed to benchmark LRANGE): 547495.19 requests per second
LRANGE_100 (first 100 elements): 34660.24 requests per second
LRANGE_300 (first 300 elements): 9543.71 requests per second
LRANGE_500 (first 450 elements): 6180.72 requests per second
LRANGE_600 (first 600 elements): 4716.88 requests per second
MSET (10 keys): 123137.54 requests per second

Results using Unix Domain Socket:

$ redis-benchmark -q -n 2000000 -c 1000 -P 40 -s /var/run/redis/redis-server.sock
PING_INLINE: 1038421.62 requests per second
PING_BULK: 1673640.12 requests per second
SET: 896459.00 requests per second
GET: 1175779.00 requests per second
INCR: 1107419.75 requests per second
LPUSH: 814995.94 requests per second
RPUSH: 768049.12 requests per second
LPOP: 775494.38 requests per second
RPOP: 884564.38 requests per second
SADD: 1047120.44 requests per second
HSET: 758437.62 requests per second
SPOP: 1275510.25 requests per second
LPUSH (needed to benchmark LRANGE): 810372.81 requests per second
LRANGE_100 (first 100 elements): 58491.50 requests per second
LRANGE_300 (first 300 elements): 12462.15 requests per second
LRANGE_500 (first 450 elements): 7449.32 requests per second
LRANGE_600 (first 600 elements): 4019.78 requests per second
MSET (10 keys): 120279.05 requests per second