Published inGoChain·Oct 3, 2018Scaling Blockchain StorageTaming the monolithic database — GoChain has been successful in increasing blockchain performance through block size reduction, significant code optimizations, and Proof of Reputation consensus, however, that causes another issue—more transactions per second means that the storage size grows at the same rate. The storage layer originally used the go-ethereum implementation where all data is…Database4 min readDatabase4 min read
Published inGo Walkthrough·Sep 21, 2016Go Walkthrough: fmtIn the last post we looked at fast, primitive encoding using strconv but in this post we’ll take a higher level approach by using templates with the fmt package. …Golang10 min readGolang10 min read
Published inGo Walkthrough·Sep 8, 2016Go Walkthrough: strconvFormatting & parsing primitive values in Go is a common task. You probably first dipped your toes into the fmt package when you started Go, however, there’s a less commonly used package for basic formatting that’s more efficient and preserves compiler type checking. The strconv package is built for speed…Programming9 min readProgramming9 min read
Published inGo Walkthrough·Aug 29, 2016Go Walkthrough: encoding/binaryWhen you need to squeeze every last bit or CPU cycle out of your protocol, one of the best tools is the encoding/binary package. It operates on the lowest level and is built for working with binary protocols. …Programming8 min readProgramming8 min read
Published inGo Walkthrough·Aug 22, 2016Go Walkthrough: encoding/json packageFor better or for worse, JSON is the encoding of the Internet. Its formal definition is small enough that you could write it on the back of a napkin but yet it can encode strings, numbers, booleans, nulls, maps, and arrays. …Golang11 min readGolang11 min read
Published inGo Walkthrough·Aug 15, 2016Go Walkthrough: encoding packageSo far we’ve covered working with raw byte streams and bounded byte slices but few applications simply shuttle bytes around. Bytes alone don’t convey much meaning, however, once we encode data structures on top of those bytes then we can build truly useful applications. This post is part of a…Programming8 min readProgramming8 min read
Aug 10, 2016Standard Package LayoutVendoring. Generics. These are seen as big issues in the Go community but there’s another issue that’s rarely mentioned — application package layout. Every Go application I’ve ever worked on appears to have a different answer to the question, how should I organize my code? Some applications push everything into…Golang7 min readGolang7 min read
Published inGo Walkthrough·Aug 8, 2016Go Walkthrough: bytes + strings packagesIn the previous post we covered byte streams but sometimes we need to work with bounded, in-memory byte slices instead. While working with a list of bytes seems simple enough, there are a lot of edge cases and common operations that make using the bytes package worthwhile. …Golang12 min readGolang12 min read
Published inGo Walkthrough·Aug 1, 2016Go Walkthrough: io packageGo is a programming language built for working with bytes. Whether you have lists of bytes, streams of bytes, or individual bytes, Go makes it easy to process. From these simple primitives we build our abstractions and services. The io package is one of the most fundamental packages within the…Golang9 min readGolang9 min read
Jul 14, 2014Structuring Tests in GoHow I organize my tests in Go — The Purpose of Tests People argue over testing style, whether to use TDD or BDD, or whether tests are even useful at all. Before I get into how I structure my tests in Go, I should explain how I see tests. Tests should be 2 things: Self-contained Easily reproducible That’s it. They should be…5 min read5 min read