Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: BitPiggy on February 11, 2012, 08:57:13 AM



Title: How to publish a transaction after constructed?
Post by: BitPiggy on February 11, 2012, 08:57:13 AM
Hi,

I am using one of the bitcoin Ruby libraries out there (https://github.com/lian/bitcoin-ruby (https://github.com/lian/bitcoin-ruby)) and I can use it to construct a valid transaction, and get the raw data thereof. I want to then publish that transaction to the bitcoin network.

Are there any scripts or tools that can run on a server to publish an arbitrary valid transaction? Does someone offer a service to do as much?

In other words, imagine I had created the following transaction (I just grabbed it from blockexplorer.com), how do I go about publishing it to other bitcoin nodes?

{
  "hash":"a3ac439de09be35adaf9849e37b497c19b23f1f8d832b0a84902f7b0044ed531",
  "ver":1,
  "vin_sz":1,
  "vout_sz":2,
  "lock_time":0,
  "size":259,
  "in":[
    {
      "prev_out":{
        "hash":"3e62a213b7706b14346a710f2a0b95cbf58ebaec6f76286d29526ac8058c171a",
        "n":0
      },
      "scriptSig":"3046022100e0999e9fe9c7b4736fd5dd8907b29b35b0816b8b3103f5b17a8a25eb81d8e8a002210 08090d5f89529667dcdaf1a8bef995ceca30a2e3da4b6c0771325c0dddece45bb01 04ae3bbf874401fdef5001c91a7d6668df16b4517b14e8ede95cef45223496dea7e4fd776083fef 941664417924424891e55a4f77973062d982c644987d3b5936b"
    }
  ],
  "out":[
    {
      "value":"380.00980000",
      "scriptPubKey":"OP_DUP OP_HASH160 34896b26f47edae1ad757ccc7ec248c9aafa3a1b OP_EQUALVERIFY OP_CHECKSIG"
    },
    {
      "value":"49.99020000",
      "scriptPubKey":"OP_DUP OP_HASH160 a2483d6845de9892fb9bf57924b32f6698f1d0f1 OP_EQUALVERIFY OP_CHECKSIG"
    }
  ]
}


Note: I've been told the Ruby library above can do it, but I don't know much about building services that connect to other computers and send data back and forth, and so even after looking at the code I don't understand what I'm supposed to do.

Any help would be greatly appreciated.

Cheers,
~Mat


Title: Re: How to publish a transaction after constructed?
Post by: BitPiggy on February 11, 2012, 10:46:44 PM
Take a look at the subvertx (https://bitcointalk.org/index.php?topic=50721.0) command line tools.

Cheers, I came across subvertx last night, and have been trying to get it to compile on my mac. Hmm, the tools set looks perfect. I'll figure it out for Ubuntu first I guess, and worry about getting it working on my dev machine later.

Thanks again,
~Mat


Title: Re: How to publish a transaction after constructed?
Post by: FreeMoney on February 11, 2012, 10:58:01 PM
http://bitsend.rowit.co.uk/


Title: Re: How to publish a transaction after constructed?
Post by: BitPiggy on February 12, 2012, 12:44:30 AM
Yep, I've seen http://bitsend.rowit.co.uk/ (http://bitsend.rowit.co.uk/).

I was going to say I can't ask my users to copy-paste transactions into that site, but then I realized I can just do a POST to the form.

I think I'll just do that for now. Hopefully rowit.com won't mind if I send a bunch of data their way!

Cheers,
~Mat