No longer maintained
The CryptoTerminal app no longer requires the CT-API-Server to function. The app now communicates directly with ElectrumX servers.
API server for the CryptoTerminal mobile application.
- Public API Documentation:
The ct-api-server is a Node.js application that can be run locally (for testing) or on your own publicly accessible server.
The requirements differ based on the cryptocurrencies that you wish to support.
- nodejs - For Linux and Mac install node via nvm.
- For Bitcoin:
- For Litecoin:
- electrum-ltc - Used for the following:
- Getting unspent transaction outputs
- Getting the current network fee rate estimate
- Broadcasting raw transactions
- litecoind - Used for receiving real-time transactions.
- electrum-ltc - Used for the following:
Download the project files via git:
git clone https://github.com/samotari/ct-api-server.git
Install the project's dependencies:
cd ct-api-server
npm install
The electrum RPC interface is used to get unspent transaction outputs, fee rate, and broadcast raw transactions. If you have not already done so, download and install electrum. Once you've got that, you will need to configure your RPC settings:
electrum --testnet setconfig rpcuser "user" \
electrum --testnet setconfig rpcport 7777 \
electrum --testnet setconfig rpcpassword "replace with something better"
Then start the electrum daemon:
electrum --testnet daemon start
You can use the same steps above to configure and start an electrum daemon for Bitcoin mainnet as well as use electrum-ltc to query the Litecoin network.
Below are example environment variables for an instance of the ct-api-server:
CT_API_SERVER_ELECTRUM='{"bitcoinTestnet":{"uri":"http://localhost:7777","username":"user","password":"replace with something better"}}';
CT_API_SERVER_ZEROMQ='{"bitcoinTestnet":[{"dataUrl":"tcp://127.0.0.1:7000"}]}';
Bitcoin core (bitcoind) is used to stream transactions in real-time to the ct-api-server. Use the following guide to install and configure bitcoind:
The above guide can also be used with litecoind.
To run all tests:
npm test
This project is licensed under the GNU Affero General Public License v3 (AGPL-3.0).