Installing and setting up Loom on OSX

wget

brew install wget

Golang

wget https://dl.google.com/go/go1.10.2.darwin-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.2.darwin-amd64.tar.gz
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
mkdir ~/gopath
export GOPATH=~/gopath
*Add GOPATH to your bashrc  or zshrc

or install Golang from brew

brew install go

Protobuf

https://github.com/google/protobuf/releases/

wget https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-osx-x86_64.zip
unzip protoc-3.5.1-osx-x86_64.zip
sudo unzip protoc-3.5.1-osx-x86_64.zip -d /usr/local
sudo chmod +X /usr/local/bin/protoc
export GOPATH=~/gopath
go get -u github.com/golang/protobuf/protoc-gen-go

Dep

$ brew install dep
$ brew upgrade dep

Installation

wget https://downloads.loomx.io/loom/osx/stable/loom
chmod +x loom

mkdir tmpgopath
export GOPATH=`pwd`/tmpgopath
./loom spin weave-blueprint
cd blueprint
export GOPATH=$GOPATH:`pwd`
make deps
make
cd build

../../loom init
cp ../genesis.example.json genesis.json

Run Blockchain

../../loom run

Send transactions

Open a second console and run the following commands:

cd blueprint/build
../../loom genkey -k priv_key -a pub_key
./blueprint call create-acct -p priv_key

This will generate a private key and create an account.

Next, let's set a value:

./blueprint call set -v 1 -p priv_key

and read it:

./blueprint call get

You can read the source of the blueprint contract here