# Defining Go Types and Loading Blockchain Settings from JSON

DevFeed: [Defining Go Types and Loading Blockchain Settings from JSON](<https://devfeed.tech/articles/ultimate-go-advanced-engineering-episode-10-22199.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/01/ultimate-go-advanced-engineering-episode-10.html>)

Published: 2023-01-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Blockchain](<https://devfeed.tech/topics/blockchain.md>), [data](<https://devfeed.tech/topics/data.md>), [Ethereum](<https://devfeed.tech/topics/ethereum.md>)

Tags: [bitcoin](<https://devfeed.tech/tags/bitcoin.md>), [blockchain](<https://devfeed.tech/tags/blockchain.md>), [blockchain-asset](<https://devfeed.tech/tags/blockchain-asset.md>), [clean-code](<https://devfeed.tech/tags/clean-code.md>), [code](<https://devfeed.tech/tags/code.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [data-type](<https://devfeed.tech/tags/data-type.md>), [ethereum](<https://devfeed.tech/tags/ethereum.md>), [genesis-record](<https://devfeed.tech/tags/genesis-record.md>), [go](<https://devfeed.tech/tags/go.md>), [go-blockchain](<https://devfeed.tech/tags/go-blockchain.md>), [go-types](<https://devfeed.tech/tags/go-types.md>), [json](<https://devfeed.tech/tags/json.md>), [load](<https://devfeed.tech/tags/load.md>), [types](<https://devfeed.tech/tags/types.md>), [video](<https://devfeed.tech/tags/video.md>)

## AI overview

This video explains how to define Go types for a blockchain's genesis record and load the blockchain's settings from a JSON file. It also discusses choosing suitable built-in types for struct fields, including limitations of uint64.

## Source excerpt

Introduction In episode 9, Bill introduced the idea of the genesis record and its role in his blockchain. As a recap, the genesis record will be used to customize the settings of his blockchain. The approach Bill takes here is similar to how Ethereum operates because he is storing the record in JSON format. In this video, Bill starts by defining the Go types his blockchain will use. The first type he defines will represent the genesis record. This type will be populated by the data found in the genesis record and will ensure Bill reaps all the benefits of using strongly typed language. Before he proceeds with the next type definition, he highlights the possible limitations he can encounter by using type uint64. Watch to learn how to write idiomatic and durable Go code that will load your blockchain's settings from disk.