Coder Social home page Coder Social logo

raymondfx / aries-framework-dotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledger-archives/aries-framework-dotnet

0.0 1.0 0.0 3.21 MB

Aries Framework .NET for building multiplatform SSI services

Home Page: https://wiki.hyperledger.org/display/aries

License: Apache License 2.0

Dockerfile 0.40% Shell 0.09% C# 99.51%

aries-framework-dotnet's Introduction

Aries Framework for .NET

Build Status Build Status MyGet

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.

Table of Contents

Environment Setup

Prerequisites

Installation

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.

Quickstart Guide

The framework fully leverages the .NET Core hosting model with full integration of dependency injection, configuration and hosting services.

Create new web application

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.

Add the framework dependencies

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.

Register the agent middleware

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.

Demo

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.

Testing

To run the unit tests, the following dependencies also must be installed:

  • Docker

Install libindy library

Follow the build instructions for your OS on the Hyperledger Indy SDK Readme.

For macOS, if you get a 'indy' DLL not found exception, move the built libindy.dylib file to the test/Hyperledger.Aries.Tests/bin/Debug/netcoreapp3.1/ directory to explicitly add it to the path.

Run an indy node pool

docker build -f docker/indy-pool.dockerfile -t indy_pool docker/
docker run -itd -p 9701-9709:9701-9709 indy_pool

Run the tests

First, edit the keyword in the scripts/tester.sh file to select the tests you want to run. Then, run the script

scripts/tester.sh 

License

Apache License Version 2.0

aries-framework-dotnet's People

Contributors

adrijanrogan avatar airoasis avatar chempel-esatus avatar conanoc avatar gnarula avatar idr-spilling avatar jeffallen avatar kaltrini avatar lijiachuan1982 avatar michaeldboyd avatar naagii avatar popandov avatar rinkalbhojani avatar ryjones avatar shadynagy avatar steventcramer avatar sukalpomitra avatar tmarkovski avatar victorbalan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.