Installation Go zeknd SDK

Installing and setting up zeknd

#Use your package manager to install curl

OSX:

brew install curl

Ubuntu / Windows Subsystem for Linux:

sudo apt install curl

#Golang

OSX:

curl -sL -o go1.10.2.darwin-amd64.tar.gz 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

Linux / Windows Subsystem for Linux:

curl -sL -o go1.10.2.linux-amd64.tar.gz https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.2.linux-amd64.tar.gz
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go

#Protobuf

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

OSX:

curl -sL -o protoc-3.5.1-osx-x86_64.zip 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

Linux / Windows Subsystem for Linux:

curl -sL -o protoc-3.5.1-linux-x86_64.zip https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
unzip protoc-3.5.1-linux-x86_64.zip
sudo unzip protoc-3.5.1-linux-x86_64.zip -d /usr/local
sudo chmod +x /usr/local/bin/protoc

#Download zeknd

The following script can be used to automatically download the stable version of zeknd to the current directory:

curl https://raw.githubusercontent.com/zekndnetwork/zeknd-sdk-documentation/master/scripts/get_zeknd.sh | sh

#Installation

Run these in the same directory as the previous step.

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

../../zeknd init
cp ../genesis.example.json genesis.json

#Run Blockchain

../../zeknd run

#Send transactions

Open a second console and run the following commands:

cd blueprint/build
../../zeknd 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

Last updated