Sha256: ec6224451bb800d3bcab17d95fd5f015aab4539769c1879e21e97f017d3eb09b

Contents?: true

Size: 397 Bytes

Versions: 6

Compression:

Stored size: 397 Bytes

Contents

#!/usr/bin/env ruby
#
# Relay transaction to the network.
# TODO

require 'socket'
require 'json'

# TODO: use CommandClient

host, port = "127.0.0.1", 9999
if ARGV[0] == "-s"
  host, port = ARGV[1].split(":")
  ARGV.shift; ARGV.shift
end

s = TCPSocket.new("127.0.0.1", 9999)
s.puts ("relay_tx " + ARGF.read.unpack("H*")[0])

res = s.readline
puts JSON::pretty_generate(JSON::parse(res))
s.close

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bitcoin-ruby-0.0.6 examples/relay_tx.rb
bitcoin-ruby-0.0.5 examples/relay_tx.rb
bitcoin-ruby-0.0.4 examples/relay_tx.rb
bitcoin-ruby-0.0.3 examples/relay_tx.rb
bitcoin-ruby-0.0.2 examples/relay_tx.rb
bitcoin-ruby-0.0.1 examples/relay_tx.rb