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

@adetante/explorer-besu-plugin

v1.0.4

Published

Alethio Explorer plugin that provides support for Hyperledger Besu authentication

Downloads

18

Readme

explorer-besu-plugin

Build

Alethio Explorer plugin that provides support for Hyperledger Besu authentication.

Hyperledger Besu supports authentication on JSON-RPC endpoint using a Bearer token in the Authorization header of JSON-RPC requests.

This plugin overrides the eth-lite Web3DataSource to handle Besu authentication and inject the authentication header.

Username and password are kept in memory to refresh the token every 4 minutes (Besu tokens expire after 5 minutes).

Installation instruction

See Alethio Lite Explorer documentation for the complete build procedure.

The main steps are:

# Clone ethereum-lite-explorer master branch
git clone [email protected]:Alethio/ethereum-lite-explorer.git
# Build
npm install
npm run build
# Install plugins
npm i -g @alethio/cms-plugin-tool
acp install \
    @alethio/explorer-plugin-eth-common \
    @alethio/explorer-plugin-eth-lite \
    @alethio/explorer-plugin-3box \
    @adetante/explorer-besu-plugin
# Copy/edit config.json to dist/ directory (see next section)

Configuration

:warning: As eth-lite plugin requires the authentication data adapter to be available during initialization, this plugin must be loaded BEFORE plugin://aleth.io/eth-lite in the plugins configuration.

In config.json, add the following plugin definition:

"plugins": [
    ...
    {
        "uri": "plugin://adetante/besu?v=1.0.4,
        "config": {
            "loginUrl": "https://my_besu_node/login"
        }
    }
    ...
]
  • loginUrl is the login endpoint. When using Besu default username/password authentication, this URL is the JSON-RPC HTTP url with /login suffix. If you use Besu JWT public key authentication, this URL can point to your own token distribution endpoint. Your login endpoint must accept POST requests with body { "username": "xxx", "password": "xxx" } and return a JSON response with { "token": "xxx" }

Update the plugin://aleth.io/eth-lite configuration with the link to the new data adapter:

"plugins": [
    ...,
    {
        "uri": "plugin://aleth.io/eth-lite?v=4.2.0",
        "config": {
            "nodeUrl": "https://my_besu_node",
            "authStoreUri": "adapter://adetante/besu/auth-store"
        }
    },
    ...
]
  • Add the authStoreUri attribute to the eth-lite configuration with the value adapter://adetante/besu/auth-store to link eth-lite to this plugin

Required Besu permissions

The minimum JSON-RPC permissions required to use Alethio Explorer are:

permissions = [
    "eth:getBlockByHash",
    "eth:getBlockByNumber",
    "eth:getBlockTransactionCountByHash",
    "eth:getBlockTransactionCountByNumber",
    "eth:blockNumber",
    "eth:getTransactionByHash",
    "eth:getTransactionReceipt",
    "eth:getBalance",
    "eth:getCode",
    "eth:getUncleByBlockHashAndIndex",
    "eth:getUncleByBlockNumberAndIndex",
    "net:peerCount"
]

To be defined in the Besu toml credentials file.

Running in Docker

A Docker image based on ethereum-lite-explorer is available on Docker Hub.

Just run

$ docker run -e APP_NODE_URL="https://my_besu_node" -p 80:80 adetante/explorer-besu-plugin:1.0.4

with the environment variable APP_NODE_URL referring to the JSON-RPC endpoint of Besu node.

This image uses the default config.json file, and sets ${APP_NODE_URL} as nodeUrl for eth-lite plugin and ${APP_NODE_URL}/login as loginUrl for Besu plugin. You can override config.json by mounting a custom configuration file in /usr/share/nginx/html/config.json (see Alethio Explorer: Running in Docker)