avatarLarry Schoeneman

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2023

Abstract

overy system delivers a seamless user design with the high accessibility users have come to expect. If a user forgets their password on Mogul, they go through a familiar front-end experience similar to resetting an email or social media password. They click on a ‘Forgot Password’ button, a link is sent, they receive an email, click the link, and the password is reset. However, on the back-end, Mogul built a smart wallet system using smart contracts for decentralized wallet recoverability. When users reset a wallet, they actually create a new authentication wallet that is programmed to have the capabilities of interacting with the smart wallet. Yet, on the front-end to the user, it looks like a simple password reset.</p><ul><li><b>Manual Transaction Signatures Eliminated:</b></li></ul><p id="f765">Users can send free and frictionless transactions within the platform without manual signatures. When you use other DeFi wallets, you generally have to interact with a Web 3 interface to manually confirm a transaction and pay a costly gas fee, especially as the network congests. For example, with Metamask and Web3, a user needs to give permissions to access their wallet and then the user needs to confirm the transaction:</p><figure id="5453"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*2Mf9SQSXGWdh9ndV"><figcaption></figcaption></figure><p id="333b">This process would need to happen for each action on Mogul. Not everyone who could benefit from Mogul’s technology is able to understand the nuances involved in a blockchain transaction, so Mogul offers sponsored, frictionless in-platform actions.</p><p id="5ebc">While other wallets require tech-savviness just to maneuver around, Mogul has re-engineered an incredibly complex system in a very simple way.</p><h1 id="8d0a">Smart Wallet Recovery Done Right</h1><figure id="ec20"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*DL3FUoeScVR5WMIa"><figcaption></figcaption></figure><p id="c212">Our wallet recovery process u

Options

ses the Mogul Guardian by default, which allows for safe and secure decentralized recoverability. This system provides a user with a new authentication wallet through a standard password reset flow.</p><p id="4c95">The system delivers a new authentication wallet to communicate with user funds.</p><p id="c638">A Mogul user can choose between using the default Mogul Guardian system, or reset their guardian(s) to their preference where more than one Guardian can be chosen. Guardians could be friends, hardware wallets, or a mixture of both. Thus, users can create a multi-channel authentication system for decentralized password and key recovery.</p><p id="c957">For example, if a user doesn’t want to use the Mogul Guardian, that user can designate Tracy (or Tracy, Bob, and Alice) as the guardian(s) and thereby make them the only entity that can change the authentication wallet, requiring their wallet’s permissions to do so.</p><p id="732c">The film industry can benefit from the Mogul Smart Wallet because it is easy-to-use and does not require the tech know-how that was asked from previous generations of blockchain wallets.</p><p id="a531">Mogul removes major points of friction to deliver a seamless end-user experience that makes using blockchain technology feel as natural as using the Internet when browsing the web.</p><p id="eaf7">We are always listening to our users. We welcome suggestions and feedback through our <a href="https://mogulproductions.com/contact">contact page</a>.</p><p id="c69c"><b>ABOUT MOGUL PRODUCTIONS (MOGUL)</b> <i>Mogul Productions, established 2019, is a blockchain-based film financier and production company with a presence in Canada, the United States of America and Europe.</i></p><p id="ed5a"><i>The Mogul platform connects contributors, film industry professionals and fans through technology that allows all users to engage and participate with each project throughout theirs entire lifecycle, from financing through to production and distribution.</i></p></article></body>

Taking advantage of configuration in .net core 2.2+ console applications

This is related my prior article on dependency injection in .net core 2.2 console apps. I am assuming you’ve read that before coming here. Otherwise this will make no sense.

We’ve established a basic console application which can now use dependency injection using the .net core framework (2.2 or later). From here we need to add a couple of necessary elements.

  • Configuration
  • Logging
  • Database context configuration for Entity Framework Core

In this article, we will focus on setting up configuration. Logging and database connectivity configuration will follow.

First things first. Start with the code from the above referenced article. If you don’t still have that around, well…sorry!

Now, go to your handy dandy NuGet Package manager and add the following packages:

Microsoft.Extensions.Configuration Microsoft.Extensions.Configuration.Json

If you don’t know how to do this, I have no idea why you are bothering to read this article, as you probably don’t have adequate knowledge of any of this. Oh well. Not my circus, not my monkeys!

We are only going to cover a few situations here. You can use one of the providers for environment variables etc as you need them.

Adding configuration, in the context of our dependency injection enabled console application is straightforward.

Open Program.cs and go to the method we previously created, ConfigureServices:

private static IServiceCollection ConfigureServices()
{
    IServiceCollection services = new ServiceCollection();
    services.AddTransient<ITestService, TestService>();
    // IMPORTANT! Register our application entry point
    services.AddTransient<ConsoleApplication>();
    return services;
}

We are going to add a call to set up the object we need for configuration, and then add that object to our DI container so we can get to it. Since there is no need for more than one configuration object per application, we are going to create a Singleton. I know some people are not fans, but since this is an injected singleton, you can test it! Go you!

So our new ConfigureServices method looks like:

private static IServiceCollection ConfigureServices()
{
    IServiceCollection services = new ServiceCollection();
    // Set up the objects we need to get to configuration settings
    var config = LoadConfiguration();
    // Add the config to our DI container for later user
    services.AddSingleton(config);
    services.AddTransient<ITestService, TestService>();
    // IMPORTANT! Register our application entry point
    services.AddTransient<ConsoleApplication>();
    return services;
}

We need to define our LoadConfiguration method now. It just needs to set us up to read from an application config file:

public static IConfiguration LoadConfiguration()
{
    var builder = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("appsettings.json", optional: true, 
                     reloadOnChange: true);
     return  builder.Build();
}

This assumes our application uses a file named appsettings.json to hold our config settings (I REALLY hope that’s obvious to you. Again, if not, why are you reading this?)

If you need them you can call AddEnvironmentVariables, AddXmlFile and so on, as long as you grab the appropriate NuGet package.

In our code, we set up a builder, give it what we want it to be able to access (paths, files, environment variables, etc) and then call build to give us back a configuration. We then pass this back, and drop it into our DI container.

     services.AddSingleton(config);

Essentially, we are done. Now, all we need to do is inject and go!

Let’s say we have an appsettings.json file that looks like:

{
   "Location": "Home",
   "ConnectionStrings": {
      "Storage": "Sample" 
    }
}

In our console application’s ConsoleApplication class, we can add the configuration object to our constructor:

public class ConsoleApplication
{
    private readonly IConfiguration _configuration;
    public ConsoleApplication(IConfiguration configuration)
    {
       _configuration = configuration;
    }
       ....

Now in our methods, we can use our injected configuration object:

public void DoSomething()
{
   var location = _configuration.GetValue<string>("Location");
...

There you go! More of the .net core’s framework usable by the lowly console application. Go play! More to come about logging and database connectivity.

C Sharp Programming
Net Core
Console Application
Programming
Recommended from ReadMedium