Skip to content

Instantly share code, notes, and snippets.

View sorawit's full-sized avatar

Sorawit Suriyakarn sorawit

View GitHub Profile
pragma solidity 0.5.0;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @title Equation
*
* @dev Equation library abstracts the representation of mathematics equation.
* As of current, an equation is basically an expression tree of constants,
apt-get update -y
apt-get upgrade -y
apt-get install -y build-essential
wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz
tar -xvf go1.13.7.linux-amd64.tar.gz
mv go /usr/local/
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
source ~/.profile
apt-get update -y
apt-get upgrade -y
apt-get install -y build-essential git wget curl jq
wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz
tar -xvf go1.13.7.linux-amd64.tar.gz
mv go /usr/local/
echo "export GOROOT=/usr/local/go" >> ~/.bashrc
echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y wget
# Install bandd, change its permission, and move to /usr/local/bin
wget -O bandd https://github.com/bandprotocol/bandchain/releases/download/v0.2.0-rc/bandd_linux_amd64
chmod +x bandd
sudo mv bandd /usr/local/bin
# Install bandcli, change its permission, and move to /usr/local/bin
wget -O bandcli https://github.com/bandprotocol/bandchain/releases/download/v0.2.0-rc/bandcli_linux_amd64
chmod +x bandcli
sudo mv bandcli /usr/local/bin
# Create a new Band wallet. Do not lose your mnemonic!
bandcli keys add [[YOUR_WALLET]]
# Initialize a blockchain environment for generating genesis transaction.
bandd init --chain-id band-wenchang-testnet2 [[YOUR_MONIKER]]
# Add your account as a genesis account so gentx won't complain.
bandd add-genesis-account $(bandcli keys show [[YOUR_WALLET]] -a) 1000000uband
# Create your genesis transaction with 1000000uband initial staking.
# Download genesis file from the repository.
wget https://raw.githubusercontent.com/bandprotocol/launch/master/band-wenchang-testnet2/genesis.json
# Move the genesis file to the proper location
mv genesis.json $HOME/.bandd/config
# OPTIONAL: Set minimum gas price to 0.005uband
# sed -E -i \
# 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.005uband\"/' \
# $HOME/.bandd/config/app.toml
[Unit]
Description=BandChain Node Daemon
After=network-online.target
[Service]
User=ubuntu
ExecStart=/usr/local/bin/bandd start
Restart=always
RestartSec=3
LimitNOFILE=4096
sudo systemctl enable bandd
sudo systemctl start bandd
# Install bandd, change its permission, and move to /usr/local/bin
wget -O bandd https://github.com/bandprotocol/bandchain/releases/download/v0.2.0-rc2/bandd_linux_amd64
chmod +x bandd
sudo mv bandd /usr/local/bin
# Install bandcli, change its permission, and move to /usr/local/bin
wget -O bandcli https://github.com/bandprotocol/bandchain/releases/download/v0.2.0-rc2/bandcli_linux_amd64
chmod +x bandcli
sudo mv bandcli /usr/local/bin