Skip to content

Latest commit

 

History

History
82 lines (45 loc) · 3.29 KB

Hacking.md

File metadata and controls

82 lines (45 loc) · 3.29 KB

Hacking

Introduction

The Aergo blockchain uses Lua as the language for smart contracts. The engine used is LuaJIT, but the Just-In-Time compilation is disabled. The contracts are compiled with the aergoluac command line tool and sent to the blockchain as bytecode. The LuaJIT version is 2.1.0-beta3.

LuaJIT documentation

Lua documentation

The Aergo blockchain uses the Lua 5.1 version, but some features are disabled.

Aergo Lua documentation

Learning

First watch this short video about how to write a simple smart contract:

Your First Smart Contract in Lua

The simplest method to try hacking the aergo engine is by using the brick tool

brick

If you prefer to deploy the contracts to the blockchain (use the testnet for tests) then watch this video:

How To Deploy Your Smart Contract

Aergo Tools

General Tool

Instead of running a local server or using the test network, you can make your experiments using brick. It can be downloaded here

Creating and Deploying Contracts

To create and deploy smart contracts easily, you can use the Aergo IDE

You can also compile the contracts locally with the aergoluac command line tool, which can be downloaded here

Running a Local Server

The Aergo blockchain can be run locally with the aergosvr command line tool, downloadable on the same link above.

The Aergo blockchain can also be run locally with Docker

Interacting with the blockchain

On the web:

On the command line:

  • The aergocli command line tool, downloadable on the GitHub releases link above. (you can automate it with bash scripts. example here)

Via your own application:

Blockchain Explorer

If you are using the testnet instead of a local server/network, you can use the Aergo blockchain explorer: AergoScan

Contact

If you have any problem, you can make technical questions on Discord