Skip to content

HOW TO INSTALL API RECEIVE

mileschet edited this page Aug 22, 2014 · 5 revisions

##GIT CLONE BLINKTRADE

# cd /opt
# git clone https://github.com/blinktrade/bitex.git ${PROJECT}

##BUILD BITCOIN FROM SOURCE

# echo "deb http://http.debian.net/debian/ oldstable main" >> /etc/apt/sources.list
# apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
# apt-get install libdb4.8-dev libdb4.8++-dev 
# apt-get install libboost-all-dev
# cd /opt
# git clone https://github.com/bitcoin/bitcoin.git
# ./autogen.sh
# ./configure
# make
# make install

##SETUP testnet FOR BITCOIND

At this time you should have a bitcoin working properly, what we are going to do is to change the bitcoin.conf to use testnet.

Change your ~/.bitcoin/bitcoin.conf, to looks like this, don't forget to replace ${RPC USER} and ${RPC PASSWORD}:

Running Bitcoin from official wiki

# You must set rpcuser and rpcpassword to secure the JSON-RPC api
rpcuser=${RPC USER}
rpcpassword=${RPC PASSWORD}
 
#testnet=1
listen=1
daemon=1
server=1

rpcallowip=127.0.0.1
rpcconnect=127.0.0.1
walletnotify=/usr/bin/curl http://localhost:9943/api/walletnotify/%s
blocknotify=/usr/bin/curl http://localhost:9943/api/blocknotify/%s

CHECK BITCOIND

You can check the options using bitcoin-cli help command.

# bitcoin-cli -conf=~/.bitcoin/bitcoin.conf getinfo
# bitcoin-cli -conf=~/.bitcoin/bitcoin.conf getnetworkinfo
# bitcoin-cli -conf=/root/.bitcoin/bitcoin.conf getwalletinfo

##SETUP API_RECEIVE

API RECEIVE is a service that works with BITCOIN to process payments,

db_engine = "sqlite:////opt/${PROJECT}/db/api_receive.sqlite"
log = "/opt/${PROJECT}/logs/api_receive.log"
port = 9943
rpc_url = "http://localhost:18332"
rpc_username = "your username here"
rpc_password = "your password here"

Change your nginx.conf:

http {

  map $http_upgrade $connection_upgrade {
    default  upgrade;
    ''       close;
  }

  upstream ws_${PROJECT}_gateway {
    server   localhost:9943; 
  }

}
Clone this wiki locally