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.
Due to JavaScript's limited floating point precision, all big numbers (numbers with more than 15 significant digits) are returned as strings to prevent precision loss. This includes both the RPC and REST APIs.
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 <0.12, you can start the bitcoind RPC server directly with SSL:
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):
MIT
Link:
GitHub - ander7agar/altcoin-rpc: A modern Bitcoin Core REST ...
- The Great Debate - Bitcoin vs Altcoin - Video [Last Updated On: April 12th, 2014] [Originally Added On: April 12th, 2014]
- Altcoin Bitcoin Trading Bot BTCE, Cryptsy, Mintpal, Poloniex, etc - Video [Last Updated On: April 22nd, 2014] [Originally Added On: April 22nd, 2014]
- UniversityCoin UVC Project Initiatives - New PoS Altcoin 2014 - Video [Last Updated On: May 6th, 2014] [Originally Added On: May 6th, 2014]
- Bitcoin and altcoin speculation - Video [Last Updated On: May 27th, 2014] [Originally Added On: May 27th, 2014]
- Bitcoin Faucet / Altcoin Faucet FREE BITCOINS - Video [Last Updated On: May 29th, 2014] [Originally Added On: May 29th, 2014]
- ULTIMATE ALTCOIN DAYTRADERS SPREADSHEET (The Demo:) - Video [Last Updated On: June 4th, 2014] [Originally Added On: June 4th, 2014]
- Zedomax Compound w/ 300Mh/s Altcoin Farm/Android Gallery! #HighOnAndroid - Video [Last Updated On: June 5th, 2014] [Originally Added On: June 5th, 2014]
- How to Password Protect Your Bitcoin / Altcoin Wallet Backups on a USB Flash Drive - Video [Last Updated On: June 14th, 2014] [Originally Added On: June 14th, 2014]
- Ultimate Altcoin Daytraders Spreadsheet with Portfolio (2of2) - Video [Last Updated On: June 17th, 2014] [Originally Added On: June 17th, 2014]
- Bitcoin Mafia's Altcoin Spotlight for 6/13/14 - SuperCoin [SUPER] - Video [Last Updated On: June 17th, 2014] [Originally Added On: June 17th, 2014]
- Beat boxing before Altcoin panel. - Video [Last Updated On: June 23rd, 2014] [Originally Added On: June 23rd, 2014]
- ALTCOIN GENERATOR - Video [Last Updated On: June 25th, 2014] [Originally Added On: June 25th, 2014]
- NEW FEATURES altcoin daytraders spreadsheet CHARTS CHARTS CHARTS + AUTO PORTFOLIO - Video [Last Updated On: June 28th, 2014] [Originally Added On: June 28th, 2014]
- Create your own Altcoin - by Wideo.co - Video [Last Updated On: June 30th, 2014] [Originally Added On: June 30th, 2014]
- Bitcoin and Altcoin Coin Mining - GoCoin Payment Processor - Video [Last Updated On: July 10th, 2014] [Originally Added On: July 10th, 2014]
- Multisig Coin - Most Secure Altcoin Ever - Video [Last Updated On: July 24th, 2014] [Originally Added On: July 24th, 2014]
- Coin Brief Podcast #8: New York Bitcoin Regulations, Altcoin Value, Mining Decentralization & More - Video [Last Updated On: July 24th, 2014] [Originally Added On: July 24th, 2014]
- AUTO-TRADING - Running the Free Quatloo Trader for the first time (Altcoin Auto-trader software) - Video [Last Updated On: August 1st, 2014] [Originally Added On: August 1st, 2014]
- Bittrex Altcoin Auto-Tracker Demo - Video [Last Updated On: August 1st, 2014] [Originally Added On: August 1st, 2014]
- A great new Altcoin idea..."Gayfishcoin" - Video [Last Updated On: August 6th, 2014] [Originally Added On: August 6th, 2014]
- Altcoin Investment 101: Today's tip - Video [Last Updated On: August 12th, 2014] [Originally Added On: August 12th, 2014]
- Anatomy of an altcoin with Doug Pike of Vericoin - Video [Last Updated On: August 28th, 2014] [Originally Added On: August 28th, 2014]
- Plankton WhaleFOOD - Benefits for Supporters of the FOOD Altcoin - Video [Last Updated On: August 29th, 2014] [Originally Added On: August 29th, 2014]
- Basic Trading Tactics - Bitcoin Trading Bot - Altcoin Trading Bot - Video [Last Updated On: September 25th, 2014] [Originally Added On: September 25th, 2014]
- 2) PREVIOUS TRADES (Ultimate Altcoin Daytraders Spreadsheet) - Video [Last Updated On: October 10th, 2014] [Originally Added On: October 10th, 2014]
- 1) GETTING STARTED/ Entering BTC (Ultimate Altcoin Daytraders Spreadsheet) - Video [Last Updated On: October 10th, 2014] [Originally Added On: October 10th, 2014]
- Updates: Personal, Bitcoin, Altcoin! - Video [Last Updated On: October 11th, 2014] [Originally Added On: October 11th, 2014]
- 4) CONTINUATION TRADES (Ultimate Altcoin Daytraders Spreadsheet) - Video [Last Updated On: October 16th, 2014] [Originally Added On: October 16th, 2014]
- 5) TWEAKS; ICO'S, IPO'S, MINING (Ultimate Altcoin Daytraders Spreadsheet) - Video [Last Updated On: October 23rd, 2014] [Originally Added On: October 23rd, 2014]
- Can an Altcoin Cure Cancer? CureCoin - Video [Last Updated On: October 24th, 2014] [Originally Added On: October 24th, 2014]
- BTC2B - Altcoin disscusion Panel - Video [Last Updated On: November 10th, 2014] [Originally Added On: November 10th, 2014]
- Poker Totty Venus's Weekly Altcoin Flyers And Divers On Gwapex - Video [Last Updated On: November 12th, 2014] [Originally Added On: November 12th, 2014]
- Altcoin & Bitcoin Trade Bot - Slowly Buy and Sell - Video [Last Updated On: November 16th, 2014] [Originally Added On: November 16th, 2014]
- Haasbot 2.0 Beta - Bitcoin Trade Bot, Altcoin Trade Bot, Bitfinex, Huobi,Bittrex,Poloniex and more, - Video [Last Updated On: January 26th, 2015] [Originally Added On: January 26th, 2015]
- Bitcoin / Altcoin Exchange to Other Payment Processors Tutorial - Video [Last Updated On: January 31st, 2015] [Originally Added On: January 31st, 2015]
- What is an altcoin? - Video [Last Updated On: February 4th, 2015] [Originally Added On: February 4th, 2015]
- How To: Altcoin Trades - Video [Last Updated On: February 14th, 2015] [Originally Added On: February 14th, 2015]
- Shocking interview! - In the mind of an altcoin developer - Video [Last Updated On: March 6th, 2015] [Originally Added On: March 6th, 2015]
- How to Pronounce Altcoin - Video [Last Updated On: March 6th, 2015] [Originally Added On: March 6th, 2015]
- Sell Altcoin Part2 - Video [Last Updated On: March 31st, 2015] [Originally Added On: March 31st, 2015]
- WCHangout 12 -- BitTrex -- Altcoin Futures, USD pairs, & #AltsAreBack - Video [Last Updated On: April 21st, 2015] [Originally Added On: April 21st, 2015]
- Armis, picisi, crowdfunding, altcoin, bitcoin, tra - Video [Last Updated On: April 23rd, 2015] [Originally Added On: April 23rd, 2015]
- Bitcoin and Altcoin price charts / graphs [Last Updated On: May 20th, 2015] [Originally Added On: May 20th, 2015]
- Altcoin faucets - Dailycoins.net [Last Updated On: May 23rd, 2015] [Originally Added On: May 23rd, 2015]
- What is an Altcoin? - CryptoCoinsNews [Last Updated On: May 30th, 2015] [Originally Added On: May 30th, 2015]
- Lumbridgecity - Bitcoin and Altcoin Trading Community [Last Updated On: June 13th, 2015] [Originally Added On: June 13th, 2015]
- How to mine dogecoins | Dogecoin Review | Is Doge Coin ... [Last Updated On: July 3rd, 2015] [Originally Added On: July 3rd, 2015]
- The Altcoin Guys - Cryptocurrency Development [Last Updated On: August 17th, 2015] [Originally Added On: August 17th, 2015]
- mining - Is there an altcoin that is only feasible to mine ... [Last Updated On: August 17th, 2015] [Originally Added On: August 17th, 2015]
- Haasbot Bitcoin Bot | Automate Bitcoin and Altcoin Trades [Last Updated On: August 20th, 2015] [Originally Added On: August 20th, 2015]
- Altcoin Forecast [Last Updated On: September 18th, 2015] [Originally Added On: September 18th, 2015]
- The AltcoinBoard - Index [Last Updated On: September 11th, 2016] [Originally Added On: September 11th, 2016]
- Altcoin News [Last Updated On: September 11th, 2016] [Originally Added On: September 11th, 2016]
- My New Best Bitcoin (and altcoin) Wallet Exodus Wallet ... [Last Updated On: October 8th, 2016] [Originally Added On: October 8th, 2016]
- Altcoin News - Daily Cryptocurrency Articles - CoinDesk [Last Updated On: October 16th, 2016] [Originally Added On: October 16th, 2016]
- The Altcoin Report #3: Zcash - Genesis MiningGenesis Mining [Last Updated On: November 14th, 2016] [Originally Added On: November 14th, 2016]
- CoinDesk How to Mine Litecoin - A Guide on Litecoin Mining ... [Last Updated On: November 14th, 2016] [Originally Added On: November 14th, 2016]
- LCF Coin Prelaunch Review: Rothschilds & Chinese govt altcoin? [Last Updated On: February 2nd, 2017] [Originally Added On: February 2nd, 2017]
- The Altcoin Report #4: Litecoin - Genesis Mining [Last Updated On: February 5th, 2017] [Originally Added On: February 5th, 2017]
- Creditbit May Soon Find Itself among the Top 10 Altcoins - NEWSBTC - newsBTC [Last Updated On: February 7th, 2017] [Originally Added On: February 7th, 2017]
- Interest in Bitcoin Services Grows as Altcoin Platforms Lose Traction - The Merkle [Last Updated On: February 13th, 2017] [Originally Added On: February 13th, 2017]
- Crypto Traders Flock to Altcoins Amid Bitcoin Price Malaise ... - CoinDesk [Last Updated On: February 20th, 2017] [Originally Added On: February 20th, 2017]
- Why altcoins are dying and how to make one in under an hour ... [Last Updated On: February 20th, 2017] [Originally Added On: February 20th, 2017]
- What is altcoin? - Definition from WhatIs.com [Last Updated On: February 20th, 2017] [Originally Added On: February 20th, 2017]
- Altcoin Uptick Ends as Bitcoin Prices Pass $1050 - CoinDesk [Last Updated On: February 21st, 2017] [Originally Added On: February 21st, 2017]
- Markets Update: The Top Ten Altcoins Then and Now - Nigeria Today [Last Updated On: February 27th, 2017] [Originally Added On: February 27th, 2017]
- Opinion: What's the Difference Between a Bitcoin Hard Fork and an Altcoin? - CoinJournal (blog) [Last Updated On: February 28th, 2017] [Originally Added On: February 28th, 2017]
- Livecoin, the Fourth Largest Altcoin Exchange, Is Now Available in Eight Languages - Coinspeaker [Last Updated On: March 1st, 2017] [Originally Added On: March 1st, 2017]
- Karbowanec a Ukrainian local altcoin used with mobile top ups - TechAnnouncer (press release) (registration) (blog) [Last Updated On: March 2nd, 2017] [Originally Added On: March 2nd, 2017]
- Bittrex Altcoin Exchange Review - The Merkle [Last Updated On: March 2nd, 2017] [Originally Added On: March 2nd, 2017]
- Livecoin, the Fourth Largest Altcoin Exchange Is Now Available in Eight Languages - Blockchain News [Last Updated On: March 9th, 2017] [Originally Added On: March 9th, 2017]
- Altcoins Make a Comeback in Wake of Bitcoin ETF Decision - The Merkle [Last Updated On: March 13th, 2017] [Originally Added On: March 13th, 2017]
- Bitcoin Dominance Index Crashes Below 80% as Ethereum and Dash Rise - CoinJournal (blog) [Last Updated On: March 14th, 2017] [Originally Added On: March 14th, 2017]
- PoSWallet Offers Online Altcoin Staking and Exchange Services - newsBTC [Last Updated On: March 18th, 2017] [Originally Added On: March 18th, 2017]
- Several Exchanges Face Connectivity Issues During Bitcoin and Altcoin Trading Craze - newsBTC [Last Updated On: March 18th, 2017] [Originally Added On: March 18th, 2017]
- allcoinsnews.com Bitcoin, Altcoin & Blockchain Tech News [Last Updated On: March 21st, 2017] [Originally Added On: March 21st, 2017]
- SpectroCoin Announces Altcoin Support for Bitcoin Debit Cards - Yahoo Finance [Last Updated On: March 22nd, 2017] [Originally Added On: March 22nd, 2017]
- YoCoin Review: Pump and dump altcoin with recruitment [Last Updated On: March 22nd, 2017] [Originally Added On: March 22nd, 2017]
- SpectroCoin Announces Altcoin Support for Bitcoin Debit Cards - PR Newswire (press release) [Last Updated On: March 24th, 2017] [Originally Added On: March 24th, 2017]
- Op-Ed: Will Bitcoin's High Transaction Fees Open the Door for Altcoin Adoption? - CoinJournal (blog) [Last Updated On: March 24th, 2017] [Originally Added On: March 24th, 2017]