Skip to content

callchain/contract-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua Contract Tools

Overview

User use this contract tool to convert lua source contract file to lua bytecode which is compressed by snappy. Compressed bytecode is convenient fo network transmission and system storage.

Now this tool only support Linux system and MacOS system.

Dependency

  1. snappy - (https://github.com/google/snappy)

  2. readline

In Centos system

yum install snappy
yum install libreadline-dev

In Ubuntu system

apt install libsnappy-dev
apt install libreadline-dev

In MacOS system

brew install libsnappy-dev
brew install libreadline-dev

Build

  1. Pull lua virtual machine code
git submodule update --init --recursive
  1. Build luac and zipluac command, collect these commands to tools directory. Then tools directory is build output
./build.sh

Usage

In tools directory

./bytecode.sh [your contract lua file name]

The luac.out.hex file is output file.

Compile example

./bytecode.sh ../examples/hello.lua

LICENSE

See LICENSE file in this project.