Being a full Neo node implementation, NeoGo lets you compile/deploy/invoke smart contracts without any external dependencies, just using NeoGo alone. But it’s not always convenient (CLI tools only) and can even be quite painful if one is to try debugging these contracts. Luckily Neo community already has good tools for contract development and debugging and recently released version 0.75.0 of NeoGo added support for Neo Blockchain Toolkit, so now you can develop smart contracts in Go right from this standard environment using NeoGo compiler and SDK. In this article, we show how to write, compile and debug a simple smart contract written in Go using this toolkit.Pre-requirements Visual Studio Code v1.40 or later .NET Core 3.1 SDK Neo Blockchain Toolkit extension for Visual Studio Code installation Go v1.12 or later NeoGo SDK and compiler
Among other things, NeoGo project provides a compiler for smart contracts written in Go along with an SDK containing interop functions used by smart contracts. The compiler part is included in the single binary file whole NeoGo compiles down to (like many other software written in Go), so to be able to use it you just need this binary.
An SDK part is represented as a set of Go packages (see documentation on go.dev) that can be imported and used in a standard Go fashion. But unlike regular Go packages, these are just stubs that have no real implementation inside. Instead of using code from these packages Go smart contract compiler actually substitutes calls to functions with appropriate Neo system calls. Anyway, using them doesn’t differ much from using other Go packages and thus this part doesn’t really require any special care.
As with many other Neo projects NeoGo is currently on its way to Neo 3, so there are two main branches there — master, where all Neo 3 development is happening right now and master-2.x for stable Neo 2 implementation. Here we’ll use the master-2.x branch because Neo 3 is stil...