Golang on Home on Railshttp://homeonrails.com/tags/golang/
Recent content in Golang on Home on RailsHugo -- gohugo.ioen-usAll rights reservedSat, 03 Mar 2018 13:47:11 +0400Choosing a type for blockchain height (beware of unsigned integers)http://homeonrails.com/2018/03/choosing-a-type-for-blockchain-height/
Sat, 03 Mar 2018 13:47:11 +0400http://homeonrails.com/2018/03/choosing-a-type-for-blockchain-height/<p><em>This article was originally published on <a href="https://medium.com/@anton.kalyaev/choosing-a-type-for-blockchain-height-beware-of-unsigned-integers-714804dddf1d">Medium</a>.</em></p>
<p>Before <a href="https://github.com/tendermint/tendermint/pull/914">this pull request</a>,
it was a mess. ABCI was using a <code>uint64</code> height on EndBlock. Tendermint Core
was using the same type for TxResult. Block and BlockStore, however, were using
<code>int</code> heights (remember that <code>int</code> is different depending on the processor
architecture: <code>int32</code> for x86, <code>int64</code> for amd64). There was no single standard
across our repositories as for what type to use for blockchain height.</p>
<p></p>Debugging the Memory Leak in Tenderminthttp://homeonrails.com/2018/03/debugging-the-memory-leak-in-tendermint/
Sat, 03 Mar 2018 13:20:11 +0400http://homeonrails.com/2018/03/debugging-the-memory-leak-in-tendermint/<p><em>This article was originally published on <a href="https://blog.cosmos.network/debugging-the-memory-leak-in-tendermint-210186711420">Medium</a>.</em></p>
<p>I have spent the last week looking for clues and writing test cases in order to
find and fix the memory leak in
<a href="https://github.com/tendermint/tendermint/">Tendermint</a>. For those of you who
don’t know, Tendermint Core is a Byzantine Fault Tolerant (BFT) middleware that
takes a state transition machine — written in any programming language — and
securely replicates it on many machines. It is also the foundation of
<a href="https://cosmos.network/">Cosmos</a> — our solution for scaling blockchains.</p>
<p>Finding a memory leak in Go is not an easy task. However, there is a common set
of questions, answers to which will hopefully help you identify the source of a
leak. Here is the list:</p>
<p></p>Abstracting the logger interface in Gohttp://homeonrails.com/2017/06/abstracting-the-logger-interface-in-go/
Tue, 06 Jun 2017 22:35:01 +0200http://homeonrails.com/2017/06/abstracting-the-logger-interface-in-go/Wrote a blog post a few days ago for my company&rsquo;s blog about our experience of moving from a static logger to an interface and adapter for the go-kit log package.
https://blog.cosmos.network/abstracting-the-logger-interface-in-go-4cf96bf90bb7CircleCI config for multipackage Golang projectshttp://homeonrails.com/2017/02/circleci-config-for-multipackage-golang-projects/
Mon, 06 Feb 2017 10:54:24 +0400http://homeonrails.com/2017/02/circleci-config-for-multipackage-golang-projects/<p>Multipackage Golang project - project, consisting of several packages. When
testing you usually do something like <code>go test ./...</code>, when getting all the
dependencies - <code>go get ./...</code>. There may be or may not be a Go package at the
root level. Examples: <a href="https://github.com/hashicorp/consul">1</a>,
<a href="https://github.com/tendermint/tendermint">2</a>.</p>
<p></p>