Skip to content

bazo-blockchain/bazo-vm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bazo Virtual Machine for Smart Contract

Build Status Go Report Card GoDoc

Bazo VM is a stack-based virtual machine to execute smart contract programs on the Bazo blockchain.

Smart contracts can be written in Lazo (a high-level smart contract language) and then compiled to Bazo bytecode (an intermediate language). Bazo-miner executes the bytecode on Bazo VM and persist changes on the blockchain.

Background

The Bazo Blockchain is a blockchain to test diverse mechanisms and algorithms. In the current version mechanisms to run it on mobile devices and Proof of Stake are integrated. It was only possible to transfer Bazo coins before this thesis. The idea of this work was to enhance the Bazo Blockchain with smart contracts.

Documents

Development

Run ./scripts/set-hooks.sh to setup git hooks.

Dependency Management

Packages are managed by Go Modules.

Set the environment variable GO111MODULE=on and run go mod vendor to install all the dependencies into the local vendor directory.

Run Unit Tests

go test ./... 

It will run all tests in the current directory and all of its subdirectories.

To see the test coverage, run ./scripts/test.sh and then open the coverage.html file.

Run Lints

./scripts/lint.sh

It will run golint on all packages except the vendor directory.

Using Bazo VM with Lazo

It is difficult to write Bazo bytecode manually. Therefore, it is recommended to use Lazo language to generate bytecode automatically. To use VM with a Lazo program, run the following command:

lazo run program.lazo

It will generate Bazo bytecode from source code and directly execute it on the VM.