Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Because any node can be called on by the PAN to service any particular request, all nodes must be accessible to the application client. An application can locate a PAN to use for transactions using one of the following methods.

...

(recommended) Integrate applications with Swarm using the Software Development Kit (SDK). Along with the convenience it provides, applications can use the ProxyLocator or StaticLocator object included with the SDK to locate and communicate with a node.

The SDK's ProxyLocator subclass performs two functions:

  • Performs a GET / to the SCSP Proxy to pre-populate the local list of Swarm node IP addresses.

  • Dynamically maintains this list as redirects and other responses are received directly from Swarm nodes.

See the SDK Overview/wiki/spaces/DOCS/pages/2443822872.

Use Multicast-DNS (mDNS)

Another way to make nodes locate an initial PAN is to use mDNS. mDNS is often referred to as Zeroconf, the collective name for DNS and DNS Service Discovery to enable zero-configuration networking.

...

Every Swarm node implements an mDNS service that allows applications to provide service discovery. Even if DHCP is used to assign and change node IP addresses, mDNS allows an application to "discover" an active node in any storage cluster and use it as the PAN. Several free mDNS client implementations in various languages are available online for implementing mDNS node location.

...

Swarm mDNS support allows an application to discover all nodes on a network, all nodes in a specific cluster, or to look up a node. To implement this process, it "publishes" several different records, including an A (host) record for the node and an SRV (service) record under the _scsp._tcp service type.

Although an in-depth description of mDNS deployment is beyond this scope, a typical use example is provided below. This example uses the Avahi command line tools to pass in the name of the cluster and return all nodes discovered in the cluster. Here, two Two nodes were are found and the IP addresses were are returned in the address field for each record.

...

Info

Tip

With some DNS servers, move the maintenance of the PAN addresses out of the applications and into the DNS server itself. The Berkeley Internet Name Domain (BIND), the most commonly used DNS server, allows entry of multiple "A" records that map a single DNS name to more than one IP address.

...