2

Ultimate Go: Advanced Engineering Episode 18

 1 year ago
source link: https://www.ardanlabs.com/blog/2023/01/ultimate-go-advanced-engineering-episode-18.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Ultimate Go: Advanced Engineering Episode 18

Author image

Cheikh Seck

January 24, 2023

Introduction

In episode 17, Bill began to design an in-memory accounting database that will store the account balances on his blockchain. To build this database, Bill will add a memory pool on each node that stores a list of public addresses with their respective balances. The balances on these addresses are reconstructed by reading the previous transaction records found on his blockchain.

In this video, Bill will define the types of transactions his blockchain will support. The first step Bill takes is to define the transaction data type and give a full walkthrough of the reasoning behind the fields he chose for this data type. Next, he’ll define methods for this type that will validate a transaction. While writing this code, Bill will borrow a few concepts from Ethereum to build a reference implementation. Watch to learn how transactions are managed on the blockchain and how to define one on your blockchain.

Things you will learn in this video

  • How to define a transaction.
  • The role of a Nonce (only-once) token.
  • Validate a transaction.
  • Define a factory function for a transaction.

Video


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK