Azure Blockchain Workbench
Azure Blockchain Workbench
Azure Blockchain Workbench
Azure Blockchain Workbench is a collection of Azure services and capabilities designed to help you create and
deploy blockchain applications to share business processes and data with other organizations. Azure Blockchain
Workbench provides the infrastructure scaffolding for building blockchain applications enabling developers to
focus on creating business logic and smart contracts. It also makes it easier to create blockchain applications by
integrating several Azure services and capabilities to help automate common development tasks.
Next steps
Azure Blockchain Workbench architecture
Azure Blockchain Workbench architecture
10/2/2018 • 7 minutes to read • Edit Online
Azure Blockchain Workbench simplifies blockchain application development by providing a solution using several
Azure components. Blockchain Workbench can be deployed using a solution template in the Azure Marketplace.
The template allows you to pick modules and components to deploy including blockchain stack, type of client
application, and support for IoT integration. Once deployed, Blockchain Workbench provides access to a web app,
iOS app, and Android app.
Client applications
Workbench provides automatically generated client applications for web and mobile (iOS, Android), which can be
used to validate, test, and view blockchain applications. The application interface is dynamically generated based
on smart contract metadata and can accommodate any use case. The client applications deliver a user-facing front
end to the complete blockchain applications generated by Blockchain Workbench. Client applications authenticate
users via Azure Active Directory (Azure AD ) and then present a user experience tailored to the business context of
the smart contract. The user experience enables the creation of new smart contract instances by authorized
individuals and then presents the ability to execute certain types of transactions at appropriate points in the
business process the smart contract represents.
In the web application, authorized users can access the Administrator Console. The console is available to users in
the Administrator group in Azure AD and provides access to the following functionality:
Deploy Microsoft provided smart contracts for popular scenarios. For example, an asset transfer scenario.
Upload and deploy their own smart contracts.
Assign a user access to the smart contract in the context of a specific role.
NOTE
To enable authenticated access to the API, two client applications are registered in Azure Active Directory. Azure Active
Directory requires distinct application registrations each application type (native and web).
Message consumers
Message consumers take messages from Service Bus. The underlying eventing model for message consumers
allows for extensions of additional services and systems. For example, you could add support to populate
CosmosDB or evaluate messages using Azure Streaming Analytics. The following sections describe the message
consumers included in Blockchain Workbench.
Distributed ledger consumer
Distributed ledger technology (DLT) messages contain the metadata for transactions to be written to the
blockchain. The consumer retrieves the messages and pushes the data to a transaction builder, signer, and router.
Database consumer
The database consumer takes messages from Service Bus and pushes the data to an attached database, such as
SQL database.
Storage consumer
The storage consumer takes messages from Service Bus and pushes data to an attached storage. For example,
storing hashed documents in Azure Storage.
DLT watcher
A distributed ledger technology (DLT) watcher monitors events occurring on block chains attached to Blockchain
Workbench. Events reflect information relevant to individuals and systems. For example, the creation of new
contract instances, execution of transactions, and changes of state. The events are captured and sent to the
outbound message broker, so they can be consumed by downstream consumers.
For example, the SQL consumer monitors events, consumes them, and populates the SQL database with the
included values. The copy enables recreation of a replica of on-chain data in an off-chain store.
Azure Storage
Azure Storage is used to store contracts and metadata associated with contracts.
From purchase orders and bills of lading, to images used in the news and medical imagery, to video originating
from a continuum including police body cameras and major motion pictures, documents play a role in many
blockchain-centric scenarios. Documents are not appropriate to place directly on the blockchain.
Blockchain Workbench supports the ability to add documents or other media content with blockchain business
logic. A hash of the document or media content is stored in the blockchain and the actual document or media
content is stored in Azure Storage. The associated transaction information is delivered to the inbound message
broker, packaged up, signed, and routed to the blockchain. This process triggers events, which are shared via the
outbound message broker. The SQL DB consumes this information and sends it to the DB for later querying.
Downstream systems could also consume these events to act as appropriate.
Monitoring
Workbench provides application logging using Application Insights and Azure Monitor. Application Insights is
used to store all logged information from Blockchain Workbench and includes errors, warnings, and successful
operations. Application Insights can be used by developers to debug issues with Blockchain Workbench.
Azure Monitor provides information on the health of the blockchain network.
Next steps
Deploy Azure Blockchain Workbench
Smart contract integration patterns
10/2/2018 • 14 minutes to read • Edit Online
Smart contracts will often represent a business workflow that needs to integrate with external systems and devices.
The requirements of these workflows include a need to initiate transactions on a distributed ledger that include
data from an external system, service, or device. They also need to have external systems react to events
originating from smart contracts on a distributed ledger.
The REST API and messaging integration provide the ability to both send transactions from external systems to
smart contracts included in an Azure Blockchain Workbench application, as well as send event notifications to
external systems based on changes that take place within an application.
For data integration scenarios, Azure Blockchain Workbench includes a set of database views that merge a
combination of transactional data from the blockchain and meta-data about applications and smart contracts.
In addition, some scenarios, such as those related to supply chain or media, may also require the integration of
documents. While Azure Blockchain Workbench does not provide API calls for handling documents directly,
documents can be incorporated into an Azure Blockchain Application. This section also includes that pattern.
This section includes the patterns identified for implementing each of these types of integrations in your end to end
solutions.
Messaging integration
Messaging integration facilitates interaction with systems, services, and devices where an interactive login is not
possible or desirable. Messaging integration focuses on two types of messages, those that request that transactions
be executed on a distributed ledger and events that are exposed by that ledger when transactions have taken place.
Messaging integration focuses on the execution and monitoring of transactions related to user creation, contract
creation, and execution of transactions on contracts and is primarily used by headless back-end systems.
This section looks at patterns focused on the aspects of the message-based API that send transactions to a
distributed ledger and those that represent event messages exposed by the underlying distributed ledger.
One -way event delivery from a smart contract to an event consumer
In this scenario, an event occurs within a smart contract, for example, a state change or the execution of a specific
type of transaction. This event is broadcast via an Event Grid to downstream consumers, and those consumers then
take appropriate actions.
An example of this scenario is that when a transaction occurs, a consumer would be alerted and could take action,
such as recording the information in a SQL DB or the Common Data Service. This is the same pattern that
Workbench follows to populate its off chain SQL DB.
Another would be if a smart contract transitions to a particular state, for example when a contract goes into an
OutOfCompliance. When this state change happens, it could trigger an alert to be sent to an administrator's
mobile phone.
This occurs using the process depicted above, where:
The smart contract transitions to a new state and sends an event to the ledger.
The ledger receives and delivers the event to Azure Blockchain Workbench.
Azure Blockchain Workbench is subscribed to events from the ledger and receives the event.
Azure Blockchain Workbench publishes the event to subscribers on the Event Grid.
External systems are subscribed to the Event Grid, consume the message, and take the appropriate action(s).
In this model, the communication to the contract and subsequent state change occurs following the above process
where -
Upon reaching the completion or a specific milestone in the external code execution, an event is sent to the
Service Bus connected to Azure Blockchain Workbench.
For systems that can't be directly adapted to write a message that conforms to the expectations of the API, it
will be transformed.
The content of the message is packaged up and sent to a specific function on the smart contract. This is
done on behalf of the user associated with the external system.
The function executes and typically will modify the state. The change of state moves forward the business
workflow reflected in the smart contract, enabling other functions to now be executed as appropriate.
Delivery of a message in a format unknown to Azure Blockchain Workbench
In this model where a message in a standard format cannot be sent directly, the communication to the contract and
subsequent state change occurs following the above process where:
1. Upon reaching the completion or a specific milestone in the external code execution, an event is sent to the
Service Bus connected to Azure Blockchain Workbench.
2. A Logic App or custom code is used to receive that message and transform it to a standard Azure Blockchain
Workbench formatted message.
3. The Logic App sends the transformed message directly to the Service Bus.
4. Azure Blockchain Workbench is subscribed to events from the Service Bus and retrieves the message.
5. Azure Blockchain Workbench initiates a call to the ledger, sending data from the external system to a specific
contract.
6. The content of the message is packaged up and sent to a specific function on the smart contract. This is done on
behalf of the user associated with the external system.
7. The function executes and typically will modify the state. The change of state moves forward the business
workflow reflected in the smart contract, enabling other functions to now be executed as appropriate.
IoT integration
A common integration scenario is the inclusion of telemetry data retrieved from sensors in a smart contract. Based
on data delivered by sensors, smart contracts could take informed actions and alter the state of the contract.
For example, if a truck delivering medicine had its temperature soar to 110 degrees, it may impact the effectiveness
of the medicine and may cause a public safety issue if not detected and removed from the supply chain. If a driver
accelerated his car to 100 miles per hour, the resulting sensor information could trigger a cancelation of insurance
by his insurance provider. If the car was a rental car, GPS data could indicate when the driver went outside a
geography covered by his rental agreement and charge a penalty.
The challenge is that these sensors can be delivering data on a constant basis and it is not appropriate to send all of
this data to a smart contract. A typical approach is to limit the number of messages sent to the blockchain while
delivering all messages to a secondary store. For example, deliver messages received at only fixed interval, for
example, once per hour, and when a contained value falls outside of an agreed upon range for a smart contract.
Checking values that fall outside of tolerances, ensures that the data relevant to the contracts business logic is
received and executed. Checking the value at the interval confirms that the sensor is still reporting. All data is sent
to a secondary reporting store to enable broader reporting, analytics, and machine learning. For example, while
getting sensor readings for GPS may not be required every minute for a smart contract, they could provide
interesting data to be used in reports or mapping routes.
On the Azure platform, integration with devices is typically done with IoT Hub. IoT Hub provides the ability to
route messages based on content, and enables the type of functionality described above.
The process above depicts a pattern for this is implemented:
A device communicates directly or via a field gateway to IoT Hub.
IoT Hub receives the messages and evaluates the messages against routes established that check the content of
the message, for example. Does the sensor report a temperature greater than 50 degrees?
The IoT Hub sends messages that meet the criteria to a defined Service Bus for the route.
A Logic App or other code listens to the Service Bus that IoT Hub has established for the route.
The Logic App or other code retrieves and transform the message to a known format.
The transformed message, now in a standard format, is sent to the Service Bus for Azure Blockchain
Workbench.
Azure Blockchain Workbench is subscribed to events from the Service Bus and retrieves the message.
Azure Blockchain Workbench initiates a call to the ledger, sending data from the external system to a specific
contract.
Upon receipt of the message, the contract evaluates the data and may change the state based on the outcome of
that evaluation, for example, for a high temperature, change the state to Out of Compliance.
Data integration
In addition to REST and message-based API, Azure Blockchain Workbench also provides access to a SQL DB
populated with application and contract meta-data as well as transactional data from distributed ledgers.
Storage integration
Many scenarios may require the need to incorporate attestable files. For multiple reasons, it will be inappropriate
to put files on a blockchain. Instead, a common approach is to perform a cryptographic hash (for example, SHA-
256) against a file and share that hash on a distributed ledger. Performing the hash again at any future time should
return the same result. If the file is modified, even if just one pixel is modified in an image, the hash will return a
different value.
Azure Blockchain Workbench is deployed using a solution template in the Azure Marketplace. The template
simplifies the deployment of components needed to create blockchain applications. Once deployed, Blockchain
Workbench provides access to client apps to create and manage users and blockchain applications.
For more information about the components of Blockchain Workbench, see Azure Blockchain Workbench
architecture.
4. Provide a Name and Sign-on URL for the application. You can use placeholder values since the values are
changed during the deployment.
SETTING VALUE
"appRoles": [
{
"allowedMemberTypes": [
"User",
"Application"
],
"displayName": "Administrator",
"id": "<A unique GUID>",
"isEnabled": true,
"description": "Blockchain Workbench administrator role allows creation of applications, user to
role assignments, etc.",
"value": "Administrator"
}
],
IMPORTANT
The value Administrator is needed to identify Blockchain Workbench administrators.
Granting permission allows Blockchain Workbench to access users in the directory. The read permission is
required to search and add members to Blockchain Workbench.
Add Graph API key to application
Blockchain Workbench uses Azure AD as the main identity management system for users interacting with
blockchain applications. In order for Blockchain Workbench to access Azure AD and retrieve user information,
such as names and emails, you need to add an access key. Blockchain Workbench uses the key to authenticate with
Azure AD.
1. For the application you registered, select Settings in the registered application details pane.
2. Select Keys.
3. Add a new key by specifying a key description and choosing expires duration value.
SETTING VALUE
Description Service
4. Select Save.
5. Copy the value of the key and store it for later. You need it for deployment.
IMPORTANT
If you don't save the key for the deployment, you will need to generate a new key. You can't retrieve the key value
from the portal later.
Get application ID
The application ID and tenant information are required for deployment. Collect and store the information for use
during deployment.
1. For the application you registered, select Settings > Properties.
2. In the Properties pane, copy and store the following values for later use during deployment.
Resource prefix Short unique identifier for your deployment. This value is
used as a base for naming resources.
VM user name The user name is used as administrator for all virtual
machines (VM).
Authentication type Select if you want to use a password or key for connecting
to VMs.
Database password / Confirm database password Specify the password to use for access to the database
created as part of the deployment.
Subscription Specify the Azure Subscription you wish to use for your
deployment.
Domain Name Use the Azure AD tenant collected in the Get tenant
domain name prerequisite section.
Application Key Use the Application key from the Blockchain client app
registration collected in the Add Graph API key to
application prerequisite section.
SETTING DESCRIPTION
Number of blockchain nodes Choose the number of Ethereum PoA validator nodes to
be deployed in your network.
Virtual machine size Choose the preferred VM size for your blockchain
network.
SETTING DESCRIPTION
Ethereum RPC Endpoint Provide the RPC endpoint of an existing PoA blockchain
network. The endpoint starts with http:// and ends with a
port number. For example,
http://contoso-chain.onmicrosoft.com:8545
Virtual machine size Choose the preferred VM size for your blockchain
network.
SETTING DESCRIPTION
SETTING DESCRIPTION
Connect to existing Log Analytics instance Choose whether you want to use an existing Log Analytics
instance or create a new one. If using an existing instance,
enter your workspace ID and primary key.
15. Select Create to agree to the terms and deploy your Azure Blockchain Workbench.
The deployment can take up to 90 minutes. You can use the Azure portal to monitor progress. In the newly created
resource group, select Deployments > Overview to see the status of the deployed artifacts.
To associate a custom domain name with Blockchain Workbench, see configuring a custom domain name for a
web app in Azure App Service using Traffic Manager.
Next steps
In this how -to article, you deployed Azure Blockchain Workbench. To learn how to create a blockchain application,
continue to the next how -to article.
Create a blockchain application in Azure Blockchain Workbench
Create a blockchain application in Azure Blockchain
Workbench
10/2/2018 • 9 minutes to read • Edit Online
You can use Azure Blockchain Workbench to create blockchain applications that represent multi-party workflows
defined by configuration and smart contract code.
You learn how to:
Configure a blockchain application
Create a smart contract code file
Add a blockchain application to Blockchain Workbench
Add members to the blockchain application
Prerequisites
A Blockchain Workbench deployment. For more information, see Azure Blockchain Workbench deployment for
details on deployment.
Azure Active Directory users in the tenant associated with Blockchain Workbench. For more information, see
add Azure AD users in Azure Blockchain Workbench.
A Blockchain Workbench administrator account. For more information, see add Blockchain Workbench
administrators in Azure Blockchain Workbench.
Hello, Blockchain!
Let's build a basic application in which a requestor sends a request and a responder send a response to the
request. For example, a request can be, "Hello, how are you?", and the response can be, "I'm great!". Both the
request and the response are recorded on the underlying blockchain.
Follow the steps to create the application files or you can download the sample from GitHub.
Configuration file
Configuration metadata defines the high-level workflows and interaction model of the blockchain application.
Configuration metadata represents the workflow stages and interaction model of the blockchain application.
1. In your favorite editor, create a file named HelloBlockchain.json .
2. Add the following JSON to define the configuration of the blockchain application.
{
"ApplicationName": "HelloBlockchain",
"DisplayName": "Hello, Blockchain!",
"Description": "A simple application to send request and get response",
"ApplicationRoles": [
{
"Name": "Requestor",
"Description": "A person sending a request."
},
{
"Name": "Responder",
"Description": "A person responding to a request"
}
],
],
"Workflows": [
{
"Name": "HelloBlockchain",
"DisplayName": "Request Response",
"Description": "A simple workflow to send a request and receive a response.",
"Initiators": [ "Requestor" ],
"StartState": "Request",
"Properties": [
{
"Name": "State",
"DisplayName": "State",
"Description": "Holds the state of the contract.",
"Type": {
"Name": "state"
}
},
{
"Name": "Requestor",
"DisplayName": "Requestor",
"Description": "A person sending a request.",
"Type": {
"Name": "Requestor"
}
},
{
"Name": "Responder",
"DisplayName": "Responder",
"Description": "A person sending a response.",
"Type": {
"Name": "Responder"
}
},
{
"Name": "RequestMessage",
"DisplayName": "Request Message",
"Description": "A request message.",
"Type": {
"Name": "string"
}
},
{
"Name": "ResponseMessage",
"DisplayName": "Response Message",
"Description": "A response message.",
"Type": {
"Name": "string"
}
}
],
"Constructor": {
"Parameters": [
{
"Name": "message",
"Description": "...",
"DisplayName": "Request Message",
"Type": {
"Name": "string"
}
}
]
},
"Functions": [
{
"Name": "SendRequest",
"DisplayName": "Request",
"Description": "...",
"Parameters": [
{
"Name": "requestMessage",
"Name": "requestMessage",
"Description": "...",
"DisplayName": "Request Message",
"Type": {
"Name": "string"
}
}
]
},
{
"Name": "SendResponse",
"DisplayName": "Response",
"Description": "...",
"Parameters": [
{
"Name": "responseMessage",
"Description": "...",
"DisplayName": "Response Message",
"Type": {
"Name": "string"
}
}
]
}
],
"States": [
{
"Name": "Request",
"DisplayName": "Request",
"Description": "...",
"PercentComplete": 50,
"Value": 0,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": ["Responder"],
"AllowedInstanceRoles": [],
"Description": "...",
"Function": "SendResponse",
"NextStates": [ "Respond" ],
"DisplayName": "Send Response"
}
]
},
{
"Name": "Respond",
"DisplayName": "Respond",
"Description": "...",
"PercentComplete": 90,
"Value": 1,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": ["Requestor"],
"Description": "...",
"Function": "SendRequest",
"NextStates": [ "Request" ],
"DisplayName": "Send Request"
}
]
}
]
}
]
}
Base class
WorkbenchBase base class enables Blockchain Workbench to create and update the contract. The base class is
required for Blockchain Workbench specific smart contract code. Your contract needs to inherit from the
WorkbenchBase base class.
In HelloBlockchain.sol smart contract code file, add the WorkbenchBase class at the beginning of the file.
contract WorkbenchBase {
event WorkbenchContractCreated(string applicationName, string workflowName, address originatingAddress);
event WorkbenchContractUpdated(string applicationName, string workflowName, string action, address
originatingAddress);
Your contract needs to inherit from the WorkbenchBase base class and pass in the parameters
ApplicationName and the workflow Name as defined in the configuration file. In this case, the application name
and workflow name are the same.
State variables
State variables store values of the state for each contract instance. The state variables in your contract must match
the workflow properties defined in the configuration file.
Add the state variables to your contract in your HelloBlockchain.sol smart contract code file.
//Set of States
enum StateType { Request, Respond}
//List of properties
StateType public State;
address public Requestor;
address public Responder;
Constructor
The constructor defines input parameters for a new smart contract instance of a workflow. The constructor is
declared as a function with the same name as the contract. Required parameters for the constructor are defined as
constructor parameters in the configuration file. The number, order, and type of parameters must match in both
files.
In the constructor function, write any business logic you want to perform prior to creating the contract. For
example, initialize the state variables with starting values.
Before exiting the constructor function, call the ContractCreated() function. This function notifies Blockchain
Workbench a contract has been created.
Add the constructor function to your contract in your HelloBlockchain.sol smart contract code file.
// constructor function
function HelloBlockchain(string message) public
{
Requestor = msg.sender;
RequestMessage = message;
State = StateType.Request;
Functions
Functions are the executable units of business logic within a contract. Required parameters for the function are
defined as function parameters in the configuration file. The number, order, and type of parameters must match in
both files. Functions are associated to transitions in a Blockchain Workbench workflow in the configuration file. A
transition is an action performed to move to the next stage of an application's workflow as determined by the
contract.
Write any business logic you want to perform in the function. For example, modifying a state variable's value.
Before exiting the function, call the ContractUpdated() function. The function notifies Blockchain Workbench
contract state has been updated. If you want to undo state changes made in the function, call revert(). Revert
discards state changes made since the last call to ContractUpdated().
1. Add the following functions to your contract in your HelloBlockchain.sol smart contract code file.
// call this function to send a request
function SendRequest(string requestMessage) public
{
if (Requestor != msg.sender)
{
revert();
}
RequestMessage = requestMessage;
State = StateType.Request;
NOTE
You can also create blockchain applications by using the Azure Blockchain Workbench REST API.
Next steps
In this how -to article, you've created a basic request and response application. To learn how to use the application,
continue to the next how -to article.
Using a blockchain application
Manage Users in Azure Blockchain Workbench
10/2/2018 • 3 minutes to read • Edit Online
Azure Blockchain Workbench includes user management for people and organizations that are part of your
consortium.
Prerequisites
A Blockchain Workbench deployment is required. See Azure Blockchain Workbench deployment for details on
deployment.
5. Complete the required fields for the new user. Select Create.
Visit Azure AD documentation for more details on how to manage users within Azure AD.
Members are added to each application. Members can have one or more application roles to initiate
contracts or take actions.
2. To manage members for an application, select an application tile in the Applications pane.
The number of members associated to the selected application is reflected in the members tile.
3. Search for the user's name. Only Azure AD users that exist in the Blockchain Workbench tenant are listed. If
the user is not found, you need to Add Azure AD users.
5. Select Add to add the member with the associated role to the application.
Remove member from application
1. Select the member tile to display a list of the current members.
2. For the user you want to remove, choose Remove from the role drop-down.
Change or add role
1. Select the member tile to display a list of the current members.
2. For the user you want to change, click the drop-down and select the new role.
Next steps
In this how -to article, you have learned how to manage users for Azure Blockchain Workbench. To learn how to
create a blockchain application, continue to the next how -to article.
Create a blockchain application in Azure Blockchain Workbench
Using applications in Azure Blockchain Workbench
10/2/2018 • 2 minutes to read • Edit Online
You can use Blockchain Workbench to create and take actions on contracts. You can also view contract details such
as status and transaction history.
Prerequisites
A Blockchain Workbench deployment. For more information, see Azure Blockchain Workbench deployment for
details on deployment
A deployed blockchain application in Blockchain Workbench. See Create a blockchain application in Azure
Blockchain Workbench
Open the Blockchain Workbench in your browser.
You need to sign in as a member of the Blockchain Workbench. If there are no applications listed, you are a
member of Blockchain Workbench but not a member of any applications. The Blockchain Workbench
administrator can assign members to applications.
3. The New contract pane is displayed. Specify the initial parameters values. Select Create.
The newly created contract is displayed in the list with the other active contracts.
Next steps
How to troubleshoot Azure Blockchain Workbench
Using the Azure Blockchain Workbench REST API
10/2/2018 • 5 minutes to read • Edit Online
Azure Blockchain Workbench REST API provides developers and information workers a way to build rich
integrations to blockchain applications. This document walks you through several key methods of the Workbench
REST API. Consider a scenario where a developer wants to create a custom blockchain client, which allows signed
in users to view and interact with their assigned blockchain applications. The client allows users to view contract
instances and take actions on smart contracts. The client uses the Workbench REST API in the context of the
signed-in user to do the following:
List applications
List workflows for an application
List smart contract instances for a workflow
List available actions for a contract
Execute an action for a contract
The example blockchain applications used in the scenarios, can be downloaded from GitHub.
List applications
Once a user has signed into the blockchain client, the first task is to retrieve all Blockchain Workbench applications
for the user. In this scenario, the user has access to two applications:
1. Asset transfer
2. Refrigerated transportation
Use the Applications GET API:
GET /api/v1/applications
Authorization : Bearer {access token}
The response lists all blockchain applications to which a user has access in Blockchain Workbench. Blockchain
Workbench administrators get all blockchain applications, while non-Workbench administrators get all blockchains
for which they have at least one associated application role or an associated smart contract instance role.
HTTP/1.1 200 OK
Content-type: application/json
{
"nextLink": "/api/v1/applications?skip=2",
"applications": [
{
"id": 1,
"name": "AssetTransfer",
"description": "Allows transfer of assets between a buyer and a seller, with appraisal/inspection
functionality",
"displayName": "Asset Transfer",
"createdByUserId": 1,
"createdDtTm": "2018-04-28T05:59:14.4733333",
"enabled": true,
"applicationRoles": null
},
{
"id": 2,
"name": "RefrigeratedTransportation",
"description": "Application to track end-to-end transportation of perishable goods.",
"displayName": "Refrigerated Transportation",
"createdByUserId": 7,
"createdDtTm": "2018-04-28T18:25:38.71",
"enabled": true,
"applicationRoles": null
}
]
}
GET /api/v1/applications/{applicationId}/workflows
Authorization: Bearer {access token}
Response lists all workflows of the specified blockchain application to which a user has access in Blockchain
Workbench. Blockchain Workbench administrators get all blockchain workflows, while non-Workbench
administrators get all workflows for which they have at least one associated application role or is associated with a
smart contract instance role.
HTTP/1.1 200 OK
Content-type: application/json
{
"nextLink": "/api/v1/applications/1/workflows?skip=1",
"workflows": [
{
"id": 1,
"name": "AssetTransfer",
"description": "Handles the business logic for the asset transfer scenario",
"displayName": "Asset Transfer",
"applicationId": 1,
"constructorId": 1,
"startStateId": 1
}
]
}
GET api/v1/contracts?workflowId={workflowId}
Authorization: Bearer {access token}
Response lists all smart contract instances of the specified workflow. Workbench administrators get all smart
contract instances, while non-Workbench administrators get all smart contract instances for which they have at
least one associated application role or is associated with a smart contract instance role.
HTTP/1.1 200 OK
Content-type: application/json
{
"nextLink": "/api/v1/contracts?skip=3&workflowId=1",
"contracts": [
{
"id": 1,
"provisioningStatus": 2,
"connectionID": 1,
"ledgerIdentifier": "0xbcb6127be062acd37818af290c0e43479a153a1c",
"deployedByUserId": 1,
"workflowId": 1,
"contractCodeId": 1,
"contractProperties": [
{
"workflowPropertyId": 1,
"value": "0"
},
{
"workflowPropertyId": 2,
"value": "My first car"
},
{
"workflowPropertyId": 3,
"value": "54321"
},
{
"workflowPropertyId": 4,
"value": "0"
"value": "0"
},
{
"workflowPropertyId": 5,
"value": "0x0000000000000000000000000000000000000000"
},
{
"workflowPropertyId": 6,
"value": "0x0000000000000000000000000000000000000000"
},
{
"workflowPropertyId": 7,
"value": "0x0000000000000000000000000000000000000000"
},
{
"workflowPropertyId": 8,
"value": "0xd882530eb3d6395e697508287900c7679dbe02d7"
}
],
"transactions": [
{
"id": 1,
"connectionId": 1,
"transactionHash": "0xf3abb829884dc396e03ae9e115a770b230fcf41bb03d39457201449e077080f4",
"blockID": 241,
"from": "0xd882530eb3d6395e697508287900c7679dbe02d7",
"to": null,
"value": 0,
"isAppBuilderTx": true
}
],
"contractActions": [
{
"id": 1,
"userId": 1,
"provisioningStatus": 2,
"timestamp": "2018-04-29T23:41:14.9333333",
"parameters": [
{
"name": "Description",
"value": "My first car"
},
{
"name": "Price",
"value": "54321"
}
],
"workflowFunctionId": 1,
"transactionId": 1,
"workflowStateId": 1
}
]
}
]
}
Response lists all actions to which a user can take given the current state of the specified smart contract instance.
Users get all applicable actions if the user has an associated application role or is associated with a smart contract
instance role for the current state of the specified smart contract instance.
HTTP/1.1 200 OK
Content-type: application/json
{
"nextLink": "/api/v1/contracts/1/actions?skip=2",
"workflowFunctions": [
{
"id": 2,
"name": "Modify",
"description": "Modify the description/price attributes of this asset transfer instance",
"displayName": "Modify",
"parameters": [
{
"id": 1,
"name": "description",
"description": "The new description of the asset",
"displayName": "Description",
"type": {
"id": 2,
"name": "string",
"elementType": null,
"elementTypeId": 0
}
},
{
"id": 2,
"name": "price",
"description": "The new price of the asset",
"displayName": "Price",
"type": {
"id": 3,
"name": "money",
"elementType": null,
"elementTypeId": 0
}
}
],
"workflowId": 1
},
{
"id": 3,
"name": "Terminate",
"description": "Used to cancel this particular instance of asset transfer",
"displayName": "Terminate",
"parameters": [],
"workflowId": 1
}
]
}
POST /api/v1/contracts/{contractId}/actions
Authorization: Bearer {access token}
actionInformation: {
"workflowFunctionId": 2,
"workflowActionParameters": [
{
"name": "description",
"value": "My updated car"
},
{
"name": "price",
"value": "54321"
}
]
}
Users are only able to execute the action given the current state of the specified smart contract instance and the
user's associated application role or smart contract instance role. If the post is successful, an HTTP 200 OK
response is returned with no response body.
HTTP/1.1 200 OK
Content-type: application/json
Next steps
Azure Blockchain Workbench REST API reference
Azure Blockchain Workbench troubleshooting
10/18/2018 • 2 minutes to read • Edit Online
A PowerShell script is available to assist with developer debugging or support. The script generates a summary
and collects detailed logs for troubleshooting. Collected logs include:
Blockchain network, such as Ethereum
Blockchain Workbench microservices
Application Insights
Azure Monitoring (Log Analytics)
You can use the information to determine next steps and determine root cause of issues.
Troubleshooting script
The PowerShell troubleshooting script is available on GitHub. Download a zip file or clone the sample from
GitHub.
What is collected?
The output ZIP file contains the following folder structure:
The summary file gives you a snapshot of the overall state of the application and health of the application. The
summary provides recommended actions, highlights top errors, and metadata about running services.
The Metrics folder contains metrics of various system components over time. For example, the output file
\Details\Workbench\apiMetrics.txt contains a summary of different response codes, and response times
throughout the collection period. The Details folder contains detailed logs for troubleshooting specific issues with
Workbench or the underlying blockchain network. For example, \Details\Workbench\Exceptions.csv contains a list
of the most recent exceptions that have occurred in the system, which is useful for troubleshooting errors with
smart contracts or interactions with the blockchain.
Next steps
Azure Blockchain Workbench architecture
Configure the Azure Blockchain Workbench database
firewall
10/2/2018 • 2 minutes to read • Edit Online
This article shows how to configure a firewall rule using the Azure portal. Firewall rules let external clients or
applications connect to your Azure Blockchain Workbench database.
NOTE
If you only want to add the IP address of your computer, choose + Add client IP.
Next steps
Database views in Azure Blockchain Workbench
Get information about your Azure Blockchain
Workbench database
10/2/2018 • 2 minutes to read • Edit Online
This article shows how to get detailed information about your Azure Blockchain Workbench database.
Overview
Information about applications, workflows, and smart contract execution is provided using database views in the
Blockchain Workbench SQL DB. Developers can use this information when using tools such as Microsoft Excel,
PowerBI, Visual Studio, and SQL Server Management Studio.
Before a developer can connect to the database, they need:
External client access allowed in the database firewall. This article about configuring a database firewall article
explains how to allow access.
The database server name and database name.
The database server name and database name let you connect to the Blockchain Workbench database using your
development or reporting tool.
Next steps
Database views in Azure Blockchain Workbench
View Azure Blockchain Workbench data with
Microsoft Excel
10/2/2018 • 2 minutes to read • Edit Online
You can use Microsoft Excel to view data in Azure Blockchain Workbench's SQL DB. This article provides the steps
you need to:
Connect to the Blockchain Workbench database from Microsoft Excel
Look at Blockchain Workbench database tables and views
Load Blockchain Workbench view data into Excel
NOTE
If you're using the credentials created during the Azure Blockchain Workbench deployment process, the User name is
dbadmin . The Password is the one you created when you deployed the Blockchain Workbench.
Now that you have the data loaded, you can use Excel features to create your own reports using the metadata and
transaction data from the Azure Blockchain Workbench database.
Next steps
Database views in Azure Blockchain Workbench
Using Azure Blockchain Workbench data with
Microsoft Power BI
10/2/2018 • 2 minutes to read • Edit Online
Microsoft Power BI provides the ability to easily generate powerful reports from SQL DB databases using Power
BI Desktop and then publish them to https://www.powerbi.com.
This article contains a step by step walkthrough of how to connect to Azure Blockchain Workbench's SQL
Database from within PowerBI desktop, create a report, and deploy the report to powerbi.com.
Prerequisites
Download PowerBI Desktop.
6. Once connected to the database, the Navigator dialog displays the tables and views available within the
database. The views are designed for reporting and are all prefixed vw.
7. Select the views you wish to include. For demonstration purposes, we include vwContractAction, which
provides details on all of the actions that have taken place on a contract.
You can now create and publish reports as you normally would with Power BI.
Next steps
Database views in Azure Blockchain Workbench
Using Azure Blockchain Workbench data with SQL
Server Management Studio
10/2/2018 • 2 minutes to read • Edit Online
Microsoft SQL Server Management Studio provides the ability to rapidly write and test queries against Azure
Blockhain Workbench's SQL DB. This section contains a step by step walkthrough of how to connect to Azure
Blockchain Workbench's SQL Database from within SQL Server Management Studio.
Prerequisites
Download SQL Server Management Studio.
3. In the Connect to Server dialog, enter the server name and your database credentials.
If you are using the credentials created by the Azure Blockchain Workbench deployment process, the
username will be dbadmin and the password will be the one you provided during deployment.
a. SQL Server Management Studio displays the list of databases, database views, and stored
procedures in the Azure Blockchain Workbench database.
4. To view the data associated with any of the database views, you can automatically generate a select
statement using the following steps.
5. Right click on any of the database views in the Object Explorer.
6. Select Script View as.
7. Choose SELECT to.
8. Select New Query Editor Window.
9. A new query can be created by selecting New Query.
Next steps
Database views in Azure Blockchain Workbench
Azure Blockchain Workbench configuration reference
10/15/2018 • 15 minutes to read • Edit Online
Azure Blockchain Workbench applications are multi-party workflows defined by configuration metadata and smart
contract code. Configuration metadata defines the high-level workflows and interaction model of the blockchain
application. Smart contracts define the business logic of the blockchain application. Workbench uses configuration
and smart contract code to generate blockchain application user experiences.
Configuration metadata specifies the following information for each blockchain application:
Name and description of the blockchain application
Unique roles for users who can act or participate within the blockchain application
One or more workflows. Each workflow acts as a state machine to control the flow of the business logic.
Workflows can be independent or interact with one another.
Each defined workflow specifies the following:
Name and description of the workflow
States of the workflow. Each state is a stage in the business logic's control flow.
Actions to transition to the next state
User roles permitted to initiate each action
Smart contracts that represent business logic in code files
Application
A blockchain application contains configuration metadata, workflows, and user roles who can act or participate
within the application.
Workflows
An application's business logic may be modeled as a state machine where taking an action causes the flow of the
business logic to move from one state to another. A workflow is a collection of such states and actions. Each
workflow consists of one or more smart contracts, which represent the business logic in code files. An executable
contract is an instance of a workflow.
Type
Supported data types.
TYPE DESCRIPTION
array Single level array of type integer, bool, money, or time. Arrays
can be static or dynamic. Use ElementType to specify the
datatype of the elements within the array. See example
configuration.
enum Enumerated set of named values. When using the enum type,
you also specify a list of EnumValues. Each value is limited to
255 characters. Valid value characters include upper and lower
case letters (A-Z, a-z) and numbers (0-9). See example
configuration and use in Solidity.
[ Application Role Name ] Any name specified in application role. Limits users to be of
that role type.
{
"Name": "Quotes",
"Description": "Market quotes",
"DisplayName": "Quotes",
"Type": {
"Name": "array",
"ElementType": {
"Name": "int"
}
}
}
{
"Name": "description",
"Description": "Descriptive text",
"DisplayName": "Description",
"Type": {
"Name": "string"
}
}
Example configuration of type enum
{
"Name": "PropertyType",
"DisplayName": "Property Type",
"Description": "The type of the property",
"Type": {
"Name": "enum",
"EnumValues": ["House", "Townhouse", "Condo", "Land"]
}
}
The list of strings need to match between the configuration and smart contract to be valid and consistent
declarations in Blockchain Workbench.
Assignment example:
PropertyType = PropertyTypeEnum.Townhouse;
Constructor
Defines input parameters for an instance of a workflow.
Constructor example
{
"Parameters": [
{
"Name": "description",
"Description": "The description of this asset",
"DisplayName": "Description",
"Type": {
"Name": "string"
}
},
{
"Name": "price",
"Description": "The price of this asset",
"DisplayName": "Price",
"Type": {
"Name": "money"
}
}
]
}
Functions
Defines functions that can be executed on the workflow.
Functions example
"Functions": [
{
"Name": "Modify",
"DisplayName": "Modify",
"Description": "Modify the description/price attributes of this asset transfer instance",
"Parameters": [
{
"Name": "description",
"Description": "The new description of the asset",
"DisplayName": "Description",
"Type": {
"Name": "string"
}
},
{
"Name": "price",
"Description": "The new price of the asset",
"DisplayName": "Price",
"Type": {
"Name": "money"
}
}
]
},
{
"Name": "Terminate",
"DisplayName": "Terminate",
"Description": "Used to cancel this particular instance of asset transfer",
"Parameters": []
}
]
States
A collection of unique states within a workflow. Each state captures a step in the business logic's control flow.
"States": [
{
"Name": "Active",
"DisplayName": "Active",
"Description": "The initial state of the asset transfer workflow",
"PercentComplete": 20,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancels this instance of asset transfer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate Offer"
},
{
"AllowedRoles": [ "Buyer" ],
"AllowedInstanceRoles": [],
"Description": "Make an offer for this asset",
"Function": "MakeOffer",
"NextStates": [ "OfferPlaced" ],
"DisplayName": "Make Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Modify attributes of this asset transfer instance",
"Function": "Modify",
"NextStates": [ "Active" ],
"DisplayName": "Modify"
}
]
},
{
"Name": "Accepted",
"DisplayName": "Accepted",
"Description": "Asset transfer process is complete",
"PercentComplete": 100,
"Style": "Success",
"Transitions": []
},
{
"Name": "Terminated",
"DisplayName": "Terminated",
"Description": "Asset transfer has been cancelled",
"PercentComplete": 100,
"Style": "Failure",
"Transitions": []
}
]
Transitions
Available actions to the next state. One or more user roles may perform an action at each state, where an action
may transition a state to another state in the workflow.
Transitions example
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancels this instance of asset transfer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate Offer"
},
{
"AllowedRoles": [ "Buyer" ],
"AllowedInstanceRoles": [],
"Description": "Make an offer for this asset",
"Function": "MakeOffer",
"NextStates": [ "OfferPlaced" ],
"DisplayName": "Make Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Modify attributes of this asset transfer instance",
"Function": "Modify",
"NextStates": [ "Active" ],
"DisplayName": "Modify"
}
]
Application roles
Application roles define a set of roles that can be assigned to users who want to act or participate within the
application. Application roles can be used to restrict actions and participation within the blockchain application and
corresponding workflows.
"ApplicationRoles": [
{
"Name": "Appraiser",
"Description": "User that signs off on the asset price"
},
{
"Name": "Buyer",
"Description": "User that places an offer on an asset"
}
]
Identifiers
Identifiers represent a collection of information used to describe workflow properties, constructor, and function
parameters.
Identifiers example
"Properties": [
{
"Name": "State",
"DisplayName": "State",
"Description": "Holds the state of the contract",
"Type": {
"Name": "state"
}
},
{
"Name": "Description",
"DisplayName": "Description",
"Description": "Describes the asset being sold",
"Type": {
"Name": "string"
}
}
]
{
"ApplicationName": "AssetTransfer",
"DisplayName": "Asset Transfer",
"Description": "Allows transfer of assets between a buyer and a seller, with appraisal/inspection
functionality",
"ApplicationRoles": [
{
"Name": "Appraiser",
"Description": "User that signs off on the asset price"
},
{
"Name": "Buyer",
"Description": "User that places an offer on an asset"
},
{
"Name": "Inspector",
"Description": "User that inspects the asset and signs off on inspection"
},
{
"Name": "Owner",
"Description": "User that signs off on the asset price"
}
],
"Workflows": [
{
"Name": "AssetTransfer",
"DisplayName": "Asset Transfer",
"Description": "Handles the business logic for the asset transfer scenario",
"Initiators": [ "Owner" ],
"StartState": "Active",
"Properties": [
{
"Name": "State",
"DisplayName": "State",
"Description": "Holds the state of the contract",
"Type": {
"Name": "state"
}
},
{
"Name": "Description",
"DisplayName": "Description",
"Description": "Describes the asset being sold",
"Type": {
"Name": "string"
}
},
{
"Name": "AskingPrice",
"DisplayName": "Asking Price",
"Description": "The asking price for the asset",
"Type": {
"Name": "money"
}
},
{
"Name": "OfferPrice",
"DisplayName": "Offer Price",
"Description": "The price being offered for the asset",
"Type": {
"Name": "money"
}
},
{
"Name": "InstanceAppraiser",
"DisplayName": "Instance Appraiser",
"Description": "The user that appraises the asset",
"Type": {
"Name": "Appraiser"
}
},
{
"Name": "InstanceBuyer",
"DisplayName": "Instance Buyer",
"Description": "The user that places an offer for this asset",
"Type": {
"Name": "Buyer"
}
},
{
"Name": "InstanceInspector",
"DisplayName": "Instance Inspector",
"Description": "The user that inspects this asset",
"Type": {
"Name": "Inspector"
}
},
{
"Name": "InstanceOwner",
"DisplayName": "Instance Owner",
"Description": "The seller of this particular asset",
"Type": {
"Name": "Owner"
}
}
],
"Constructor": {
"Parameters": [
{
"Name": "description",
"Description": "The description of this asset",
"DisplayName": "Description",
"Type": {
"Name": "string"
}
},
{
"Name": "price",
"Description": "The price of this asset",
"DisplayName": "Price",
"Type": {
"Name": "money"
}
}
]
},
"Functions": [
{
"Name": "Modify",
"DisplayName": "Modify",
"Description": "Modify the description/price attributes of this asset transfer instance",
"Parameters": [
{
"Name": "description",
"Description": "The new description of the asset",
"DisplayName": "Description",
"Type": {
"Name": "string"
}
},
{
"Name": "price",
"Description": "The new price of the asset",
"DisplayName": "Price",
"Type": {
"Name": "money"
}
}
]
},
{
"Name": "Terminate",
"DisplayName": "Terminate",
"Description": "Used to cancel this particular instance of asset transfer",
"Parameters": []
},
{
"Name": "MakeOffer",
"Name": "MakeOffer",
"DisplayName": "Make Offer",
"Description": "Place an offer for this asset",
"Parameters": [
{
"Name": "inspector",
"Description": "Specify a user to inspect this asset",
"DisplayName": "Inspector",
"Type": {
"Name": "Inspector"
}
},
{
"Name": "appraiser",
"Description": "Specify a user to appraise this asset",
"DisplayName": "Appraiser",
"Type": {
"Name": "Appraiser"
}
},
{
"Name": "offerPrice",
"Description": "Specify your offer price for this asset",
"DisplayName": "Offer Price",
"Type": {
"Name": "money"
}
}
]
},
{
"Name": "Reject",
"DisplayName": "Reject",
"Description": "Reject the user's offer",
"Parameters": []
},
{
"Name": "AcceptOffer",
"DisplayName": "Accept Offer",
"Description": "Accept the user's offer",
"Parameters": []
},
{
"Name": "RescindOffer",
"DisplayName": "Rescind Offer",
"Description": "Rescind your placed offer",
"Parameters": []
},
{
"Name": "ModifyOffer",
"DisplayName": "Modify Offer",
"Description": "Modify the price of your placed offer",
"Parameters": [
{
"Name": "offerPrice",
"DisplayName": "Price",
"Type": {
"Name": "money"
}
}
]
},
{
"Name": "Accept",
"DisplayName": "Accept",
"Description": "Accept the inspection/appraisal results",
"Parameters": []
},
{
"Name": "MarkInspected",
"Name": "MarkInspected",
"DisplayName": "Mark Inspected",
"Description": "Mark the asset as inspected",
"Parameters": []
},
{
"Name": "MarkAppraised",
"DisplayName": "Mark Appraised",
"Description": "Mark the asset as appraised",
"Parameters": []
}
],
"States": [
{
"Name": "Active",
"DisplayName": "Active",
"Description": "The initial state of the asset transfer workflow",
"PercentComplete": 20,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancels this instance of asset transfer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate Offer"
},
{
"AllowedRoles": [ "Buyer" ],
"AllowedInstanceRoles": [],
"Description": "Make an offer for this asset",
"Function": "MakeOffer",
"NextStates": [ "OfferPlaced" ],
"DisplayName": "Make Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Modify attributes of this asset transfer instance",
"Function": "Modify",
"NextStates": [ "Active" ],
"DisplayName": "Modify"
}
]
},
{
"Name": "OfferPlaced",
"DisplayName": "Offer Placed",
"Description": "Offer has been placed for the asset",
"PercentComplete": 30,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Accept the proposed offer for the asset",
"Function": "AcceptOffer",
"NextStates": [ "PendingInspection" ],
"DisplayName": "Accept Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the proposed offer for the asset",
"Function": "Reject",
"NextStates": [ "Active" ],
"DisplayName": "Reject"
},
{
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancel this instance of asset transfer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Rescind the offer you previously placed for this asset",
"Function": "RescindOffer",
"NextStates": [ "Active" ],
"DisplayName": "Rescind Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Modify the price that you specified for your offer",
"Function": "ModifyOffer",
"NextStates": [ "OfferPlaced" ],
"DisplayName": "Modify Offer"
}
]
},
{
"Name": "PendingInspection",
"DisplayName": "Pending Inspection",
"Description": "Asset is pending inspection",
"PercentComplete": 40,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the offer",
"Function": "Reject",
"NextStates": [ "Active" ],
"DisplayName": "Reject"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancel the offer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Rescind the offer you placed for this asset",
"Function": "RescindOffer",
"NextStates": [ "Active" ],
"DisplayName": "Rescind Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceInspector" ],
"Description": "Mark this asset as inspected",
"Function": "MarkInspected",
"NextStates": [ "Inspected" ],
"DisplayName": "Mark Inspected"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceAppraiser" ],
"Description": "Mark this asset as appraised",
"Function": "MarkAppraised",
"Function": "MarkAppraised",
"NextStates": [ "Appraised" ],
"DisplayName": "Mark Appraised"
}
]
},
{
"Name": "Inspected",
"DisplayName": "Inspected",
"PercentComplete": 45,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the offer",
"Function": "Reject",
"NextStates": [ "Active" ],
"DisplayName": "Reject"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancel the offer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Rescind the offer you placed for this asset",
"Function": "RescindOffer",
"NextStates": [ "Active" ],
"DisplayName": "Rescind Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceAppraiser" ],
"Description": "Mark this asset as appraised",
"Function": "MarkAppraised",
"NextStates": [ "NotionalAcceptance" ],
"DisplayName": "Mark Appraised"
}
]
},
{
"Name": "Appraised",
"DisplayName": "Appraised",
"Description": "Asset has been appraised, now awaiting inspection",
"PercentComplete": 45,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the offer",
"Function": "Reject",
"NextStates": [ "Active" ],
"DisplayName": "Reject"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancel the offer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Rescind the offer you placed for this asset",
"Function": "RescindOffer",
"NextStates": [ "Active" ],
"DisplayName": "Rescind Offer"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceInspector" ],
"Description": "Mark the asset as inspected",
"Function": "MarkInspected",
"NextStates": [ "NotionalAcceptance" ],
"DisplayName": "Mark Inspected"
}
]
},
{
"Name": "NotionalAcceptance",
"DisplayName": "Notional Acceptance",
"Description": "Asset has been inspected and appraised, awaiting final sign-off from buyer and
seller",
"PercentComplete": 50,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Sign-off on inspection and appraisal",
"Function": "Accept",
"NextStates": [ "SellerAccepted" ],
"DisplayName": "SellerAccept"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the proposed offer for the asset",
"Function": "Reject",
"NextStates": [ "Active" ],
"DisplayName": "Reject"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancel this instance of asset transfer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Sign-off on inspection and appraisal",
"Function": "Accept",
"NextStates": [ "BuyerAccepted" ],
"DisplayName": "BuyerAccept"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Rescind the offer you placed for this asset",
"Function": "RescindOffer",
"NextStates": [ "Active" ],
"DisplayName": "Rescind Offer"
}
]
},
{
"Name": "BuyerAccepted",
"DisplayName": "Buyer Accepted",
"Description": "Buyer has signed-off on inspection and appraisal",
"PercentComplete": 75,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Sign-off on inspection and appraisal",
"Function": "Accept",
"NextStates": [ "SellerAccepted" ],
"DisplayName": "Accept"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the proposed offer for the asset",
"Function": "Reject",
"NextStates": [ "Active" ],
"DisplayName": "Reject"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Cancel this instance of asset transfer",
"Function": "Terminate",
"NextStates": [ "Terminated" ],
"DisplayName": "Terminate"
}
]
},
{
"Name": "SellerAccepted",
"DisplayName": "Seller Accepted",
"Description": "Seller has signed-off on inspection and appraisal",
"PercentComplete": 75,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Sign-off on inspection and appraisal",
"Function": "Accept",
"NextStates": [ "Accepted" ],
"DisplayName": "Accept"
},
{
"AllowedRoles": [],
"AllowedInstanceRoles": [ "InstanceBuyer" ],
"Description": "Rescind the offer you placed for this asset",
"Function": "RescindOffer",
"NextStates": [ "Active" ],
"DisplayName": "Rescind Offer"
}
]
},
{
"Name": "Accepted",
"DisplayName": "Accepted",
"Description": "Asset transfer process is complete",
"PercentComplete": 100,
"Style": "Success",
"Transitions": []
},
{
"Name": "Terminated",
"DisplayName": "Terminated",
"Description": "Asset transfer has been cancelled",
"Description": "Asset transfer has been cancelled",
"PercentComplete": 100,
"Style": "Failure",
"Transitions": []
}
]
}
]
}
Next steps
Azure Blockchain Workbench REST API reference
Database views in Azure Blockchain Workbench
10/2/2018 • 21 minutes to read • Edit Online
Azure Blockchain Workbench delivers data from distributed ledgers to an off-chain SQL DB database. This makes
it possible to use SQL and existing tools, such as SQL Server Management Studio, to interact with blockchain
data.
Azure Blockchain Workbench provides a set of database views that provide access to data that will be helpful
when performing your queries. These views are heavily denormalized to make it easy to quickly get started
building reports, analytics, and otherwise consume blockchain data with existing tools and without having to
retrain database staff.
This section includes an overview of the database views and the data they contain.
NOTE
Any direct usage of database tables found in the database outside of these views, while possible, is not supported.
vwApplication
This view provides details on Applications that have been uploaded to Azure Blockchain Workbench.
vwApplicationRole
This view provides details on the roles that have been defined in Azure Blockchain Workbench applications.
In an Asset Transfer application, for example, roles such as Buyer and Seller roles may be defined.
vwConnectionUser
This view provides details on the connections defined in Azure Blockchain Workbench and the users associated
with them. For each connection, this view contains the following data:
Associated ledger details
Associated user information
vwContract
This view provides details about deployed contracts. For each contract, this view contains the following data:
Associated application definition
Associated workflow definition
Associated ledger implementation for the function
Details for the user who initiated the action
Details related to the blockchain block and transaction
vwContractAction
This view represents the majority of information related to actions taken on contracts and is designed to readily
facilitate common reporting scenarios. For each action taken, this view contains the following data:
Associated application definition
Associated workflow definition
Associated smart contract function and parameter definition
Associated ledger implementation for the function
Specific instance values provided for parameters
Details for the user who initiated the action
Details related to the blockchain block and transaction
vwContractProperty
This view represents the majority of information related to properties associated with a contract and is designed
to readily facilitate common reporting scenarios. For each property taken, this view contains the following data:
Associated application definition
Associated workflow definition
Details for the user who deployed the workflow
Associated smart contract property definition
Specific instance values for properties
Details for the state property of the contract
vwContractState
This view represents the majority of information related to the state of a specific contract and is designed to
readily facilitate common reporting scenarios. Each record in this view contains the following data:
Associated application definition
Associated workflow definition
Details for the user who deployed the workflow
Associated smart contract property definition
Details for the state property of the contract
NAME TYPE CAN BE NULL DESCRIPTION
vwUser
This view provides details on the consortium members that are provisioned to use Azure Blockchain Workbench.
By default, data is populated through the initial provisioning of the user.
vwWorkflow
This view represents the details core workflow metadata as well as the workflow’s functions and parameters.
Designed for reporting, this also contains metadata about the application associated with the workflow. This view
contains data from multiple underlying tables to facilitate reporting on workflows. For each workflow, this view
contains the following data:
Associated application definition
Associated workflow definition
Associated workflow start state information
vwWorkflowProperty
This view represents the properties defined for a workflow. For each property, this view contains the following
data:
Associated application definition
Associated workflow definition
Workflow property details
vwWorkflowState
This view represents the properties associated with a workflow. For each contract, this view contains the following
data:
Associated application definition
Associated workflow definition
Workflow state information
In addition to providing a REST API, Azure Blockchain Workbench also provides messaging-based integration.
Workbench publishes ledger-centric events via Azure Event Grid, enabling downstream consumers to ingest data
or take action based on these events. For those clients that require reliable messaging, Azure Blockchain
Workbench delivers messages to an Azure Service Bus endpoint as well.
Developers have also expressed interest in the ability to have external systems communicate initiate transactions to
create users, create contracts, and update contracts on a ledger. While this functionality is not currently exposed in
public preview, a sample that delivers that capability can be found at http://aka.ms/blockchain-workbench-
integration-sample.
Event notifications
Event notifications can be used to notify users and downstream systems of events that happen in Blockchain
Workbench and the blockchain network it is connected to. Event notifications can be consumed directly in code or
used with tools such as Logic Apps and Flow to trigger flow of data to downstream systems.
See Notification message reference for details of various messages that can be received.
Consuming Event Grid events with Azure Functions
If a user wants to use Event Grid to be notified about events that happen in Blockchain Workbench, you can
consume events from Event Grid by using Azure Functions.
1. Create an Azure Function App in the Azure portal.
2. Create a new function.
3. Locate the template for Event Grid. Basic template code for reading the message is shown. Modify the code as
needed.
4. Save the Function.
5. Select the Event Grid from Blockchain Workbench’s resource group.
Consuming Event Grid events with Logic Apps
1. Create a new Azure Logic App in the Azure portal.
2. When opening the Azure Logic App in the portal, you will be prompted to select a trigger. Select Azure Event
Grid -- When a resource event occurs.
3. When the workflow designer is displayed, you will be prompted to sign in.
4. Select the Subscription. Resource as Microsoft.EventGrid.Topics. Select the Resource Name from the name
of the resource from the Azure Blockchain Workbench resource group.
5. Select the Event Grid from Blockchain Workbench's resource group.
NAME DESCRIPTION
ContractInsertedOrUpdated
Indicates that a request has been made to insert or update a contract on a distributed ledger.
NAME DESCRIPTION
ChainID A unique identifier for the chain associated with the request.
Parameters A list of objects that identify the name, value, and data type of
parameters sent to an action.
UpdateContractAction
Indicates that a request has been made to execution an action on a specific contract on a distributed ledger.
NAME DESCRIPTION
UpdateUserBalance
Indicates that a request has been made to update the user balance on a specific distributed ledger.
NOTE
This message is generated only for those ledgers that require the funding of accounts.
NAME DESCRIPTION
InsertBlock
Message indicates that a request has been made to add a block on a distributed ledger.
NAME DESCRIPTION
ChainId The unique identifier of the chain to which the block was
added.
NAME DESCRIPTION
BlockId The unique identifier for the block inside Azure Blockchain
Workbench.
InsertTransaction
Message provides details on a request to add a transaction on a distributed ledger.
NAME DESCRIPTION
ChainId The unique identifier of the chain to which the block was
added.
BlockId The unique identifier for the block inside Azure Blockchain
Workbench.
AssignContractChainIdentifier
Provides details on the assignment of a chain identifier for a contract. For example, in Ethereum blockchain, the
address of a contract on the ledger.
NAME DESCRIPTION
ContractId This is the unique identifier for the contract inside Azure
Blockchain Workbench.
NAME DESCRIPTION
ContractInputParameter
Contains the name, value and type of a parameter.
NAME DESCRIPTION
ContractProperty
Contains the ID, name, value and type of a property.
NAME DESCRIPTION
Next steps
Smart contract integration patterns
Ethereum proof-of-authority consortium
10/2/2018 • 29 minutes to read • Edit Online
Overview
This solution is designed to make it easier to deploy, configure, and govern a multi-member consortium Proof-of-
authority Ethereum network with minimal Azure and Ethereum knowledge.
With a handful of user inputs and a single-click deployment through the Azure portal, each member can provision
a network footprint, using Microsoft Azure Compute, networking, and storage services across the globe. Each
member's network footprint consists of a set of load-balanced validator nodes with which an application or user
can interact to submit Ethereum transactions.
Concepts
Terminology
Consensus - The act of synchronizing data across the distributed network through block validation and
creation.
Consortium member - An entity that participates in consensus on the Blockchain network.
Admin - An Ethereum account that is used to manage participation for a given consortium member.
Validator - A machine associated with an Ethereum account that participates in consensus on behalf of an
Admin.
Proof-of-authority
For those of you who are new to the blockchain community, the release of this solution is a great opportunity to
learn about the technology in an easy and configurable manner on Azure. Proof-of-work is a Sybil-resistance
mechanism that leverages computation costs to self-regulate the network and allow fair participation. This works
great in anonymous, open blockchain networks where competition for cryptocurrency promotes security on the
network. However, in private/consortium networks the underlying Ether has no value. An alternative protocol,
proof-of-authority, is more suitable for permissioned networks where all consensus participants are known and
reputable. Without the need for mining, Proof-of-authority is more efficient while still retaining Byzantine fault
tolerance.
Consortium governance
Since proof-of-authority relies upon a permissioned list of network authorities to keep the network healthy, it's
important to provide a fair mechanism to make modifications to this permission list. Each deployment comes with
a set of smart-contracts and portal for on-chain governance of this permissioned list. Once a proposed change
reaches a majority vote by consortium members, the change is enacted. This allows new consensus participants to
be added or compromised participants to be removed in a transparent way that encourages an honest network.
Admin account
During the deployment of the proof-of-authority nodes, you will be asked for an Admin Ethereum address. You
may use several different mechanisms to generate and secure this Ethereum account. Once this address is added
as an authority on the network, you can use this account to participate in governance. This admin account will also
be used to delegate consensus participation to the validator nodes that are created as part of this deployment.
Since only the public Ethereum address is used, each admin has the flexibility to secure their private keys in a way
that complies with their desired security model.
Validator node
In the proof-of-authority protocol, validator nodes take the place of traditional miner nodes. Each validator has a
unique Ethereum identity that gets added to a smart-contract permission list. Once a validator is on this list, it can
participate in the block creation process. To learn more about this process, see Parity's documentation on Authority
Round consensus. Each consortium member can provision two or more validator nodes across five regions, for
geo-redundancy. Validator nodes communicate with other validator nodes to come to consensus on the state of the
underlying distributed ledger. To ensure fair participation on the network, each consortium member is prohibited
from using more validators than the first member on the network (if the first member deploys three validators,
each member can only have up to three validators).
Identity store
Since each member will have multiple validator nodes running simultaneously and each node must have a
permissioned identity, it's important that the validators can safely acquire a unique active identity on the network.
To facilitate this, we've built an Identity Store that gets deployed in each member's subscription which securely
holds the generated Ethereum identities. Upon deployment the orchestration container will generate an Ethereum
private key for each validator and store it in Azure Key Vault. Before the parity node starts up, it first acquires a
lease on an unused identity to ensure the identity isn't picked up by another node. The identity is provided to the
client which gives it the authority to start creating blocks. If the hosting VM experiences an outage, the identity
lease will be released, allowing a replacement node to resume its identity in the future.
Bootnode registrar
To enable the ease of connectivity, each member will host a set of connection information at the data API endpoint.
This data includes a list of bootnodes which are provided as peering nodes for the joining member. As part of this
data API, we keep this bootnode list up-to-date
Bring your own operator
Often a consortium member will want to participate in network governance but don't want to operate and
maintain their infrastructure. Unlike traditional systems, having a single operator across the network works against
the decentralized model of blockchain systems. Instead of hiring a centralized intermediary to operate a network,
each consortium member can delegate infrastructure management to the operator of their choosing. This allows a
hybrid model where each member can choose to operate his or her own infrastructure or delegate operation to a
different partner. The delegated operation workflow works as follows:
1. Consortium Member generates an Ethereum address (holds private key)
2. Consortium Member provides public Ethereum address to Operator
3. Operator deploys and configures the PoA validator nodes using our Azure Resource Manager solution
4. Operator provides the RPC and management endpoint to Consortium Member
5. Consortium Member uses their private key to sign a request accepting the validator nodes Operator has
deployed to participate on their behalf
Azure Monitor
This solution also comes with Azure Monitor to track node and network statistics. For application developers, this
provides visibility into the underlying blockchain to track block generation statistics. Network operators can use
Azure Monitor to quickly detect and prevent network outages through infrastructure statistics and queryable logs.
See Service monitoring for more details.
Deployment architecture
Description
This solution can deploy a single or multi-region based multi-member Ethereum consortium network. By default,
the RPC and peering endpoints are accessible over public IP to enable simplified connectivity across subscriptions
and clouds. We recommend leveraging Parity's permissioning contracts for application level access-controls. We
also support networks deployed behind VPNs, which leverage VNet gateways for cross-subscription connectivity.
These deployments are more complex, so it is recommended to start with the public IP model first.
Consortium member overview
Each consortium member deployment includes:
Virtual Machines for running the PoA validators
Azure Load Balancer for distributing RPC, peering, and Governance DApp requests
Azure Key Vault for securing the validator identities
Azure Storage for hosting persistent network information and coordinating leasing
Azure Monitor for aggregating logs and performance statistics
VNet Gateway (optional) for allowing VPN connections across private VNets
We leverage Docker containers for reliability and modularity. We use Azure Container Registry to host and serve
versioned images as part of each deployment. The container images consist of:
Orchestrator
Runs once during deployment
Generates identities and governance contracts
Stores identities in Identity Store
Parity Client
Leases identity from Identity Store
Discovers and connects to peers
EthStats Agent
Collects local logs and stats via RPC and pushes to Azure Monitor
Governance DApp
Web interface for interacting with Governance contracts
How-to guides
Governance DApp
At the heart of proof-of-authority is decentralized governance. The governance DApp is a set of pre-deployed
smart contracts and a web application that are used to govern the authorities on the network. Authorities are
broken up into Admin identities and Validator nodes. Admins have the power to delegate consensus participation
to a set of Validator nodes. Admins also may vote other admins into or out of the network.
Decentralized Governance - Changes in network authorities are administered through on-chain voting by
select administrators.
Validator Delegation - Authorities can manage their validator nodes that are set up in each PoA
deployment.
Auditable Change History - Each change is recorded on the blockchain providing transparency and
auditability.
Getting started with governance
To perform any kind of transactions through the Governance DApp, you will need to leverage an Ethereum wallet.
The most straightforward approach is to use an in-browser wallet such as MetaMask; however, because these are
smart contracts deployed on the network you may also automate your interactions to the Governance contract.
After installing MetaMask, navigate to the Governance DApp in the browser. You can locate the URL in the
deployment confirmation email or through Azure portal in the deployment output. If you don't have an in-browser
wallet installed you will not be able to perform any actions; however, you'll still be able to read the administrator
state.
Becoming an admin
If you are the first member that deployed on the network, then you will automatically become an Admin and your
Parity nodes will be listed as Validators. If you are joining the network, you will need to get voted in as an Admin by
a majority (greater than 50%) of the existing Admin set. If you choose not to become an Admin then your nodes
will still sync and validate the blockchain; however, they will not participate in the block creation process. To start
the voting process to become an Admin, click Nominate and enter your Ethereum address and alias.
Candidates
Selecting the Candidates tab will show you the current set of candidate administrators. Once a Candidate reaches
a majority vote by the current Admins, the Candidate will get promoted to an Admin. To vote on a Candidate, select
the row and click "Vote in" at the top. If you change your mind on a vote, you may select the candidate and click
"Rescind vote".
Admins
The Admins tab will show the current set of Admins and provide you the ability to vote against. Once an Admin
loses more than 50% support, they will be removed as an Admin on the network. Any validator nodes that this
Admin owns will lose validator status and become transaction nodes on the network. An Admin may be removed
for any number of reasons; however, it is up to the consortium to agree on a policy in advance.
Validators
Selecting the Validators tab in the left menu will display the current deployed Parity nodes for this instance and
their current status (Node type). Note that each consortium member will have a different set of validators in this
list, since this view represents the current deployed consortium member. If this is a newly deployed instance and
you have not yet added your validators, you will be shown the option to 'Add Validators'. Selecting this will
automatically choose a regionally-balanced set of Parity nodes and assign them to your validator set. If you have
deployed more nodes than the allowed capacity, the remaining nodes will become transaction nodes on the
network.
The address of each validator is automatically assigned via the identity store in Azure. If a node goes down, it will
relinquish its identity, allowing another node in your deployment to take its place. This ensures that your consensus
participation is highly available.
Consortium name
Any Admin may update the Consortium Name, displayed at the top of the page. Select the gear icon in the top left
to update the Consortium Name.
Account menu
In the top-right is your Ethereum account alias and identicon. If you are an Admin you will have the ability to
update your alias.
Create a new network or join Create a new network or join Create New Join Existing Create New
existing network? a preexisting consortium
network
Authentication type The method to authenticate Password or SSH public key Password
to the virtual machine.
First region First region to deploy the All allowed Azure regions NA
consortium network
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
Second region Second region to deploy the All allowed Azure regions NA
consortium network (Visible
only when number of
regions is selected as 2)
Third region Third region to deploy the All allowed Azure regions NA
consortium network (Visible
only when number of
regions is selected as 3)
Fourth region Fourth region to deploy the All allowed Azure regions NA
consortium network (Visible
only when number of
regions is selected as 4)
Fifth region Fifth region to deploy the All allowed Azure regions NA
consortium network (Visible
only when number of
regions is selected as 5)
Validator node storage The type of managed disk Standard SSD or Premium Standard SSD
performance backing each of the
deployed validator nodes.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
Validator node virtual The virtual machine size Standard A, Standard D, Standard D1 v2
machine size used for validator nodes. Standard D-v2, Standard F
series, Standard DS, and
Standard FS
Public IP (Advanced Options Deploys the network behind Public IP Private VNet Public IP
= Enable) a VNet Gateway and
removes peering access. If
this option is selected, all
members must use a VNet
Gateway for the connection
to be compatible.
Block Gas Limit (Advanced The starting block gas limit Any numeric 50,000,00
Options = Enable) of the network
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
Connect to existing Log Create a new Log Analytics Create new or Join existing Create new
Analytics instance or join an existing
instance
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
Monitor Location(Connect The region where the new All Log Analytics regions NA
to existing Log Analytics= Log Analytics instance will be
Create new) deployed
Summary
Click through the summary blade to review the inputs specified and to run basic pre-deployment validation. Before
deploying you may download the template and parameters.
Review legal and privacy terms and click 'Purchase' to deploy. If the deployment includes VNet Gateways, the
deployment will take up 45 to 50 minutes.
Post deployment
Depl o ym en t o u t pu t
Once the deployment has completed, you'll be able to access the necessary parameters via the confirmation email
or through the Azure portal. In these parameters you'll find:
Ethereum RPC endpoint
Governance Dashboard URL
Azure Monitor URL
Data URL
VNet Gateway Resource ID (optional)
C o n fi r m a t i o n e m a i l
If you provide an email address (Basics Section), an email would be sent to the email address with the deployment
output information.
Port al
Once the deployment has completed successfully and all resources have been provisioned you'll be able to view
the output parameters in your resource group.
1. Locate your resource group in the portal
2. Navigate to Deployments
3. Select the top deployment with the same name as your resource group
4. Select Outputs
Growing the consortium
To expand your consortium, you must first connect the physical network. Using the Public IP -based deployment
this first step is seamless. If deploying behind a VPN, see the section Connecting VNet Gateway to perform the
network connection as part of the new member deployment. Once your deployment completes use the
Governance DApp to become a network Admin.
New member deployment
1. Share the following information with the joining member. This information can be found in your post-
deployment email or in the portal deployment output.
Consortium Data Url
The number of nodes you've deployed
VNet Gateway Resource ID (if using VPN )
2. The deploying member should use the same solution when deploying their network presence with keeping
the following in mind:
Select Join Existing
Choose the same number of validator nodes as the rest of the members on the network to ensure fair
representation
Use the same Ethereum address that was provided in the previous step
Pass in the provided Consortium Data Url on the Ethereum Settings tab
If the rest of the network is behind a VPN, select Private VNet under the advanced section
Connecting VNet gateways
You may ignore this step if you've deployed using the default Public IP settings. In the case of a private network,
the different members are connected via VNet gateway connections. Before a member can join the network and
see transaction traffic, an existing member must perform a final configuration on their VPN gateway to accept the
connection. This means that the Ethereum nodes of the joining member will not run until a connection is
established. It is recommended to create redundant network connections (mesh) into the consortium to reduce
chances of a single point of failure.
After the new member deploys, the existing member must complete the bi-directional connection by setting up a
VNet gateway connection to the new member. To achieve this, existing member will need:
1. The VNet gateway ResourceID of the connecting member (see deployment output)
2. The shared connection key
The existing member must run the following PowerShell script to complete the connection. We recommend using
Azure Cloud Shell located in the top right navigation bar in the portal.
$MyGatewayResourceId = "<EXISTING_MEMBER_RESOURCEID>"
$OtherGatewayResourceId = "<NEW_MEMBER_RESOURCEID]"
$ConnectionName = "Leader2Member"
$SharedKey = "<NEW_MEMBER_KEY>"
## $myGatewayResourceId tells me what subscription I am in, what ResourceGroup and the VNetGatewayName
$splitValue = $MyGatewayResourceId.Split('/')
$MySubscriptionid = $splitValue[2]
$MyResourceGroup = $splitValue[4]
$MyGatewayName = $splitValue[8]
Service monitoring
You can locate your Azure Monitor portal either by following the link in the deployment email or locating the
parameter in the deployment output [OMS_PORTAL_URL ].
The portal will first display high-level network statistics and node overview.
Selecting Node Overview will direct you to a portal to view per-node infrastructure statistics.
Selecting Network Stats will direct you to view Ethereum network statistics.
MinedBlock_CL
| summarize DistinctMiners = dcount(BlockMiner_s) by BlockNumber_d, BlockMiner_s
| where DistinctMiners > 1
G e t a v e r a g e p e e r c o u n t fo r a sp e c i fi e d v a l i d a t o r n o d e a v e r a g e d o v e r 5 m i n u t e b u c k e t s.
let PeerCountRegex = @"Syncing with peers: (\d+) active, (\d+) confirmed, (\d+)";
ParityLog_CL
| where Computer == "vl-devn3lgdm-reg1000001"
| project RawData, TimeGenerated
| where RawData matches regex PeerCountRegex
| extend ActivePeers = extract(PeerCountRegex, 1, RawData, typeof(int))
| summarize avg(ActivePeers) by bin(TimeGenerated, 5m)
SSH access
For security reasons, the SSH port access is denied by a network group security rule by default. To access the
virtual machine instances in the PoA network, you will need to change this rule to "Allow"
1. Start in the Overview section of the deployed resource group from Azure portal.
2. Select the Network Security Group for the region of the VM that you are wanting to access
3. Select the "allow -ssh" rule
Give the profile a unique name and select the Resource Group that was created during the PoA deployment. Click
the "Create" button to deploy.
Once it is deployed, then select the instance in the resource group. The DNS name to access the traffic manager
can be found in the Overview tab
Select the Endpoints tab and click the Add button. Give the endpoint a unique name. Change the Target resource
type to Public IP address. Then select the public IP address of the first region's load balancer.
Repeat for each region in the deployed network. Once the endpoints are in the "enabled" status, they will be
automatically load and region balanced at the DNS name of the traffic manager. You can now use this DNS name
in place of the [CONSORTIUM_DATA_URL ] parameter in other steps of the document.
Data API
Each consortium member hosts the necessary information for others to connect to the network. The existing
member will provide the [CONSORTIUM_DATA_URL ] prior to the member's deployment. Upon deployment, a
joining member will retrieve information from the JSON interface at the following endpoint:
<CONSORTIUM_DATA_URL>/networkinfo
The response will contain information useful for joining members (Genesis block, Validator Set contract ABI,
bootnodes) as well as information useful to the existing member (validator addresses). We encourage use of this
standardization to extend the consortium across cloud providers. This API will return a JSON formatted response
with the following structure:
{
"$id": "",
"type": "object",
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"properties": {
"majorVersion": {
"$id": "/properties/majorVersion",
"type": "integer",
"title": "This schema’s major version",
"default": 0,
"examples": [
0
]
},
"minorVersion": {
"$id": "/properties/minorVersion",
"type": "integer",
"title": "This schema’s minor version",
"default": 0,
"examples": [
0
]
},
"bootnodes": {
"$id": "/properties/bootnodes",
"type": "array",
"items": {
"$id": "/properties/bootnodes/items",
"type": "string",
"title": "This member’s bootnodes",
"default": "",
"examples": [
"enode://a348586f0fb0516c19de75bf54ca930a08f1594b7202020810b72c5f8d90635189d72d8b96f306f08761d576836a6bfce112cf
b6ae6a3330588260f79a3d0ecb@10.1.17.5:30300",
"enode://2d8474289af0bb38e3600a7a481734b2ab19d4eaf719f698fe885fb239f5d33faf217a860b170e2763b67c2f18d91c41272de3
7ac67386f80d1de57a3d58ddf2@10.1.17.4:30300"
]
}
},
"valSetContract": {
"$id": "/properties/valSetContract",
"type": "string",
"title": "The ValidatorSet Contract Source",
"default": "",
"examples": [
"pragma solidity 0.4.21;\n\nimport \"./SafeMath.sol\";\nimport \"./Utils.sol\";\n\ncontract
ValidatorSet …"
]
},
"adminContract": {
"$id": "/properties/adminContract",
"type": "string",
"title": "The AdminSet Contract Source",
"default": "",
"examples": [
"pragma solidity 0.4.21;\nimport \"./SafeMath.sol\";\nimport \"./SimpleValidatorSet.sol\";\nimport
\"./Admin.sol\";\n\ncontract AdminValidatorSet is SimpleValidatorSet { …"
]
},
"adminContractABI": {
"$id": "/properties/adminContractABI",
"type": "string",
"title": "The Admin Contract ABI",
"default": "",
"examples": [
"[{\"constant\":false,\"inputs\":[{\"name\":\"proposedAdminAddress\",\"type\":\"address\"},…"
]
},
"paritySpec": {
"$id": "/properties/paritySpec",
"type": "string",
"title": "The Parity client spec file",
"title": "The Parity client spec file",
"default": "",
"examples": [
"\n{\n \"name\": \"PoA\",\n \"engine\": {\n \"authorityRound\": {\n \"params\": {\n \"stepDuration\":
\"2\",\n \"validators\" : {\n \"safeContract\": \"0x0000000000000000000000000000000000000006\"\n },\n
\"gasLimitBoundDivisor\": \"0x400\",\n \"maximumExtraDataSize\": \"0x2A\",\n \"minGasLimit\": \"0x2FAF080\",\n
\"networkID\" : \"0x9a2112\"\n }\n }\n },\n \"params\": {\n \"gasLimitBoundDivisor\": \"0x400\",\n
\"maximumExtraDataSize\": \"0x2A\",\n \"minGasLimit\": \"0x2FAF080\",\n \"networkID\" : \"0x9a2112\",\n
\"wasmActivationTransition\": \"0x0\"\n },\n \"genesis\": {\n \"seal\": {\n \"authorityRound\": {\n \"step\":
\"0x0\",\n \"signature\":
\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000\"\n }\n },\n \"difficulty\": \"0x20000\",\n \"gasLimit\": \"0x2FAF080\"\n },\n
\"accounts\": {\n \"0x0000000000000000000000000000000000000001\": { \"balance\": \"1\", \"builtin\": {
\"name\": \"ecrecover\", \"pricing\": { \"linear\": { \"base\": 3000, \"word\": 0 } } } },\n
\"0x0000000000000000000000000000000000000002\": { \"balance\": \"1\", \"builtin\": { \"name\": \"sha256\",
\"pricing\": { \"linear\": { \"base\": 60, \"word\": 12 } } } },\n
\"0x0000000000000000000000000000000000000003\": { \"balance\": \"1\", \"builtin\": { \"name\": \"ripemd160\",
\"pricing\": { \"linear\": { \"base\": 600, \"word\": 120 } } } },\n
\"0x0000000000000000000000000000000000000004\": { \"balance\": \"1\", \"builtin\": { \"name\": \"identity\",
\"pricing\": { \"linear\": { \"base\": 15, \"word\": 3 } } } },\n
\"0x0000000000000000000000000000000000000006\": { \"balance\": \"0\", \"constructor\" : \"…\" }\n }\n}"
]
},
"errorMessage": {
"$id": "/properties/errorMessage",
"type": "string",
"title": "Error message",
"default": "",
"examples": [
""
]
},
"addressList": {
"$id": "/properties/addressList",
"type": "object",
"properties": {
"addresses": {
"$id": "/properties/addressList/properties/addresses",
"type": "array",
"items": {
"$id": "/properties/addressList/properties/addresses/items",
"type": "string",
"title": "This member’s validator addresses",
"default": "",
"examples": [
"0x00a3cff0dccc0ecb6ae0461045e0e467cff4805f",
"0x009ce13a7b2532cbd89b2d28cecd75f7cc8c0727"
]
}
}
}
}
}
}
Tutorials
Programmatically interacting with a smart contract
WARNING
Never send your Ethereum private key over the network! Ensure that each transaction is signed locally first and the signed
transaction is sent over the network.
In the following example, we use ethereumjs-wallet to generate an Ethereum address, ethereumjs-tx to sign locally,
and web3 to send the raw transaction to the Ethereum RPC endpoint.
We'll use this simple Hello-World smart contract for this example:
This example assumes the contract is already deployed. You can use solc and web3 for deploying a contract
programmatically. First install the following node modules:
tx.sign(privateKey);
npm init
In truffle.js, add following code to unlock your MetaMask account and configure the PoA node as entry point by
providing the mnemonic phrase (MetaMask / Settings / Reveal Seed Words)
var HDWalletProvider = require("truffle-hdwallet-provider");
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
poa: {
provider: new HDWalletProvider(mnemonic, rpc_endpoint),
network_id: 3,
gasPrice : 0
}
}
};
Reference
FAQ
I notice there are many transactions on the network that I didn't send. Where are these coming from?
It is insecure to unlock the personal API. Bots listen for unlocked Ethereum accounts and attempt to drain the
funds. The bot assumes these accounts contain real-ether and attempt to be the first to siphon the balance. Do not
enable the personal API on the network. Instead pre-sign the transactions either manually using a wallet like
MetaMask or programmatically as outlined in the section Programmatically Interacting with a Smart Contract.
How to SSH onto a VM?
The SSH port is not exposed for security reasons. Follow this guide to enable the SSH port.
How do I set up an audit member or transaction nodes?
Transaction nodes are a set of Parity clients that are peered with the network but are not participating in consensus.
These nodes can still be used to submit Ethereum transactions and read the smart contract state. This works well as
a mechanism for providing auditability to non-authority consortium members on the network. To achieve this
simply follow Step 2 from Growing the Consortium.
Why are MetaMask transactions taking a long time?
To ensure transactions are received in the correct order, each Ethereum transaction comes with an incrementing
nonce. If you've used an account in MetaMask on a different network, you'll need to reset the nonce value. Click on
the settings icon (3-bars), Settings, Reset Account. The transaction history will be cleared and now you can
resubmit the transaction.
Do I need to specify gas fee in MetaMask?
Ether doesn't serve a purpose in proof-of-authority consortium. Hence there is no need to specify gas fee when
submitting transactions in MetaMask.
What should I do if my deployment fails due to failure to provision Azure OMS?
Monitoring is an optional feature. In some rare cases where your deployment fails because of inability to
successfully provision Azure Monitor resource you can redeploy without Azure Monitor.
Are public IP deployments compatible with private network deployments?
No, peering requires two-way communication so the entire network must either be public or private.
What is the expected transaction throughput of Proof-of-Authority?
The transaction throughput will be highly dependent upon the types of transactions and the network topology.
Using simple transactions, we've benchmarked an average of 400 transactions per second with a network deployed
across multiple regions.
How do I subscribe to smart contract events?
Ethereum Proof-of-Authority now supports web-sockets. Check your deployment email or deployment output to
locate the web-socket URL and port.
Next steps
Get started by using the Ethereum Proof-of-Authority Consortium solution.
Ethereum proof-of-work consortium solution template
10/2/2018 • 20 minutes to read • Edit Online
The Ethereum Proof-of-Work Consortium solution template is designed to make it easier and quicker to deploy
and configure a multi-member consortium Ethereum network with minimal Azure and Ethereum knowledge.
With a handful of user inputs and a single-click deployment through the Azure portal, each member can provision
their network footprint, using Microsoft Azure Compute, networking, and storage services across the globe. Each
member's network footprint consists of a set of load-balanced transaction nodes with which an application or user
can interact to submit transactions, a set of mining nodes to record transactions, and a VPN gateway. A subsequent
connection step connects the gateways to create a fully configured multi-member blockchain network.
About blockchain
For those of you who are new to the blockchain community, the release of this solution is a great opportunity to
learn about the technology in an easy and configurable manner on Azure. However, to get started, we recommend
deploying the simpler standalone Ethereum network topology with this guided walkthrough, before building out
multi-member consortium networks.
Mining node details
Nodes that mine transactions are separated from the nodes that accept transactions to ensure that the two actions
are not competing for the same resources.
A consortium member can provision up to five regions containing one or more mining nodes, backed by a
managed disk. One or more nodes in the region are configured as a boot node to support dynamic discoverability
of the nodes in the network. Mining nodes communicate with other mining nodes to come to consensus on the
state of the underlying distributed ledger. There is no need for your application to be aware of or communicate with
these nodes. By focusing on private networks, the mining nodes are isolated from inbound public internet traffic to
add a secondary layer of protection. Outbound traffic is allowed, but not to the Ethereum discovery port.
All nodes have a stable version of the Go Ethereum (Geth) client and are configured to be mining nodes. If you did
not supply a custom genesis block, all nodes use the same Ethereum address and key pair that is protected by the
Ethereum account password. The Ethereum passphrase you provided is used to generate the default account
(coinbase) for each mining node. As mining nodes, mine, they collect fees that are added to this account.
The number of mining nodes per consortium member depends on the overall size of the network desired and the
amount of hashing power dedicated to each member. The larger the network, the more nodes that need to be
compromised to gain an unfair advantage. The template supports up to 15 mining nodes per region provisioned
using virtual machine scale sets.
Transaction node details
A consortium member also has a set of load-balanced transaction nodes. These nodes are reachable from outside
the virtual network, so that applications can use these nodes to submit transactions or execute smart contracts
within the blockchain network. All nodes have a stable version of the Go Ethereum (Geth) client and are configured
to maintain a complete copy of the distributed ledger. If a custom genesis block is not provided, these nodes use
the same Ethereum account, protected by the Ethereum account password.
Transaction nodes are load-balanced within an availability set to maintain high availability. The template supports
up to five transaction nodes provisioned using virtual machine scale sets.
Log analytics details
Each deployment also creates a new Log Analytics instance or can join an existing instance. This allows the
monitoring of various performance metrics of each virtual machine that makes up the deployed network.
Deployment architecture
Description
This solution template can deploy single or multi region-based multi member Ethereum consortium network. The
virtual network of each region is connected to other region in a chain topology using the VNET gateways and
connection resources. It also provisions a registrar, which contains required information of all the Miner and
Transaction nodes deployed in each region.
Standalone and consortium leader overview
Create a new network or join Create a new network or join Create New Join Existing Create New
existing network? a pre-existing consortium
network
Authentication type The method to authenticate Password or SSH public key Password
to the virtual machine.
Connect to existing OMS Create a new Log Analytics Create new Join existing Create new Log Analytics
instance or join an existing Location
instance
Existing OMS Workspace Id Workspace ID of the existing Choose the pricing tier for Free Standalone Per Node
instance (Visible if Join the new instance. More Info
Existing is selected) OMS at
Service Tier https://azure.microsoft.com/
pricing/details/log-analytics/
(Visible if Join Existing is
selected)
Deployment regions
Next, under Deployment regions, specify inputs for Number of region(s) to deploy the consortium network
and selection of Azure regions based on the number of regions given. User can deploy in maximum of five regions.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
First region First region to deploy the All allowed Azure regions West US
consortium network
Second region Second region to deploy the All allowed Azure regions East US
consortium network (Visible
only when number of
regions is selected as 2)
Third region Third region to deploy the All allowed Azure regions Central US
consortium network (Visible
only when number of
regions is selected as 3)
Fourth region Fourth region to deploy the All allowed Azure regions East US 2
consortium network (Visible
only when number of
regions is selected as 4)
Fifth region Fifth region to deploy the All allowed Azure regions West US 2
consortium network (Visible
only when number of
regions is selected as 5)
Mining node storage The type of managed disk Standard or Premium Standard
performance backing each of the
deployed mining nodes.
Mining node virtual machine The virtual machine size Standard A, Standard D1v2
size used for mining nodes. Standard D,
Standard D-v2,
Standard F series,
Standard DS,
and Standard FS
Transaction node storage The type of managed disk Standard or Premium Standard
performance backing each of the
deployed transaction nodes.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
Transaction node virtual The virtual machine size Standard A, Standard D1v2
machine size used for transaction nodes. Standard D,
Standard D-v2,
Standard F series,
Standard DS,
and Standard FS
Ethereum settings
Next, under Ethereum settings, specify Ethereum-related configuration settings, like the network ID and
Ethereum account password or genesis block.
Member ID should be
unique across different
organizations in the same
network. A unique member
ID is needed even when the
same organization deploys
to multiple regions.
Shared Key for Connection A Shared key for connection 12 or more characters NA
between VNET gateways.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUES
Endpoint of Peer information Peer info endpoint provided Valid endpoint of first NA
registrar by another member's member in consortium
deployment
Key of Peer information Peer info primary key Valid primary key of first NA
registrar provided by another member in consortium
member's deployment
Summary
Click through the summary blade to review the inputs specified and to run basic pre-deployment validation.
Review legal and privacy terms and click Purchase to deploy. If the deployment has more than one region, or is for
a consortium network, then this template pre-deploys the necessary VPN gateways to support network
connectivity with other members. Deployment of the gateway can take up to 45 to 50 minutes.
The node status is refreshed every 10 seconds. Reload the page via the browser or Reload button to update the
view.
OMS portal
You can locate your OMS portal either by following the link in the deployment output (OMSPORTALURL ) or by
selecting the OMS resource in your deployed resource group.
Clicking on the overview will direct you to a portal to view per-node statistics.
Accessing nodes
You can remotely connect to the virtual machines for the transaction nodes via SSH with your provided admin
username and password/SSH key. Since the transaction node VMs do not have their own public IP addresses, you
will need to go through the load balancer and specify the port number. The SSH command to run to access the first
transaction node is listed in the template deployment output parameter as, SSH_TO_FIRST_TX_NODE (for the
sample deployment: ssh -p 4000 gethadmin@leader4vb.eastus.cloudapp.azure.com). To get to additional
transaction nodes, increment the port number by one (For example, the first transaction node is on port 4000).
Since the virtual machines on which the mining nodes run are not externally accessible, you need to go through
one of the transaction nodes. Once you have an SSH session to a transaction node, install your private key on the
transaction node or use your password to start an SSH session into any of the mining nodes.
Note
The hostnames can be obtained from Admin Site or from the Azure portal. In Azure portal, the hostnames of
nodes present in the virtual machine scale set (VMSS ) resource is listed under Instances, which differs from the
actual hostnames. For example, the hostname in Azure portal may look like mn-asdfmv-reg1_0 but the actual
hostname would be like mn-asdfmv-reg.
For example:
mn-ethwvu-reg1_0 mn-ethwvu-reg1000000
mn-ethwvu-reg1_1 mn-ethwvu-reg1000001
mn-ethwvu-reg1_2 mn-ethwvu-reg1000002
The architecture will be as follows after you have successfully configured connection between leader and member
deployments.
To install the extension in Chrome, go to Customize and control Google Chrome (overflow button) > More Tools >
Extensions > Get More Extensions, and search for MetaMask.
Once installed, open MetaMask and create a new vault. By default, the vault will be connected to the Morden Test
Network. You will need to change this to connect to the deployed private consortium network, specifically to the
load balancer in front of the transaction nodes. From the template output, retrieve the exposed Ethereum RPC
endpoint at port 8545, named as ETHEREUM-RPC-ENDPOINT , and enter it in custom RPC as shown below.
By creating the vault, you create a wallet containing an account. To create additional accounts, select Switch
Accounts and then the + button.
Once the transaction is committed into a mined block, the account balance in MetaMask for your account will
reflect the transfer of 1000 Ether.
Once again, when the transaction is mined and committed into a block, the account balances are reflected
accordingly. Note, Wallet 1's balance is deducted more than 15 Ether, since you had to pay a mining fee to process
the transaction.
Next steps
You are now ready to focus on application and smart contract development against your private consortium
blockchain network.
Hyperledger Fabric single member network
10/2/2018 • 6 minutes to read • Edit Online
You can use the Hyperledger Fabric Consortium solution template to deploy and configure a Hyperledger Fabric
single member (multi-node) network.
After reading this article, you will:
Obtain working knowledge of blockchain, Hyperledger Fabric, and more complicated consortium network
architectures
Learn how to deploy and configure a single-member Hyperledger Fabric consortium network from within the
Azure portal
About blockchain
If you are new to the blockchain community, this is a great opportunity to learn about the technology in an easy
and configurable manner on Azure. Blockchain is the underlying technology behind Bitcoin; however, it is much
more than just an enabler for a virtual currency. It is a composite of existing database, distributed system, and
cryptographic technologies that enables secure multi-party computation with guarantees around immutability,
verifiability, auditability, and resiliency to attack. Different protocols employ different mechanisms to provide these
attributes. Hyperledger Fabric is one such protocol.
Getting started
To begin, you will need an Azure subscription that can support deploying several virtual machines and standard
storage accounts. If you do not have an Azure subscription, you can create a free Azure account.
By default, most subscription types support a small deployment topology without needing to increase quota. The
smallest possible deployment for one member will need:
5 virtual machines (5 cores)
1 VNet
1 load balancer
1 public IP address
Once you have a subscription, go to the Azure portal. Select +, select Blockchain, and select Hyperledger Fabric
Single Member Blockchain.
Deployment
To start, select the Hyperledger Fabric Single Member Blockchain and click Create. This will open the Basics
blade in the wizard.
The Template Deployment will walk you through configuring the multi-node network. The deployment flow is
divided into three steps: Basics, Network configuration, and Fabric configuration.
Basics
Under the Basics blade, specify values for standard parameters for any deployment, such as subscription, resource
group, and basic virtual machine properties.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUE
Authentication type The method to authenticate Password or SSH public key Password
to the virtual machine.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUE
Virtual machine size The virtual machine size Standard A, Standard D1_v2
used for all nodes in the Standard D,
network Standard D-v2,
Standard F series,
Standard DS,
and Standard FS
Bootstrap User Name The initial authorized user 9 or fewer characters admin
that will be registered with
the member services in the
deployed network.
PARAMETER NAME DESCRIPTION ALLOWED VALUES DEFAULT VALUE
Deploy
In Summary, review the inputs specified and to run basic pre-deployment validation.
Review legal and privacy terms and click Purchase to deploy. Depending on the number of VMs being
provisioned, deployment time can vary from a few minutes to tens of minutes.
Accessing nodes
Once the deployment is finished, an Overview is displayed.
If the screen does not appear automatically (maybe because you moved around the management portal while the
deployment was running), you can always find it in the Resource Groups tab in the left-side navigation bar. Click on
the Resource Group name you entered in step 1 to go to the Overview page.
Overview lists all of the resources that were deployed by the solution template. You can explore them at will, but
from this screen you can also access the output parameters generated by the template. These output parameters
will give you useful information when connecting to your Hyperledger Fabric network.
To access the output parameters, first click on the Deployments tab in the Resource Group blade. The deployment
history is displayed.
From the Deployment History, click on the first deployment in the list to look at the details.
The details screen will show you a summary of the deployment, followed by three useful output parameters:
The API -ENDPOINT can be used once you deploy an application on the network.
The PREFIX , also called deployment prefix , uniquely identifies your resources and your deployment. It will be
used when using the command-line based tools.
The SSH -TO -FIRST -VM gives you a pre-assembled ssh command with all the right parameters required to
connect to the first VM in your network; in the case of Hyperledger Fabric, it will be the Fabric-CA node.
You can remotely connect to the virtual machines for each node via SSH with your provided admin username and
password/SSH key. Since the node VMs do not have their own public IP addresses, you will need to go through
the load balancer and specify the port number. The SSH command to access the first transaction node is the third
template output, **SSH-TO -FIRST-VM (for the sample deployment:
sh -p 3000 azureuser@hlf2racpt.northeurope.cloudapp.azure.com ). To get to additional transaction nodes, increment
the port number by one (For example, the first transaction node is on port 3000, the second is on 3001, the third is
on 3002, etc.).
Next steps
You are now ready to focus on application and chaincode development against your Hyperledger consortium
blockchain network.