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

@energyweb/ev-asset-operator-server

v1.2.0

Published

HTTP API for AssetOperators to enable their assets to participate in the ev-dashboard.

Downloads

11

Readme

asset-operator-server

A node server which listens for NATS messages related to the EV charging prequalification process.

Installation and setup

The asset-operator-server can be installed by running npm i -g @energyweb/ev-asset-operator-server

Several configuration values are required to run the app. Please request these values as necessary. An example configuration file can be found in config/example-config.json

Once the app is installed, it can be run using

ev-server "/path/to/config.json"

Upon start up, a message similar to this should be displayed:

[NATS] Connecting to <NATS url>
[NATS Connection] client connected. Creating subscriptions.
[NATS] Listening for asset claim requests and issued claims

Prequalification process

Prequalification request

As an MSP or a CPO, the steps to initiate prequalification of an asset are:

  1. Sign-in to the EV Dashboard
  2. Navigate to the Vehicle or Chargepoints section in the left navigation
  3. Click on one of the vehicles (if an MSP) or chargepoints (if a CPO). This should open the vehicle details box.
  4. Check the checkbox beside "Request Prequalification" then click the "Apply to this vehicle/chargepoint"

When prequalification is initiated by the MSP or CPO using the EV Dashboard, a message is sent over NATS which is a trigger for the asset-operator-server to request prequalification on behalf of an asset. This must be done server side (instead of in the EV Dashboard client) because the asset's private key is held server side.

When a prequalification request message is received, a message similar to this one should be output:

[NATS] Received prequalification REQUEST for: {"did":"did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F"}
[NATS] Queried signer for asset: did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F
[NATS] Requesting prequalification for asset: did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F
[Asset] did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F is requestingPrequalification
[Asset] did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F, retrieving DIDs with role: <prequalification issuer role>
[Asset] did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F is creating claim request {
  issuer: [
    'did:ethr:0x77a0F749058A52A39A25DF9EE7e6D5a5377eC5ce',
    'did:ethr:0x08f1939a94e4155Fb9B81A068800dCbcDe33adA0'
  ],
  claim: '{"fields":[],"claimType":"<prequalification role>","claimTypeVersion":"1.0.0"}'
}
[Asset] did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F claim request created

In addition, several messages such are the ones below may be displayed:

[NATS] Received message on claims exchange.
[NATS] Received message does not contained an issued token
[NATS] Received message on claims exchange.
[NATS] Received message does not contained an issued token
[NATS] Received message on claims exchange.

This is because for each known issuer of the role, a notification is sent.

Prequalification issuance

When the TSO approves the prequalification request and issues the prequalification claim on the EV dashboard, a message is sent over NATS which contains the issued (signed) credential. This credential is received by the server which persists it on IPFS and adds a link to it in the asset's DID document service array. The server also checks for prequalification requests from the cache-server upon startup.

[NATS] Received ISSUED CLAIM: {"id":"adff46b5-5e45-4ae5-9401-c6a538524e71","issuedToken":"<issued jwt>","requester":"did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F","claimIssuer":["<issuer DID>"],"acceptedBy":"<issuer DID>"}
[NATS] Retrieved signer for asset: did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F
[NATS] Publishing claim for asset: did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F
[Asset] did:ethr:0xDE7dF6a331c9244702bB99C22370e3447252629F published claim to DID Document