From the course: Build an Ethereum Smart Contract with Go and Solidity
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Service skeleton - Go Tutorial
From the course: Build an Ethereum Smart Contract with Go and Solidity
Service skeleton
- [Instructor] Now let's draft the skeleton of a simple API service and go to interact with our contracts. We'll use the Jane framework to implement the API in this course for simplicity. there are many other GO API frameworks such as the popular cabilla web2 kit. From a very high level, a Golang API service is usually made up of three layers, the entry point, the handlers, and the service or data sources. Sometimes the data sources are moved down to a fourth layer or spread it out into two layers. Business layer, low level data access layer. As GO API is not a major focus in this course, and in our case, we do not have a data store. Three layers model makes more sense for us and I will explain things with that model. What we're going to do is to implement these three layers for a smart contract API. Entry point is usually the main function for goal dependencies are initialized and injected so they can be created upon dot and cleaned up upon shutdown at the highest level. Below, it is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.