-
Notifications
You must be signed in to change notification settings - Fork 15
External Tutorial Setup
hao edited this page Sep 18, 2020
·
1 revision
This tutorial will help you setup the develop environment for OneLedger Blockchain Network.
Ensure your system meets the following requirements:
Operating System must be one of the following:
- macOS
- Ensure Xcode Developer Tools is installed(only command line version is needed)
- A Debian-based Linux distribution
- Ubuntu is recommended for the smoothest install, otherwise you will have to set up your distribution for installing PPAs
- Go version 1.11 or higher
- git
Use which go
to check where Golang is installed
In your .bashrc
or .zshrc
file, set up environment variables as below:
export GOPATH="folder for all your Golang project"
export PATH=$PATH:$GOPATH/bin
export GO111MODULE=auto
export GOROOT="folder where Golang is installed"
export OLROOT="$GOPATH/src/github.com/Oneledger"
export OLTEST="$OLROOT/protocol/node/scripts"
export OLSCRIPT="$OLROOT/protocol/node/scripts"
export OLSETUP="$OLROOT/protocol/node/setup"
export OLDATA="$GOPATH/test"
and source it(choose .bashrc
or .zshrc
that you are using)
source ~/.bashrc
For Ubuntu:
sudo apt-get update
sudo apt install build-essential
sudo apt-get install libsnappy-dev
wget https://github.com/google/leveldb/archive/v1.20.tar.gz && \
tar -zxvf v1.20.tar.gz && \
cd leveldb-1.20/ && \
make && \
sudo cp -r out-static/lib* out-shared/lib* /usr/local/lib/ && \
cd include/ && \
sudo cp -r leveldb /usr/local/include/ && \
sudo ldconfig && \
rm -f v1.20.tar.gz
For MacOS:
brew install leveldb
cd $OLPATH
git clone github.com/Oneledger/protocol
cd ./protocol
git checkout develop
git checkout -b name-of-your-branch
make update
make install_c
If no error occurs, you are good to go.
You can use Goland or VScode. For Goland, it comes with a 30-day trial.
© OneLedger 2018-2020 Contact Information