-
Notifications
You must be signed in to change notification settings - Fork 74
Home
Aries Framework for .NET is a comprehensive implementation of the Aries protocols. It's purpose is to provide a universal library for building SSI application for the cloud, mobile and IoT stack.
- Install .NET Core
- Install libindy for your platform
Aries Framework for .NET comes as a Nuget package available at nuget.org
PM> Install-Package Hyperledger.Aries
If you are developing a web application, also install Hyperledger.Aries.AspNetCore package.
The framework fully leverages the .NET Core hosting model with full integration of dependency injection, configuration and hosting services.
Using your favorite editor, create new web project. You can also create a project from the console.
dotnet new web -o AriesAgent
To setup your agent use the Startup.cs
file to configure the framework.
Use the IServiceCollection
extensions to add the dependent services to your application in the ConfigureServices(IServiceCollection services)
method. Upon startup, the framework will create and configure your agent.
services.AddAriesFramework(builder =>
{
builder.RegisterAgent(options =>
{
options.EndpointUri = "http://localhost:5000/";
});
});
Note: If you'd like your agent to be accessible publically, use Ngrok to setup a public host and use that as the
EndpointUri
. When changing the endpoints, make sure you clear any previous wallets with the old configuration. Wallet data files are located in~/.indy_client/wallet
For a list of all configuration options, check the AgentOptions.cs file.
When running web applications, register the agent middleware in the Configure(IApplicationBuilder app, IWebHostEnvironment env)
method. This will setup a middleware in the AspNetCore pipeline that will respond to incoming agent messages.
app.UseAriesFramework();
That's it. Run your project.
With Docker installed, run
docker-compose up
This will create an agent network with a pool of 4 indy nodes and 2 agents able to communicate with each other in the network. Navigate to http://localhost:7000 and http://localhost:8000 to create and accept connection invitations between the different agents.