Step-By-Step Instructions for Exchanges¶
We here describe how to interface your exchange with BitShares step-by-step. We will link to a more detailed description where appropriate.
In this step-by-step instruction we assume you have successfully built from the sources according to:
Running Daemons and Wallet¶
For security reasons we will run two daemons and a wallet according to these diagram:
In this tutorial we will run all deamons and the wallet on the same machine and use different ports to distinguish them:
8090: trusted full node
8091: delayed node
Trusted Full Node¶
The trusted full node is your entry point to the BitShares P2P network. It will hold the blockchain, connect to other peers, and will receive new blocks in real-time.
./programs/witness_node/witness_node --data-dir=trusted_node/ --rpc-endpoint="127.0.0.1:8090"
Until the genesis block is integrated into the binary/souces, you may
additionally need to download the genesis block from github and add the
--genesis-json <genesis.json>. (See Release Page)
Unless the seed nodes are encoded into the binary, you may need to add
a known seed node with
-s xxx.xxx.xxx.xxx:yyy in order to initially
connect to the P2P network. (See Release Page)
To start a node with reduced RAM please see Memory reduction for nodes
The delayed full node node will provide us with a delayed and several times confirmed and verified blockchain. All transactions that are confirmed by the delayed node are irreversible.
./programs/delayed_node/delayed_node --trusted-node="127.0.0.1:8090" \ --rpc-endpoint="127.0.0.1:8091" -d delayed_node \ -s "0.0.0.0:0" \ --p2p-endpoint="0.0.0.0:0" \ --seed-nodes ""
We will use this node for notifications of customer deposits.
The wallet will be used to transfer assets to the customers. It connects to the trusted full node and has spending privileges for the hot wallet.
./programs/cli_wallet/cli_wallet --server-rpc-endpoint="ws://127.0.0.1:8090" \ --rpc-http-endpoint="127.0.0.1:8092"
Query blockchain for required data¶
We now use the open
cli_wallet to issue transfers and query the blockchain
for more information. First of all, we create a new wallet and set a pass phrase::
>>> set_password <password>
Watching Deposits with Python¶
For watching deposits, we recommend pybitshares’ Notify module. The full documentation is available on pybitshares.com.