Getting started on a NEO SmartContract!

Written by dominicfung_58781 | Published 2018/08/04
Tech Story Tags: python | neo-smartcontract | smart-contracts | neo | aws

TLDRvia the TL;DR App

Before we begin, you may be wondering: What is NEO? NEO (formerly Antshares) is a Chinese-based blockchain which uses proof-of-stake* instead of proof-of-work to achieve consensus. I know I’m throwing around big terms, but simply put, NEO nodes/servers will be way more eco friendly than its competitors! Read more about this here.

In addition, NEO’s smart-contracts can be written in any language! It currently supports C#, Java and Python, with plans to support Javascript, C and Golang in the future, lowering the barrier of entry for developers looking to step foot into smart contracts. For comparison, Ethereum created its own language, Solidity, for contract development.

Hopefully I’ve already convinced you to get your hands dirty with NEO, but if not, you may want to check out articles by my dear friend, Nathan Mukena who wrote about how he discovered cryptocurrency, block-chain technology, and the NEO platform!

As Nate covers the big pictures, this article will take us down to the nitty-gritty! We will show you how to set up a dev environment, build a private network for you and your friends, write/compile your first smart contract and even how to create a React App to interface with your newly deployed contract!~

Excited?! Lets begin -

Building a smart-contract on a new blockchain platform can be a daunting task. The first step: Set-up your environment!

We will focus on keeping costs down, installing the NEO-python CLI, running our own block-chain private network via AWS and deploying out very first contract!~

Check out Alex Guba for some more in-depth guides!

Step 1: Allow Linux subsystems on your windows machine!

Open Windows PowerShell and use the following commands_:_

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

restart

Step 2: Download + Start up the Ubuntu environment

Open up the command prompt and initiate Ubuntu_:_

ubuntu

*set up your root username/password

Step 3: install python 3.6.5, run these commands on Ubuntu:

sudo -i

apt-get install software-properties-common python-software-properties

add-apt-repository ppa:deadsnakes/ppa

apt-get update

apt-get install python3.6 python3.6-dev python3.6-venv python3-pip libleveldb-dev libssl-dev g++

Step 4: installing NEO-Python

open up a new command prompt, and clone the neo-python project:

cd <storage location>git clone https://github.com/CityOfZion/neo-python.git

go back to the Ubuntu terminal:

cd /mnt/<drive+storage location>/neo-pythonpython3.6 -m venv venv

source venv/bin/activatepip install -e .

Step 5: run the NEO-Python prompt (from Ubuntu)!

np-prompt

you are now connected to the public NEO network! Next week, we will look into creating a private network where you and your friends can connect and deploy your first smart contract.

Check out the project I’m currently working on! Nodis.io is a marketing platform for local business, generating engagement through small activities and rewarding users with cryptocurrency they can later spend on these stores.

Next week’s guide: setting up your own private NEO network on AWS.


Published by HackerNoon on 2018/08/04