Loom application specific side chain software development kit.
Requirements
- Go 1.9+
- Dep
On Mac
brew install dep
and on Linux
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
On Mac
brew install leveldb
and on Linux
apt-get install libleveldb-dev libleveldb1v5
Make sure GOPATH is defined and run
LOOM_SRC=$GOPATH/src/github.com/loomnetwork/loomchain
# clone into gopath
git clone git@github.com:loomnetwork/loomchain.git $LOOM_SRC
# install deps
cd $LOOM_SRC
make deps
make# init the blockchain with builtin contracts
./loom init
# run the node
./loom runUse the genkey command. It will create two files with the given names.
./loom genkey -a publicKeyFilename -k privateKeyFilenameDeploy smart contract with deploy
./loom deploy -a pubkeyFile -k prikeyFile -b contractBytecode.bin
New contract deployed with address: default:0xB448D7db27192d54FeBdA458B81e7383F8641c8A
Runtime bytecode: [96 96 96 64 82 96 .... ]Make a call to an already deployed contract with call
./loom call -a pubkeyFile -k prikeyFile -i inputDataFile -c 0xB448D7db27192d54FeBdA458B81e7383F8641c8A
Call response: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 219]
Details of encoding contract input data can be found in the Solidity ABI documentation.
You can use static-call similarly to run a read only method.
# build the Go plugin for protoc
make protoRead https://developers.google.com/protocol-buffers/docs/reference/go-generated to understand how to use the generated protobuf messages.