Coding on Neo from Zero — Part1/3

George_orwell12
The Neo Pulse
Published in
5 min readJun 12, 2020

As a Neo fan with zero coding knowledge, I want to shares my experience of going through the “Developing on Neo” course, in a 3-part blog.

This blog is addressing my interaction with the Neo course. More specifically, it outlines my experience in developing smart contracts from scratch, as a novice with no previous practical contact to coding. Three posts will be made, one on how to deploy a smart contract; another on how to create an NEP-5 token; and finally one on how to deploy a dApp.

This particular post explores the deployment of a smart contract on the Neo blockchain and covers the following points:

  1. How deploying a smart contract works
  2. Immutability of data on blockchain: once deployed, the information cannot be changed by any single party independently
  3. Why private net is used for testing and fixing code problems first (deploying a contract costs money, and having a private net vs. using Neo’s Testnet provides more flexibility)
  4. How Docker is helpful in starting developer environment quickly (copying and pasting a myriad of settings from one machine to another)
  5. What are the required input details of smart contract on Neo blockchain

It is often recurrent nowadays to hear about the betterments of cryptocurrencies and the potential applications it could have to our crippled and obsolete financial system. After the crypto boom in 2017, I suddenly started to have interest in this technology, mainly fuelled by the huge profits and easy cash-in that some lucky few around me were able to witness.

But beyond the effervescence created by cryptocurrencies, it is the technology behind it that actually caught my attention. As I was plunging deep into the subject of blockchain technology, I came to realise the potential and countless applications this technology could have in the near future, and that indeed blockchain deserved all the attention and the superlatives that the press has given it for the past 3 years. These days, what was still not long ago just an abstract concept, is quickly finding its marks within some of our biggest institutions. China recently announced they’ll launch a crypto Yuan, and companies are finding use-cases for blockchain in endless manners. This made me realise that changes are happening and I ought to be part of it.

Albeit my enthusiasm in discovering more about blockchain and interacting with it, I had to face a gigantic and expected wall on my way: my lack of practical knowledge in coding. At this point, I was convinced that my chances of one day being able to develop a smart contract or even making lines of code for that matter, were about as high as me being decapitated in the street by a flying frisbee. Yet, I decided to take a step forward and proceed with my blockchain crusade.

After a bit of research and the help of word to mouth from friends, I came across the Neo course. To my surprise, unlike other complex and often incomprehensible blockchain courses, this one, claimed to offer a deeper understanding of the technology, and most importantly, it would allow me to deploy my very own “smart contracts, dApp and NFT” in only nine lessons. So, even if I was not going to succeed, it would not have been a great waste of time. Moreover, interacting with Neo would allow me to approach every coding languages (C#, Visual Basic, Java, Python and more) as opposed to other blockchains. In my case I chose to use Python all the way, although not out of a particular predilection for this language, but because I had no clue of the difference between them anyway.

After getting acquainted with the basics, I directly installed the system required to start coding (lesson 2/2 Neo Basics: https://neocourse.mywish.io/lesson/6/). During this step, I was asked to start a private network on my computer. While two choices exist (Mainnet and Testnet), only Testnet is required at this stage in order to try the smart contract.

To do so, the next step was to download “Docker”, which is basically a tool that makes it easier to create, deploy and run applications. When downloaded, I had to clone the “Neo repository” and start “neo-local” by using the command “make start”. Be aware, this step is long.

Once fully-completed though, only a few requirements are necessary to start interacting with Testnet. To my amazement, it is not needed to remember any key terminology, just entering the command “help” will provide all the options available and already offers a great flexibility of interaction with the system. Among others, the commands to interact with the wallet and smart contract are provided.

It was then suggested to deploy the first smart contract as practice for future lessons. To do that, I just needed to enter the link: “sc build / smart-contracts / wake_up_neo.py”. To test whether the contract works or not, I also had to enter this other link: “sc build_run /smart-contracts/wake_up_neo.py”, and adjust three parameters “True False False”, “07 05” and “Main”:

Within minutes, I was already facing the function “test deploy invoke successful” signifying I was on the way to complete this smart contract. To deploy it, I used: “sc deploy / smart contracts / wake_up_neo.avm” and repeated the parameters “True False False 07 05”:

The last step, only required to enter basic parameters that will later be displayed on the blockchain “Contract Name; Contract Version; Contract Author; Contract Email; Contract Description”, this is up to you to enter the descriptions you want:

Ultimately, after reviewing the information and making the (test) payment of 490 GAS required for smart contract deployment on NEO, the transaction appeared as successfully and the contract was finally deployed.

This was a very simple smart contract, with the only function to write certain information on blockchain.

In the next post, I will talk about my experience in creating an NEP-5 token, to be continued…

--

--