Bitmessage API Ruby Wrapper
Thin API wrapper for the official BitMessage Python client. This gem is based on the original library created by robzon.
Requirements
Running Bitmessage client with API enabled.
Usage
require 'bitmessage'
api = Bitmessage::ApiClient.new 'http://user:password@host:port/'
api.add 3, 5
Getting a list of messages
inbox = api.
puts "You have #{inbox.count} messages:"
inbox.each do |msg|
puts "#{msg.msgid} #{msg.from} #{msg.subject}"
end
Sending a message
to = "BM-orkCbppXWSqPpAxnz6jnfTZ2djb5pJKDb" # echo service
from = api.list_addresses.first.address
api. to, from, "This is subject", "This is message"
Running the tests
For tests to to pass it is necessary to set the BM_URI environment
variable. For example:
BM_URI=http://user:password@host:port/ rake test
FAQ
Q: Does this cover 100% of the API?
A: Not yet.