malirez.Workbench.Client 0.1.0

dotnet add package malirez.Workbench.Client --version 0.1.0
NuGet\Install-Package malirez.Workbench.Client -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="malirez.Workbench.Client" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add malirez.Workbench.Client --version 0.1.0
#r "nuget: malirez.Workbench.Client, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install malirez.Workbench.Client as a Cake Addin
#addin nuget:?package=malirez.Workbench.Client&version=0.1.0

// Install malirez.Workbench.Client as a Cake Tool
#tool nuget:?package=malirez.Workbench.Client&version=0.1.0

Workbench.Client

Azure Blockchain Workbench REST API

  • API version: v1

The Azure Blockchain Workbench REST API is a Workbench extensibility point, which allows developers to create and manage blockchain applications, manage users and organizations within a consortium, integrate blockchain applications into services and platforms, perform transactions on a blockchain, and retrieve transactional and contract data from a blockchain.

Unlike clients for other languages, this client was not auto-generated, it was developed specifically for a mobile sample written by the Xamarin. It incorporates Microsoft's ADAL library for authentication and additional resiliency with the Polly library.

Features

  1. Polly.NET (https://github.com/App-vNext/Polly) a .NET resiliency library with exponential retry backing
    • Currently, the library is used to handle TaskCancelledExceptions or timeouts from the server.
  2. Singleton Implementation - just include the library in your project and reference it from anywhere
  3. Thread-safe: only a single HttpClient is used
  4. Event Handlers you can subscribe to:
    • For expired access tokens (so you can refresh and get a new one)
    • When Exceptions are thrown
  5. Exception handling - JsonException, TaskCancelledException, HttpRequestException
  6. Generic GET and POST methods with C# Generics

Getting Started

1. Setting Optional Parameters for Timeout and RetryCount

There are two parameters that can be set on the Gateway API: CLIENT_API_TIMEOUT and POLLY_RETRY_COUNT. The first one is for setting the default timeout interval of the HttpClient. The second is the number of times an API call will retry after at TaskCancelledException before giving up.

2. Obtaining an Authentication Token via ADAL

Using the .NET ADAL library for Xamarin.iOS, Xamarin.Android, or .NET - authenticate with the Active Directory and retrieve then authentication token.

Workbench doesn't require an API Key. It knows who the request is coming from by simply including the authentication token from ADAL in the authorization request header.

For Xamarin Apps (Xamarin.Forms, Xamarin.iOS and Xamarin.Android) please follow this tutorial: https://blog.xamarin.com/put-adal-xamarin-forms/

3. Setting the Authentication Token on the API

Once you obtain the authentication token, use the following method to set it on the Gateway API instance:

GatewayApi.Instance.SetAuthToken(<yourTokenAsString>)

4. Using the Gateway API

Refer to the swagger documentation of the Workbench API on getting started. Method names will be similar to the api documentation

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 6,479 12/6/2018