Bitcoin Forum
June 23, 2024, 10:16:34 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin RPC problem  (Read 674 times)
luvbcs (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
December 24, 2013, 04:59:05 AM
 #1

I've taken a project called "bitnet" for .NET and added some functions that didn't exist in the API list at the time it was written.  That was straightforward except for createrawtransaction.

Here's an example Gavin used when demonstrating how to create spending transactions for multisig wallets.

createrawtransaction '[{"txid":"3c9018e8d5615c306d72397f8f5eef44308c98fb576a88e030c25456b4f3a7ac","vout":0,"scriptPubKey":"a914f815b036d9bbbce5e9f2a00abd1bf3dc91e9551087","redeemScript":"52410491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db5 5bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f864104865c40293a680cb9c020 e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8 722084861c5c3291ccffef4ec687441048d2455d2403e08708fc1f556002f1b6cd83f992d085097 f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46 21353ae"}]' '{"1GtpSrGhRGY5kkrNz4RykoqRQoJuG2L6DS":0.01}'


What this looks like to me is an array containing one JSON object followed by a JSON object.  There's no indication that last string is part of an array of parameters, and if I do pass it as an element in an array it gives me a server error.

For example, this does not work:

[[{"txid":"31f9b9a76aa82b4fadc5bec05536124f7302e942c4488fa5030f9f34bf35f827","vout":1,"scriptPubKey":"a9141986c0fc06de64d85a8fe0314728de453f38ff2d87","redeemScript":"522103ce8aaa1bb0403148d9327863b40f0abbf9aebac3d7a996866c8a15022a1d5d5d2103be511 208d869328ebcd3b61d3387ee9ad47a0f685a13ab34946e0563203d9ab552ae"}],{"12Z8vEbkfwqm3xytQWYXCALTjRg3cRFEyh":0.005}]

Am I missing something?  I'm new with JSON but everything else has seemed straightforward.
luvbcs (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
December 24, 2013, 03:17:57 PM
 #2

I get the structure, I think. 

Here's maybe a better question:

Can someone give an example of a JSON object that I could pass to the API and be able to successfully create a raw transaction?

Is the format that there is a "params" property with all the inputs in it, and, uniquely, a separate property after that whose name is the send-to address, and value is the send amount?  Every other command uses only elements within the params array, but to look at the format given:

 [{"txid":txid,"vout":n},...] {address:amount,...} 

this would seem to differ.  Has anyone created a raw transaction with the API, or only by shelling out to bitcoind?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!