To make your own node discoverable, see the Going Public section below.

Query

You can query a mediachain node using MCQL, the
Mediachain Query Language. MCQL is very similar to SQL, with mediachain namespaces taking
place of SQL tables.

Use the mcclient query command to send a query to your own node (either on your local
machine or a remote server via an ssh tunnel), or
any remote peer that your node has discovered through the directory.

Let’s start with a remote query to a node run by Mediachain Labs, discovered in the listPeers
invocation above.

Here, we query the namespaces for statements in the discovered peer’s datastore and take a small
sample from the images.dpla namespace:

Going Public

In order to distribute statements stored in your node, it needs to become
discoverable and accessible to other nodes. This happens by taking the node
public, which registers with the directory.

Before you can take your node public however, you need to ensure that it is
reachable in the network. By default, mcnode binds its p2p interface in port 9001
for all interfaces, so if your node is directly connected to the Internet (eg in a vps
host), you don’t have to do anything.

Once your node’s p2p port is reachable from the internet, you’re almost ready to take it
public. As a final preparation for going public, you should add a short description
about your node and its contents:

$ mcclient config info "Metadata from ...; Operated by ..."

Then your node should be ready to take it public:

$ mcclient status public

This will register the node with the configured directory, which will make it visible
to other nodes through mcclient listPeers.

If you want to take your node back offline, you can simply do so with status offline: