Dev Null Productions

XRBP - The Ultimate XRP / Ruby Interface

Dev Null Productions is pleased to announce the general availability of XRBP a library aimed at providing an accessible, fault-tolerant interface to the XRP ledger. XRBP allows the developer to read and write data to/from the XRP network in real time, synchronizing ledger data including accounts, transactions, objects, and more. Data is presented via both synchronous and asynchronous mechanisms with multiple-connection load balancing and fault tolerance baked in behind the scenes.

But some code is worth a 1000 words! The following allows you to pull server info pertaining to the instance of rippled you are connected to:

require 'xrbp'

ws = XRBP::WebSocket::Connection.new "wss://s1.ripple.com:443"
ws.add_plugin :autoconnect, :command_dispatcher

ws.cmd XRBP::WebSocket::Cmds::ServerInfo.new

Above we see

  • the XRBP library is included
  • a new websocket connection to s1.ripple.com is established
  • and the ServerInfo command is dispatched and the results printed

To facilitate fully-customizable and configurable applications XRBP incorporates a pluggable architecture where modules customizing the request/response workflow and validating/transforming result sets may be registed with connection objects. As of the current date, plugins exist to:

  • Automatically timeout inactive connections and reestablish the link
  • Automatically retry failed requests (with configurable max tries and timeout)
  • Allow the user to register custom data parsers to transform received data
  • Paginate results behind the scenes so large data sets (transactions, account objects, etc) can all be seemlessly retrieved and aggregated before the results are returned
  • Dispatch and validate XRP specific commands, extracting specific data out of the result set for client consumption

Furthemore XRBP facilitates fault tolerant communications by implementing serveral multi-connection strategies behind these scenes. Each strategy manages an internal pool of connections and cycles through them according to different criteria.

To use multiple XRP servers in a 'round-robin' manner where subsequent connections will always be delegated to the next connection in the list:

ws = XRBP::WebSocket::RoundRobin.new "wss://s1.ripple.com:443",
                                     "wss://s2.ripple.com:443"

ws.add_plugin :command_dispatcher
ws.connect

puts ws.cmd(XRBP::WebSocket::Cmds::AccountInfo.new("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"))
puts ws.cmd(XRBP::WebSocket::Cmds::AccountInfo.new("rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"))

In the above example we will retrieve info pertaining to the first account (rvYAf...) from s1.ripple.com and the second account (rhub8...) from s2.ripple.com. With the RoundRobin strategy, once all connections are used, we will cycle back to the first, in this case the next request will be issued to s1.ripple.com.

To automatically leverage backup servers if a request fails, we can use the Prioritized strategy:

ws = XRBP::WebSocket::Prioritized.new "wss://s1.ripple.com:443",
                                      "wss://s2.ripple.com:443"

ws.add_plugin :command_dispatcher, :result_parser
ws.parse_results { |res|
  JSON.parse(res)["result"]["ledger"]
}
ws.connect

puts ws.cmd(XRBP::WebSocket::Cmds::Ledger.new(28327070))

In this example we see that we establish a Prioritized connection set, and register a plugin to automatically parse data retrieved from the server. If we are not able to retrieve a valid ledger, the parser will throw an error and we will automaticlaly try the next connection behind the scenes. Thus if we query for a ledger which has been deleted from our primary rippled server, we can fall back to a full-history node.

This is just the icing on the cake as far as multi-connection strategies, there are several more included in the public XRBP API and developing custom strategies is as simple as inheriting XRBP::WebSocket::MultiConnection and defining next_connection.

XRBP can do much more ontop of all this. We can sync validators, gateways, etc from the DataV2 API, sync market quotes from exchanges, crawl the network and much more!

Listing Validators

connection = XRBP::WebClient::Connection.new
XRBP::Model::Validator.all(:connection => connection)
                      .each do |v|
  puts v
end

Crawling Nodes

connection = XRBP::WebClient::Connection.new
connection.timeout = 3

connection.on :peer do |node, peer|
  puts "#{node.url} peer: #{peer.url}"
end

XRBP::Model::Node.crawl("wss://s1.ripple.com:51235",
                        :connection => connection)

See project documentation and examples/ for complete details. And make sure to stay tuned there are alot more great features coming!

Wipple Version 0.13.1 - Now Available!

We are pleased to announce the general availability of Wipple 0.13.1, now live. This release brings many exciting new features and more stabilizations to the entire application.

To start off, we've made many improvements to the general look and feel of the website. The account, tips, and transactions pages have been updated to streamline data delivery in an aesthetically pleasing manner.


On the accounts page we've added an experimental new widget allowing to to explore account transactions by time. It may be activated by clicking 'Timeline' under the list of account transactions.
Note this is an early prototype, and it will receive fixes / enhancements in the near future.

New enhancements to the transactions page include:

  • A compact description of listed transactions, providing a quick visual overview of what's happening on the network at a glance. The original detailed view can be toggled via the settings (⚙️ ) icon in the upper right.

  • A title bar allowing you to monitor and filter transactions by specific category as well as those present in any given ledger. This navigational component presents the tally of received transactions and allows the user to simply view just those transactions.

  • New settings allowing you to highlight particular transaction categories for increased visibility in the ledger. Also toggleable via the settings in the upper right

In the Reporting section, we've added the ability to view higher timeframes of data. By default our analytics engine samples the XRP network every five minutes for ledger activity, which we've taken and resampled to hourly, daily, weekly, and monthly timeframes which can now be selected in the UI. Now you can monitor trends and patterns on much longer timescales!

The report metrics UI has received some general enhancements including additional hover/click effects and the ability to blow up graphs, by clicing on the expand icon in the lower right

Overall the application has received many improvements including but not limited to:

  • Expanded help, which can be accessed via the ? icon in the upper right of the UI, provides more information as to what is represented on each page and how to use the application.

  • Mobile improvements: our goal is for 100% mobile compatability. We ask that anything that looks "wrong" on mobile interfaces be reported to devnullproductions@gmail.com so that we can promply address. If you've experienced issues w/ mobile access in the past, you may want to revisit the site as many outstanding issues have been fixed in this release (including incorrect styling in the research section).

  • Better backend improvements: our data collection and aggregation system has been thoroughly tested and vetted to ensure all ledger edge cases have been handled and our database stays consistently in sync with the XRP network. We've written scripts and verification logic to provide us confidence that our data and metrics and accurate. This release sets the basis for running our analytics engine against the last several years worth of ledger traffic to generate long term stats (coming in the near future).

And that wraps up another successful release! Make sure to stay tuned, 0.13.2 is not that far away!

Dev Null - The Blog

We're please to announce the Dev Null Blog a one-stop shop for everything Dev Null. With this blog we aim to provide latest news and updates about all things Dev Null, from products and features we release, solutions delivered, bugfixes, and more. The intent is to provide content of interest to a wide-variety of readers, from users who are interested in the content we provide, to developers looking to build upon our services + many more. Be sure to stay tuned as we're just getting started and lots of great content is coming soon!