Making plans for our home renovation

Three years ago we moved into our first house. It’s a three storey, solid stone doer-upper in a lovely town in South Wales which we thought we’d be able to improve ourselves. It had taken us a while…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Create ASP.NET Core Web API for Ethereum DApps

Photo by Verne-Ho

So to celebrate, in this article we will walk through a simple project to create a ASP.NET Core Web API, which interoperates with a private blockchain network through a smart contract. The project will make use of Nethereum library for all operations regarding smart contract and ethereum blockchain.

The post will be rather long, so I would divide it into three parts:

In the first part, we will see how to set up development environment. It involves downloading and installing SDKs as well as creating a test chain for our project.

The second part briefly introduces an ERC-20 compliant smart contract, how to write one, compile and test. The smart contract will be written in Solidity. The language is pretty easy to catch up (it took me roughly a morning to skim through the docs), but if you feel reluctant, you can just skip the part and use the sample one provided in the project repository. But I really recommend you to take a look because getting your hands dirty in smart contract will help understand many important concepts of Ethereum and EVM.

The third part is probably the most gourmandise. We will create a Web API project using ASP.NET Core and Nethereum. Via this REST APIs, any clients can deploy smart contracts to our private blockchain, and interact with the contracts without the need to understanding the underlying infrastructure. The Web Api acts as a middleman between your front end DApps and blockchain. It is a back-end blockchain enabled decentralized application. The third part will show case some advantages of implementing a front-back architecture for your blockchain applications.

The purpose of the tutorial is to help understand the large picture of how blockchain can interoperate with existing technologies. Therefore the Web API was designed with simplicity and barely any concerns of security. The security subject itself is of great appeal and I will cover it in subsequent articles.

Also, this walk-through will not cover creating client application which consumes the Web Api. There are already a handful of resources out there on how to make a simple Angular or React web app.

Add a comment

Related posts:

Clean Matching with FuzzyWuzzy

Python comes equipped with numerous ways to handle inconsistencies in strings as well as overall language (cue Natural Language Processing) to vectorize and transform words into usable formats for…

This is Huluween

Huluween is a hallowed Hulu tradition and arguably the most anticipated event of the year. We love Huluween so much, it's scary.

Conversation Beats Connection

Conversation is speaking to someone on the phone, on video or in person. It’s high-bandwidth, lots of information is conveyed to the other person, not just text. It’s all your gestures, expressions…