Bitcoin Forum
May 02, 2024, 11:44:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / getting JSON errors with createrawtransaction using python and python-bitcoinrpc on: August 09, 2021, 09:57:26 PM
Hi

I am working on a python script using python-bitcoinrpc (https://github.com/jgarzik/python-bitcoinrpc).
Cofiguration is working and rpc.commands get executed.
But I am running into an error with "createrawtransaction".

I try
Code:
createrawtransaction(inputs, outputs, 0, True)
Error: "-1: JSON value is not a string as expected"

for the inputs and outputs I've set correspontig variables as lists, containing a dictionary/dictionaries with the relevant key:value pairs.
inputs: [
    {
         'tixid': 'c1636efe3d85e3bb7e58663cfa976590ed1a9bb6740e7b851cbb34ab63f52ab9',
         'vout': 2,
         'sequence': 4294967293
    }
]

outputs: [
    {
        'bc1q5q5e95h3z0eymfwasm2whx2jrztqa8sy012345': 0.012345
    },
    {
        'bc1q2gphxxpm7aetec0m7jpd04e342c5hree543210': 0.054321
    }
]


I tried to set all values as str() instead of float() or int(). Stille get the error "-1: JSON value is not a string as expected"...

I tried
Code:
createrawtransaction(json.dumps(inputs), json.dumps(outputs), 0, True)
Error: "expected type array, got string"
it seams like "createrawtransaction" does not accept the string value produced by json.dumps()....


As far as I can tell, my json array for the inputs and outputs are formated as described by https://bitcoincore.org/en/doc/0.21.0/rpc/rawtransactions/createrawtransaction/

What am I missing??
It almost looks like the python strings in my lists do not appear as strings to the bitcoin-cli.



I am running BitcoinCore 0.21.1, MacOs 11.4, python 3.9.4
2  Bitcoin / Bitcoin Technical Support / bumpfee for transaction with specified changePosition on: July 06, 2021, 02:31:29 PM
Hi

To create a transaction with multiple outputs, I am using the command decoderawtransaction and fundrawtransaction with {changePosition} to have my change address as the last output in the list (this is important).

The transaction above is created as RBF. If I use the bumpfee command, the changeaddress gets randomly set in the output list.
How can I bump the fee of such a transaction and ensure the change position is still the last output of the transaction. Or is there a bumpfee command where I can specify the changePosition as in fundrawtransaction?

Running MacOs 11.4 and BitcoinCore 0.21.1
3  Bitcoin / Bitcoin Technical Support / BitcoinCore: How to use bumpfee command the right way? 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?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!