Title: BitcoinCore: How to use bumpfee command the right way? Post by: SacWheeler on July 04, 2021, 07:00:35 PM Hi
I created a transaction with the RBF option. Now I want to try the bumpfee command and set a specific fee. ./bitcoin-cli bumpfee "Txid" {"fee_rate":20} but it throws an error: Error parsing JSON: {fee_rate: Pleas help. How do I use the options of a bitcoin-cli command properly? Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: khaled0111 on July 04, 2021, 09:14:21 PM What version do you use? For versions older than 0.21 the fee_rate must be in btc per Kvb.
Converting 20 sat/vb gives us 0.0002 btc/Kvb. So if you're using an old version replace 20 by 0.0002 and see if it works. Also make sure that: - the new fee is higher than the original fee plus relay fee. - the change output or inputs in your wallet are enough to cover the difference. Otherwise the transaction will fail. Since version 0.21 the fee rate is in sat/vb, for older versions it's in btc/Kvb Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: hugeblack on July 05, 2021, 02:01:00 AM Hi the right way is ---> bumpfee "txid" ( options ) I created a transaction with the RBF option. Now I want to try the bumpfee command and set a specific fee. ./bitcoin-cli bumpfee "Txid" {"fee_rate":20} but it throws an error: Error parsing JSON: {fee_rate: Pleas help. How do I use the options of a bitcoin-cli command properly? The options you are allowed to use this instruction are shown in the link below. https://chainquery.com/bitcoin-cli/bumpfee The error is caused by the use of a statement that is not among those options. Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: nc50lc on July 05, 2021, 02:58:54 AM ./bitcoin-cli bumpfee "Txid" {"fee_rate":20} The error indicates that the json object was constructed incorrectly.but it throws an error: Error parsing JSON: {fee_rate: If you want to add an optional "fee_rate", you just have to enclose it with either a single quotation marks or alternate the use of \" and ". Examples: Code: bumpfee "TXID" '{"fee_rate":20}' Code: bumpfee "TXID" "{\"fee_rate\":20}" https://chainquery.com/bitcoin-cli/bumpfee Chainquery's bitcoin RPC is based from v0.18, which is quite outdated.The error is caused by the use of a statement that is not among those options. You can refer to: https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/bumpfee/ (https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/bumpfee/) for the updated options. Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: NotATether on July 05, 2021, 07:12:03 AM Code: bumpfee "TXID" '{"fee_rate":20}' This will not work on Windows CMD because the single quotes are not interpreted as combining all the characters together into one string. This is particularly a problem for JSON because commas are treated the same as spaces for parsing delimiters. You have to use the double-quote version, or use Powershell instead. Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: nc50lc on July 05, 2021, 08:09:41 AM This will not work on Windows CMD because the single quotes are not interpreted as combining all the characters together into one string. This is particularly a problem for JSON because commas are treated the same as spaces for parsing delimiters. You have to use the double-quote version, or use Powershell instead. I suppose he's not using Windows CMD because his original command starts with "./" which wont work in it.AFAIK the first example won't work in PowerShell either, just the other option but instead of "{\"fee_rate\":20}", should be: '{\"fee_rate\":20}' in PowerShell. It's better if he mentioned his OS, right? Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: SacWheeler on July 05, 2021, 11:14:38 AM Tanks for all the replies! It makes sense that the error is coming from an incorrectly constructed json object.
I am using MacOS 11.4 and BitcoinCore 0.21.1. So how do I use the options for a command on my system correctly? Code: bumpfee "TXID" '{"fee_rate":20}' Code: bumpfee "TXID" "{\"fee_rate\":20}" Thanks for your help Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: nc50lc on July 05, 2021, 12:39:14 PM Tanks for all the replies! It makes sense that the error is coming from an incorrectly constructed json object. I'm not using Mac but the best way to find out which will work is to try them.I am using MacOS 11.4 and BitcoinCore 0.21.1. So how do I use the options for a command on my system correctly? Use it the way you're using bitcoin-cli, just fix the last part (the json object) where you missed a few quotation marks. Code: ./bitcoin-cli bumpfee "TXID" "{\"fee_rate\":20}" Title: Re: BitcoinCore: How to use bumpfee command the right way? Post by: SacWheeler on July 05, 2021, 01:06:41 PM I can confirm that both variations are working on my system
Code: bitcoin-cli bumpfee "TXID" '{"fee_rate":20}' Code: bitcoin-cli bumpfee "TXID" "{\"fee_rate\":20}" Thanks for the support :) |