Skip to content

bcscb8/tc-wasm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 简体中文

tc-wasm

License Apache 2

Thunder chain wasm virtual machine. Easy to integrate into other
blockchain platforms, support smart contracts written in c/c++.

NOTE: tc-wasm requires Go >= 1.12.x.

Try

  1. cd cmd/tcvm/; go build (Here we get the executable command tcvm)
  2. Open the web page https://catalyst.onethingcloud.com/#/catalyst,
    where you can write a c/c++ contract and copy the compiled wasm bytecode
  3. Save the bytecode to the file contract.wasm, and save the called
    method and parameters to the file contract.params
  4. tcvm -file contract.wasm -call contract.params
  5. Try modifying cmd/tcvm/main.go, repeat steps 1-4, observe and verify
    the results.

Code organization

Directory Description
/cmd A binary tool for quick and easy testing of wasm contracts
/vm Virtual machine
/mock The data structure that needs to be implemented when integrating this
virtual machine. Part of the code is derived from Ethereum
/mock/deps Basic dependencies copied from the Ethereum corresponding directory
/mock/log Implement the log interface
/mock/state Implement global account status interface
/mock/types Implement some basic types of blockchain, such as: address, hash,
block header, etc
/testdata Test contract code and data

About

Thunder chain wasm virtual machine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 46.7%
  • Go 36.2%
  • C++ 7.4%
  • Java 2.5%
  • Python 2.4%
  • Assembly 2.3%
  • Other 2.5%