<h2>Monitoring your node<aclass="headerlink"href="#monitoring-your-node"title="Permalink to this headline">¶</a></h2>
<p>Like most Java servers, the node exports various useful metrics and management operations via the industry-standard
<aclass="reference external"href="https://en.wikipedia.org/wiki/Java_Management_Extensions">JMX infrastructure</a>. JMX is a standard _in-<ahref="#id1"><spanclass="problematic"id="id2">process_</span></a> API
for registering so-called _MBeans_ ... objects whose properties and methods are intended for server management. It does
not require any particular network protocol for export. So this data can be exported from the node in various ways:
some monitoring systems provide a “Java Agent”, which is essentially a JVM plugin that finds all the MBeans and sends
them out to a statistics collector over the network. For those systems, follow the instructions provided by the vendor.</p>
<p>Sometimes though, you just want raw access to the data and operations itself. So nodes export them over HTTP on the
<cite>/monitoring/json</cite> HTTP endpoint, using a program called <aclass="reference external"href="https://jolokia.org/">Jolokia</a>. Jolokia defines the JSON
and REST formats for accessing MBeans, and provides client libraries to work with that protocol as well.</p>
<p>Here are a few ways to build dashboards and extract monitoring data for a node:</p>
<ulclass="simple">
<li><aclass="reference external"href="https://github.com/logzio/jmx2graphite">JMX2Graphite</a> is a tool that can be pointed to /monitoring/json and will
scrape the statistics found there, then insert them into the Graphite monitoring tool on a regular basis. It runs
in Docker and can be started with a single command.</li>
<li><aclass="reference external"href="https://github.com/jmxtrans/jmxtrans">JMXTrans</a> is another tool for Graphite, this time, it’s got its own agent
(JVM plugin) which reads a custom config file and exports only the named data. It’s more configurable than
JMX2Graphite and doesn’t require a separate process, as the JVM will write directly to Graphite.</li>
<li><em>Java Mission Control</em> is a desktop app that can connect to a target JVM that has the right command line flags set
(or always, if running locally). You can explore what data is available, create graphs of those metrics, and invoke
management operations like forcing a garbage collection.</li>
<li>Cloud metrics services like New Relic also understand JMX, typically, by providing their own agent that uploads the
<h2>Uploading and downloading attachments<aclass="headerlink"href="#uploading-and-downloading-attachments"title="Permalink to this headline">¶</a></h2>
<p>Attachments are files that add context to and influence the behaviour of transactions. They are always identified by
hash and they are public, in that they propagate through the network to wherever they are needed.</p>
<p>All attachments are zip files. Thus to upload a file to the ledger you must first wrap it into a zip (or jar) file. Then
you can upload it by running this command from a UNIX terminal:</p>
<p>on a Mac or by using <codeclass="docutils literal"><spanclass="pre">sha256sum</span></code> on Linux. Alternatively, the hash will be returned to you when you upload the
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.