Energy Web Documentation
  • Energy Web Ecosystem
  • Launchpad by Energy Web
  • EWC Validator Documentation
  • Community Ressources
  • Legacy documentation
  • Welcome to Energy Web
  • Glossary
  • Solutions 2023
    • ↔️Data Exchange
      • Data Exchange Overview
      • Data Exchange Architecture
      • Use Cases and Refrence Implementations
        • Digital Spine for Electricity Markets
          • Digital Spine Integration Client Deployment Guide - from Azure marketplace
        • E-Mobility Management
    • 🔌Open Charging Network
      • Create and Manage an OCN Identity
      • Connect an OCPI/OCN Party to a Node
        • 1. Make your backend service OCN-ready
        • 2. Select an OCN Node and register in OCN Registry
        • 3. Manage your Whitelist and Blacklist
        • 4. Connect your service to an OCN Node
      • Run an OCN Node
      • Use the OCN Service Interface
        • Offer an OCN Service
        • Sign up for an OCN Service
      • Develop on the Test Network
      • Develop on the Production Network
      • Open Source Development
        • Maturity Model, Feature Roadmap and Releases
        • Developer Community Calls
      • E-Mobility Dashboard v0.1
  • EW-DOS Technology Components 2023
    • EW-DOS Overview
    • Worker Nodes
      • Worker Node Process Diagrams
      • Worker Node Architecture
      • Worker Node Guides
        • Deploy Worker Nodes
        • Customize Worker Logic
    • Identity and Access Management (IAM)
      • IAM Guides
        • Implement an SSI Hub instance
        • Verifiable Credential API
        • Sign-In with Ethereum
        • Using Switchboard
          • Switchboard Transaction Cost Estimates
      • IAM Patterns
        • Assets as Ownable Smart Contracts
        • Credential Lifecycle
        • Credential Metadata
        • SSI Credential Governance using ENS Domains
      • IAM Libraries
      • SSI Hub
      • Switchboard Application
    • Decentralized Data Hub (DDHub)
      • DDHub Message Broker
      • DDHub Client Gateway
      • DDHub Patterns
        • Channels and Topics
      • DDHub Guides
    • Green Proofs Contracts
    • Energy Web X
    • The Energy Web Chain
      • EWC Overview
      • System Architecture
        • Proof-of-Authority Consensus Mechanism
        • System Contracts
          • Name Registry
          • Holding Contract
          • Block Reward Contract
          • Validator-Set Contracts
        • Validator Node Architecture
      • Energy Web Block Explorer
      • Validator Node Installation Specifications
        • Volta Test Network: Validator Node Installation
      • Energy Web Chain Governance
      • EWC Guides and Tutorials
        • Getting started with Energy Web Chain
        • Developing on the Volta Test Network and Main Network (Energy Web Chain)
        • Run a Local RPC Node
          • Run RPC Node using Nethermind client
        • Deploy a Smart Contract on Volta with Remix
        • Interacting with Smart Contracts in EW-DOS
        • Set up MetaMask to interact with Energy Web Chain
        • Using the Ethereum Name Service
        • Using Oracles
      • Energy Web Token (EWT)
  • 🧠Foundational Concepts
    • Open-Source Software
    • Scaling Access to Grid Flexibility
    • Facilitating Clean Energy Purchases
    • Ethereum
      • Transactions and Transaction Costs
    • Self-Sovereign-Identity
      • Self-Sovereign Use Case Interaction
    • Cryptocurrency Wallets
      • Software cryptocurrency wallets
        • Metamask
        • Mycrypto wallet
      • Hardware cryptocurrency wallets
      • Hierarchical Deterministic (HD) Wallets
Powered by GitBook
On this page
  • Contents
  • 1. Prerequisite Check
  • 2. Resource Provisioning.
  • 3. Client UI walk through.
  • 4. Creating Channels.
  • 5. Demo Integration - test Sending / Receiving data.
  • 6. Conclusion
Export as PDF
  1. Solutions 2023
  2. Data Exchange
  3. Use Cases and Refrence Implementations
  4. Digital Spine for Electricity Markets

Digital Spine Integration Client Deployment Guide - from Azure marketplace

This guide demonstrates how to launch a Digital Spine Integration Client (DSI Client) instance from App ‘Digital Spine Integration Client by EnergyWeb’ on the Azure marketplace.

PreviousDigital Spine for Electricity MarketsNextE-Mobility Management

Last updated 1 year ago

The public Digital Spine Integration Client and associated message broker service is currently offered free of charge for Energy Web Member organizations and on a free trial basis for non-members. Please note that the message broker is rate-limited in the free version, and thus may not be suitable for high volume / high frequency data exchange use cases. For assistance in configuring a custom DSI Client and Message Broker solution for your organization, please fill out this .

Things to know before you start:

  • Each section of this guide is demonstrated in a short video clip and accompanied with step by step instructions.

  • Integration and identity access management (IAM) for the DSI Client is performed with Energy Web's (i.e ). To manage your DID you will need a and , with a minimum balance of 0.1 EWT, to execute IAM transactions in the Switchboard application including requesting roles and publishing credentials to your DID document. You can read more about .

    • NOTE: Sending and receiving messages via the DSI Client Gateway does not directly use or interact with the Energy Web Chain; you do NOT need EWT to send and receive messages. EWT is required only for the IAM and enrollment processes.

  • You need an active subscription to access the . Additional cloud providers and self-hosted options will be available later in 2023.

  • You will need access to one of the following Secret Engines, with full Read & Write privileges required:

- Azure KeyVault (Vault URI, Service principle’s appId, password, tenantid)

- Hashicorp Vault (Vault URI, access token)

Contents

1. Prerequisite Check

1.1. Configure MetaMask settings

We recommend using Chrome (or Chromium-based, e.g. Brave) or Firefox desktop browsers to interact with the Switchboard dApp. To download MetaMask plugin to your browser, you can use the links below;

Go to Settings > Networks and click Add Network button to add Energy Web Chain. Enter the details below to add Energy Web Chain as a new network.

Network Name

Energy Web Chain

New RPC URL

Chain ID

246

Currency Symbol (optional)

EWT

Block Explorer URL (optional)

  • Select Energy Web Chain from the dropdown (by default, the Ethereum Mainnet will be selected) before navigating to the Switchboard dApp homepage.

1.1.a Funding Account

1.2. Secret Engine credentials

Azure KeyVault

Suppose you have a role-based-access-control service principle (sp) created, which is granted full Read and Write permissions to the KeyVault, your sp details may look like

{
 “appId”: “32xxx725-7xx9-46d1-b288-c552xxxxxab35",
 “displayName”: “vault-demo-sp”,
 “password”: “SLxxQ~2ul1J~4wxxNZ-o~sb65l4KuNhxxXaK9c4j”,
 “tenant”: “14e3fxx-fd1f-4exx9-a2aa-4a9xxxxxxx129"
}

You will need above details and the KeyVault uri on the resource creation page.

Learn more about

Hashicorp Vault

You just need

  • vault server url

  • The access token

2. Resource Provisioning.

2.1 Launching Digital Spine Integration Client instance

Login to Azure portal and go to ‘Marketplace’ page.

On the marketplace page, search ‘energyweb’ in the search box as shown below:

You will see the ‘Digital Spine Integration Client by EnergyWeb’ in the search results.

Click ‘Create’ on the Offer tile. It will take you to the resource creation page.

Follow the user guide on the UI to fill in the required fields for ‘Basics’ and ‘Virtual Machine Settings’.

On the ‘Digital Spine Integration Client Settings’ tab, you can set the configuration for the DSI Client.

Most configurations are pre populated, you just need to select the desired application to integrate with from the `Application Name` dropdown .

There are 3 applications to choose from

  • Global Data Exchange

  • Greenproofs

  • Open Charging Network

At the 'Vault Configuration' put in the secret engine details, below is the example for KeyVault.

The VM you are creating must have access to the chosen Secret Engine from a network perspective.

Once all the required fields have been filled. You can proceed to ‘Review + create’ tab, you can double check all the inputs. Then click ‘Create’ to start creating the resources.

After a couple of minutes, the resource creation will complete. You'll find a Virtual Machine under the resource group.

On the VM’s overview page like below, the Digital Spine Integration Client can be accessed at the VM’s DNS in the browser.

2.2 Config DSI Client.

2.2.a Visit Client Application

Open a browser and type in the DSI VM’s DNS; you will be directed to the DSI Client landing page as shown below:

2.3 Configure DID on the DSI Client

  • NOTE: Sending and receiving messages via the DSI Client Gateway does not directly use or interact with the Energy Web Chain; you do NOT need EWT to send and receive messages. EWT is required only for the IAM and enrollment processes.

The DID will be the public address of the account you are using with your Digital Wallet and MetaMask.

The Energy Web team will review the enrollment request and grant approval within one business day of receipt.

On DSI Client landing page, enter the private key for your DID you will use for enrollment (note: the wallet address will be the DID) and hit ‘Import’.

To extract your private key for your Metamask account:

  1. Click on the Account list dropdown, then click the kebab / three dot icon next to the account, then click 'Account Details'.

  2. That will display a QR code with the Account address, and a button to "Show private key"; click that button and enter your password when prompted to reveal the private key.

  3. Copy the private key and enter it into the form field in the DSI Client landing page.

Entering your private key at this step is a one-time configuration that is necessary to assign your DID to the DSI Client. When you enter the key in this step, it will be securely stored in the secret engine of your choice (i.e. Azure Key Vault or Hashicorp Vault). Energy Web will not have access to your key, and we will never ask you for it.

Be careful to never reveal, share, or paste your private key in any other steps within the DSI configuration and enrollment process.

You'll need to have a sufficient balance of EWT in your wallet to pay for gas fees associated with DID enrollment transactions in order to proceed; a minimum balance of 0.1 EWT is recommended. REMINDER: You will only need to pay transaction costs for the IAM and enrollment processes.

Once you have a sufficient balance of EWT to cover the transaction cost, the application will proceed to the next stage of access validation.

2.4 Enroll the DSI Client with DID

To proceed, click ‘Enroll’ to submit the enrollment request.

The Energy Web team will review the enrollment request and grant approval within one business day of receipt.

When the user role for your selected application is approved, you will see the status is changed to ‘waiting for role to sync’.

2.5 Manually sync role on Switchboard (dApp)

After submitting the enrollment request for your DID, the Energy Web team will contact you via email to notify you of approval. Upon receipt of the approval email, you can publish the newly issued role(s) to your DID document by following the instructions below.

The MetaMask plug-in will pop up in the top right corner of the browser and request a signature to log in.

  • If you are logging in with a MetaMask account, you will be prompted to sign the message in the MetaMask Extension.

  • If you are logging in with a hardware wallet account (via MetaMask), you will also be prompted to connect to your hardware wallet and sign the message on that device.

After providing the signature, you will be logged in into Switchboard dApp.

The top right menu icon has a notification. Click to open, you will find one publication available.

Click ‘publish’, on the confirmation modal click ‘CONFIRM’.

The MetaMask plug-in will pop up in the top right corner of the browser and request a signature for the transaction.

Follow along to sign the transaction in Metamask, then you'll see the ‘publish is successful ‘ notification.

When the publish is completed, you can return to the the DSI Client browser tab.

3. Client UI walk through.

This guide is based on the application name ‘marketplace.apps.energyweb.iam.ewc’, It is the same concept and flow for your chosen application

You may see fewer items under the ‘Scheduler’ section at the first time you log in. Just wait a few moments and refresh the page, there should be more scheduled tasks shown, the time under the task names is when the task was recently completed

When you can see ‘Application refresh’ and ‘Topic Refresh’ with ‘Success’ status, you can navigate to ‘Topic management’ OR ‘Channels’ > ‘My apps and topics’ from the left navigation menu.

Your application will be shown on the list. There is one sample topic created for the application (*one is available at the time of writing, but additional topics will be added over time. You may see more topics available for your application).

If you click on the application, it will show you all the topics

You can also view the topic by clicking on it

Topic is a definition of the data schema. Which will be strictly validated during data exchanging.

Next we'll explain how to use the topic.

The DSI Client lets you easily create more sophisticated topics based on different business requirements.

You will need the ‘topiccreator’ role to manage(create/update/delete) topic/schema within an application scope.

4. Creating Channels.

  • "Publish" type channel is for sending data and "Subscribe" type channel is used for retrieving data

  • Channels can be configured to enable one:one, one:many, and/or many:many communications by changing settings for who can receive or send data in the channel scope

  • Topics are used by channels, and it defines what kind of data can be send/retrieved to/from a channel, A channel can have multiple different topics

On the UI, from the left navigation menu, under ‘Channels’, navigate to the ‘Channel management’. Here is the section you manage all your channels

4.1 Creating a Publish Channel

To create a channel, simply click ‘Create’ on the page.

In the pop-up modal, you can define the channel details.

The example below shows creating a ‘Messaging’ Publish channel named ‘demo.pub’; when you have defined your channel details click ‘Next’,

At the ‘Restrictions’ tab, you are able to restrict the recipients by `DID` or ‘Role’, this will make sure only defined recipients will receive messages from this channel.

In Energy Web ecosystem, DIDS and Roles have below format

  • EW main chain DID format: `did:ethr:ewc:WALLET_ADDRESS`

  • EW volta chain DID format: `did:ethr:volta:WALLET_ADDRESS`

  • EW role format: `ROLE_NAME.roles.APP_NAME`

Make sure you click the ‘Save’ button after you put in the recipient DID or Role. To add multiple recipients, repeat this step as necessary.

To proceed to the next step, click “Next”.

On the next screen, you will define what topics to add to this channel.

You can select your desired application from the ‘Select Application’ dropdown, then the available topics belonging to the application will be shown in the ‘topics’ dropdown, click on the topic to add, you can select multiple topics to this channel.

At the last step you can review all the channel details; if you need to revise any settings, click back. When you have confirmed all settings, click "submit" to create the channel.

After clicking ‘submit’, The channel will be shown on the channel list.

A ‘Publish’ channel is used to send data to other recipients. You will need a separate ‘Subscribe’ channel to receive data from others. You can create as many channels as necessary by following the above steps.

4.2 Creating a Subscribe Channel

Creating a ‘Subscribe’ channel is exactly the same process as 'Publish' channel, but selecting the channel type ‘Subscribe’

And at the ‘Restrictions’ section, we can restrict whom we only want to receive data from.

For demonstration purposes, we restrict to only receive data from senders who has role ‘‘admin.roles.marketplace.energyweb.iam.ewc’

On the Topics tab, same concept as above publish channel, here we restrict what kind of data we want to retrieve from this channel.

And review all the details and submit our ‘Subscribe’ channel.

We should have both channels shown under ‘Channel management’

This is all about channel creating and how to implement a topic.

5. Demo Integration - test Sending / Receiving data.

The above video demonstrates client A (DID ends 49Cc9) sends a message by API to client B (DID ends 64946), and client B successfully retrieved the message by API.

The Digital Spine Integration Client has an API swagger page, which shows you the list of endpoints available for integration.

You can access the swagger integration APIs page from ‘Integration APIs’ from the left side nav.

Click ‘Open’ Rest API.

On the swagger page, scroll down to the ‘Messaging’ section

You can find detailed information about how to integrate with those endpoints.

5.1 Example Post data to a Channel

To post a message to the newly created ‘demo.pub’ channel, the example payload will be formatted as shown below:

{
    "fqcn": "demo.pub",
    "topicName": "sample_topic",
    "topicVersion": "0.0.1",
    "topicOwner": "marketplace.apps.energyweb.iam.ewc",
    "payload": "{ \"message\": \"This is my first demo message\" }"
}

You can POST above payload to the D.S.I Client’s endpoint `/api/v2/messages`

You can get all the payload info from the channel details on the D.S.I Client’s UI, click to open the 'demo.pub' channel from the channel list under ‘Channels’ > ‘Channel management’

Here are the channel and topic details

So payload info has below relationship with what is shown on the channel detail and topic detail modals.

Payload field
UI label
Value

fqcn

Namespace on Channel details

demo.pub

topicName

Topic Name

sample_topic

topicVersion

Version on Topic details

0.0.1

topicOwner

Namespace on Topic details

marketplace.apps.energyweb.iam.ewc

5.2 Example Get data from a Channel

To receive data from a channel, by following the documentation, You can retrieve data from GET endpoint '/api/v2/messages'

An example request path can be /api/v2/messages?fqcn=demo.sub&amount=10&topicName=sample_topic&topicOwner=marketplace.apps.energyweb.iam.ewc&clientId=demo_user

Query breakdown will be

  • fqcn = demo.sub

  • amount = 10

  • topicName = sample_topic

  • topicOwner = marketplace.apps.energyweb.iam.ewc

  • clientId = demo_user

6. Conclusion

Those are the main steps to get you started with the Digital Spine Integration interface, You can start communicating with other DSI clients integrated with the same application.

To integrate the DSI Client with the Energy Web-hosted message broker, you will need to acquire and manage roles on Switchboard (). is used to log into the and sign transactions.

Firefox:

Chrome (or Chromium-based):

You can also use ChainList to quickly add Energy Web Chain as a new network to your MetaMask. To use this tool, please follow this and click “Add to MetaMask” button.

The Switchboard dApp does require users to use in order send transactions, sign messages or acquire credentials on the .

To learn how to acquire EWT in your wallet, click

Digital spine integration client app

If you want to run any other applications, you need to make sure the application is available on the EWC chain. Or feel free to contact for assistance (responses are within 1-2 business days)

If you are an Energy Web member organization, you can also use the channel #digital_spine.

Reminder: Integration and identity access management (IAM) for the DSI Client is performed with Energy Web's (i.e ). To manage your DID you will need a and , with a minimum balance of 0.1 EWT, to execute IAM transactions in the Switchboard application including requesting roles and publishing credentials to your DID document. You can read more about .

You will need to acquire the role of 'user' on your DID in order to enroll your DSI Client to the public message broker. Please complete for approval.

It can take up to a minute for the DID to be verified and configured (assuming that your DID already has the role 'user'; if not, complete the ).

If your wallet does not have sufficient balance (a minimum of 0.1 EWT is recommended) you may receive an ‘insufficient fund’ error message. To learn about transactions and transactions costs, click ; to learn how to acquire EWT in your wallet, click .

If your DID doesn't have the required 'user' role to the application you selected for the Integration Client at . You'll see an ‘Unauthorized’ error.

Please complete for approval.

In this guide, we use Metamask, it is the same process for other wallet option to logon dApp Switchboard. Make sure you have .

In a new browser tab, visit Switchboard (), click on the Use MetaMask button on the welcome screen of the Switchboard dApp to log in.

At the time of revisiting the DSI Client, it should successfully redirect you to the dashboard page. If not, check to make sure your Metamask extension is connected to the correct (enrolled) account. If the correct account is active, you may need to refresh the DSI Client landing page and re-enter your private key as described in the previous .

You can learn more about topics

Please contact for ‘topiccreator’ role enrolment or other assistances.

You can have a better understanding about Digital Spine channels . Few summarised Key points to bear in mind.

demo.pub channel details modal
sample_topic details

The query information can also be retrieved from the channel detail as explained in .

And contact us at to acquire the 'topiccreator' role to create topics to test scenarios based on your business requirement.

↔️
https://switchboard.energyweb.org/
Metamask
Switchboard dApp
https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/
https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn
link
Energy Web Tokens (EWT)
Energy Web Chain
here
Azure Key Vault documentation
Azure Service principle
digital-spine.support@energweb.org
Member Slack
self-sovereign identity
technology stack
DIDs and verifiable credentials
Digital Wallet
Metamask
Switchboard and IAM processes here
this enrollment form
enrollment form here
here
here
this enrollment form
https://switchboard.energyweb.org/
here
digital-spine.support@energweb.org
here
digital-spine.support@energweb.org
form
self-sovereign identity
technology stack
DIDs and verifiable credentials
Digital Wallet
Metamask
Switchboard and IAM processes here
Azure
DSI Client via the Azure marketplace
Prerequisite Check
Configure MetaMask settings
Secret Engine credentials
Resource Provisioning
Launching Digital Spine Integration Client instance
Config DSI Client
Client UI walk through
Creating Channels
Creating a Publish Channel
Creating a Subscribe Channel
Demo Integration - test Sending / Receiving data
Example Post data to a Channel
Conclusion
resource creation step
Metamask configured
section
the previous step
https://rpc.energyweb.org
https://explorer.energyweb.org/
Access Instance
Config DID on Client application
Access enrolment
Sync enrolment on Switchboard
Application Dashboard
Creating Channels