A modern Altcoin Core REST and RPC client to execute administrative tasks, wallet operations and queries about network and the blockchain.
Install the package via npm:
The network will automatically determine the port to connect to, just like the bitcoind and bitcoin-cli commands.
By default, when ssl is enabled, strict checking is implicitly enabled.
For compatibility with other Altcoin Core clients.
Since version v0.14.0, it is possible to send commands via the JSON-RPC interface using named parameters instead of positional ones. This comes with the advantage of making the order of arguments irrelevant. It also helps improving the readability of certain function calls when leaving out arguments for their default value.
For instance, take the getBalance() call written using positional arguments:
It is functionally equivalent to using the named arguments account and minconf, leaving out include_watchonly (defaults to false):
This feature is available to all JSON-RPC methods that accept arguments.
By default, all methods are exposed on the client independently of the version it is connecting to. This is the most flexible option as defining methods for unavailable RPC calls does not cause any harm and the library is capable of handling a Method not found response error correctly.
However, if you prefer to be on the safe side, you can enable strict version checking. This will validate all method calls before executing the actual RPC request:
If you want to enable strict version checking for the bleeding edge version, you may set a very high version number to exclude recently deprecated calls:
To avoid potential issues with prototype references, all methods are still enumerable on the library client prototype.
Start the bitcoind with the RPC server enabled and optionally configure a username and password:
These configuration values may also be set on the bitcoin.conf file of your platform installation.
By default, port 8332 is used to listen for requests in mainnet mode, or 18332 in testnet or regtest modes. Use the network property to initialize the client on the desired mode and automatically set the respective default port. You can optionally set a custom port of your choice too.
The RPC services binds to the localhost loopback network interface, so use rpcbind to change where to bind to and rpcallowip to whitelist source IP access.
All RPC methods are exposed on the client interface as a camelcase’d version of those available on bitcoind.
For a more complete reference about which methods are available, check the RPC documentation on the Altcoin Core Developer Reference website.
Batched requests are support by passing an array to the command method with a method and optionally, parameters. The return value will be an array with all the responses.
Note that batched requests will only throw an error if the batch request itself cannot be processed. However, each individual response may contain an error akin to an individual request.
Support for the REST interface is still experimental and the API is still subject to change. These endpoints are also unauthenticated so there are certain risks which you should be aware, specifically of leaking sensitive data of the node if not correctly protected.
Error handling is still fragile so avoid passing user input.
Start the bitcoind with the REST server enabled:
These configuration values may also be set on the bitcoin.conf file of your platform installation. Use txindex=1 if you’d like to enable full transaction query support (note: this will take a considerable amount of time on the first run).
Given a block hash, returns a block, in binary, hex-encoded binary or JSON formats.
Given a block hash, returns amount of block headers in upward direction.
Returns various state info regarding block chain processing.
Returns transactions in the transaction memory pool.
Returns various information about the transaction memory pool. Only supports JSON as output format.
Given a transaction hash, returns a transaction in binary, hex-encoded binary, or JSON formats.
Query unspent transaction outputs (UTXO) for a given set of outpoints. See BIP64 for input and output serialisation.
This client supports SSL out of the box. Simply pass the SSL public certificate to the client and optionally disable strict SSL checking which will bypass SSL validation (the connection is still encrypted but the server it is connecting to may not be trusted). This is, of course, discouraged unless for testing purposes when using something like self-signed certificates.
Please note that the following procedure should only be used for testing purposes.
Generate an self-signed certificate together with an unprotected private key:
On Altcoin Core
On Altcoin Core >0.12, use must use stunnel (brew install stunnel or sudo apt-get install stunnel4) or an HTTPS reverse proxy to configure SSL since the built-in support for SSL has been removed. The trade off with stunnel is performance and simplicity versus features, as it lacks more powerful capacities such as Basic Authentication and caching which are standard in reverse proxies.
You can use stunnel by configuring stunnel.conf with the following service requirements:
The key option may be omitted if you concatenating your private and public certificates into a single stunnel.pem file.
On some versions of stunnel it is also possible to start a service using command line arguments. The equivalent would be:
Then pass the public certificate to the client:
By default, all requests made with altcoin-rpc are logged using uphold/debugnyan with altcoin-rpc as the logging namespace.
Please note that all sensitive data is obfuscated before calling the logger.
Example output defining the environment variable DEBUG=altcoin-rpc:
A custom logger can be passed via the logger option and it should implement bunyan’s log levels.
Currently the test suite is tailored for Docker (including docker-compose) due to the multitude of different bitcoind configurations that are required in order to get the test suite passing.
To test using a local installation of node.js but with dependencies (e.g. bitcoind) running inside Docker:
To test using Docker exclusively (similarly to what is done in Travis CI):
- Garzik Forks UnitedBitcoin Away from "Maximalists" to Support Altcoin ... - April 13th, 2018
- Bitcoin, Altcoin and Cryptography explained - April 4th, 2018
- ZClassic and the Bitcoin Private fork : altcoin - March 4th, 2018
- Altcoin Trustworthy Decentralized Cryptocurrency Exchange? - March 4th, 2018
- Blockfolio Bitcoin Altcoin App on the App Store - March 4th, 2018
- Morning Asian Altcoin Trading Roundup: the leader is Tron - February 28th, 2018
- Webinar: Bitcoin Overshadowed by Altcoin Surge - Nasdaq.com - February 12th, 2018
- Bitcoin Mine News Bitcoin & Altcoin Mining & Trading News - January 7th, 2018
- Ethereum, Litecoin Prices Headline $20 Billion Altcoin Rally - January 7th, 2018
- What is an Altcoin? - CryptoCurrency Facts - January 4th, 2018
- What is an Altcoin? - ccn.com - December 20th, 2017
- Trading Bitcoin for an Altcoin Won't Shield You From the IRS ... - December 20th, 2017
- Buy or Sell Bitcoin, Litecoin, Altcoin Multi Crypto Currency ... - December 20th, 2017
- Altcoin Exchange Performs First Atomic Swap Between Bitcoin ... - December 6th, 2017
- Altcoins - BTCMANAGER - November 28th, 2017
- Markets Update: Bitcoin Bull-Run Primes Altcoin Markets for ... - November 25th, 2017
- Altcoin Exchange, the Decentralized Cryptocurrency Exchange ... - October 17th, 2017
- Altcoin Watchlist | Meet & Learn Cryptocurrencies - October 4th, 2017
- CryptoCurrency Investing: Research and Due-Diligence ... - September 6th, 2017
- ATC Coin Review: ATCC altcoin with massively inflated ... - September 5th, 2017
- JRM Altcoin Update - Quit chasing the headlines! - YouTube - September 4th, 2017
- Bitcoin Cash Statistics Confirm BCH is Just Another Altcoin - Live Bitcoin News - September 2nd, 2017
- Which Altcoins to Buy This Week? (31st of August, 2017) - Live Bitcoin News - September 1st, 2017
- OpenBazaar Developers May Introduce Altcoin Support in the Near Future - The Merkle - August 27th, 2017
- Exante launches XAI, the world's first altcoin fund - GlobeNewswire (press release) - August 25th, 2017
- ALTCOIN | Bitcoin Insider - August 23rd, 2017
- Altcoin Forum - Alternative Cryptocurrecies Location - August 23rd, 2017
- Op Ed: Drivechains Could Kill Off the Altcoin Market - August 22nd, 2017
- Nakamoto Institute Daniel Krawisz: I Don't Like Altcoins, but I Like Forks - Bitcoin News (press release) - August 22nd, 2017
- Bithumb, Highest Volume Exchange Globally, Adds Monero - Inside Bitcoins - August 22nd, 2017
- One-Man Band To Create The Second Altcoin Forum In The World - Coin Idol (press release) - August 18th, 2017
- When altcoin life imitates art - FT Alphaville (registration) - August 14th, 2017
- ALTCOIN CAPITAL - Trusted Crypto Traders - August 12th, 2017
- Overstock Now Accepts Various Altcoins for Payment - Including ... - Bitcoin News (press release) - August 10th, 2017
- What are Altcoins and ICOs Bitcoin Whiteboard Tuesday - 99 Bitcoins (blog) - August 9th, 2017
- Cryptocurrency Symbol BCC Belongs to BitConnect Coin, Not Bitcoin Cash - Markets Insider - August 8th, 2017
- Crypto-Startup Hubcoin Announces Distribution of Pre-Mined HUB to Altcoin Developers - Bitcoinist - August 3rd, 2017
- This Altcoin Is Ready to Challenge Bitcoin's Domination of the ... - Futurism - July 31st, 2017
- Beginning of altcoin's end: US signals digital coins may be subject to federal securities law - CalvinAyre.com - July 31st, 2017
- All Major Indian Exchanges Reject Bitcoin Cash Completely - Live Bitcoin News - July 31st, 2017
- Global Advisors Launches ICO and Altcoin Closed-End Private Fund - Finance Magnates - July 31st, 2017
- USING ALTCOIN TRADER - rsainvestments.blogspot.co.za - Google - July 9th, 2017
- Payza Commits to Cryptocurrency: Unveils Full Bitcoin Services, Introduces Altcoin Exchanges - CoinDesk - July 7th, 2017
- What is an Altcoin? Bitcoin Magazine - July 7th, 2017
- CryptoPing completes $2.5 million ICO to further develop altcoin trading intel bot - CryptoNinjas - July 4th, 2017
- Saturday Slump: Ethereum, Bitcoin Prices Headline Crypto Market Downturn - CryptoCoinsNews - July 1st, 2017
- Monday Massacre: Bitcoin, Ethereum Lead the Way as Cryptocurrencies Retreat into the Red - CryptoCoinsNews - June 26th, 2017
- Altcoin signal app CryptoPing set to conclude ICO with over $1m already raised - CryptoNinjas - June 25th, 2017
- EasyMINE: Altcoin Mining for Everyone - Coin Idol (press release) - June 22nd, 2017
- Altcoin 2017 Forecast: Litecoin (LTC), Peercoin (PPC ... - June 18th, 2017
- Which Altcoins To Buy This Week (16th of June, 2017) - Live Bitcoin News - June 17th, 2017
- Bitcoin Altcoin Trader Price Analysis - June 13th, 2017
- 'Real Businesses are Using Waves', Says Rep as Altcoin Crosses $600 Million Market Cap - CryptoCoinsNews - June 11th, 2017
- Altcoin Definition | Investopedia - June 9th, 2017
- Top 6 Altcoin Exchanges you may Have Never Heard of - The Merkle - June 8th, 2017
- Which Altcoins To Buy This Week (6th of June, 2017)? - Live Bitcoin News - June 6th, 2017
- Altcoin intel bot CryptoPing ICO now live - CryptoNinjas - June 5th, 2017
- Bitcoin (BTC), Ethereum Just The Tip Of The Iceberg For Cryptocurrencies - ETF Daily News (blog) - May 30th, 2017
- All Top 20 Altcoins Fall By At Least 30%, Ripple Down to $6.2 Billion - CryptoCoinsNews - May 28th, 2017
- CryptoPing, the Cryptocurrency Bot that Monitors Altcoin Markets. ICO in 48 Hours! - FinSMEs (blog) - May 24th, 2017
- Which Altcoins To Buy This Week? (May 22nd, 2017) - Live Bitcoin News - May 24th, 2017
- Altcoin Price Increases and How CryptoPing May Help Traders - The Merkle - May 24th, 2017
- Another crypto bubble and the rise of altcoin markets - Brave New Coin - May 15th, 2017
- CryptoPing Altcoin Intelligence Bot Announces ICO - The Merkle - May 15th, 2017
- What is crypto-currency? Learn everything you need to know. - May 10th, 2017
- Which Altcoins to Buy This Week? (May 8th, 2016) - Live Bitcoin News - May 8th, 2017
- Altcoin Market Takes A Hit and Bounces Back Amid US$3bn Trading Spree - Live Bitcoin News - May 8th, 2017
- Total Cryptocurrency Market Cap Inches Closer Toward US$40bn ... - newsBTC - May 2nd, 2017
- Bitcoin Price is Once Again Above Gold Despite 'Altcoin Bubble ... - Inside Bitcoins - April 26th, 2017
- Altcoins Planning Segwit Integration Experience Price Pumps - Nigeria Today - April 26th, 2017
- Poloniex Altcoin Exchange Review - The Merkle - April 25th, 2017
- Ether Price Analysis: ETH Altcoin Dominance Continues - Bitcoin Magazine - April 21st, 2017
- Altcoiner Lets All Bitcoin Holders Earn A Daily Passive Income By Trading Altcoins - newsBTC - April 12th, 2017
- PIVX Growth Not Influenced by Dash nor Bitcoin in Altcoin Swell - CryptoCoinsNews - April 11th, 2017
- Altcoins See Their Value Go Up As They Inch Closer to Activating SegWit - Live Bitcoin News - April 10th, 2017
- Decred Benefits From Bitcoin Impasse, Joins Altcoins' Rise - CryptoCoinsNews - April 8th, 2017
- Altcoin-Fiat Trading Rises, BitPanda Adds Dash-Euro Trading - CoinTelegraph - April 2nd, 2017
- Ripple Price Surge Continues, Altcoin Takes Advantage Of Bitcoin Scaling Troubles - CoinTelegraph - April 2nd, 2017
- SpectroCoin Announces Altcoin Support for Bitcoin Debit Cards - AllCoinsNews.com (blog) - March 28th, 2017
- Top 3 Altcoin Pumpers in History - The Merkle - March 28th, 2017