The first time you run mcnode, it will generate a pair of persistent identities and
initialize the local store. By default, mcnode uses ~/.mediachain/mcnode as its
root directory, but you can change this using the -d path/to/mcnode/home command line option.

Bringing the node online

By default, the node starts disconnected from the p2p network and provides a client control
api in localhost.
You can control and use your node through the api using curl, but it is recommended
to install Aleph.
Aleph provides a fully featured client for mcnode named mcclient and we use it in
the examples below.

Since our status is offline, we can’t reach other peers, and attempting to do so will
result in an error:

$ mcclient listPeers
Internal Server Error
Error: Node is offline

Let’s fix that by setting a directory server and taking our node online.

Configuring the directory

At this point you should designate a directory for looking up peers. We’ll use the
multiaddress of the Mediachain Labs public directory,
/ip4/52.7.126.237/tcp/9000/p2p/QmSdJVceFki4rDbcSrW7JTJZgU9so25Ko7oKHE97mGmkU6.

The directory allows you to contact other nodes that have registered themselves by setting
their status to public. When contacting a remote node, we use their Peer ID, which is an
encoded multihash that’s derived from the node’s public key. The directory
maps Peer IDs to routable addresses that our node can use to connect to others.

Setting the directory does not make your node visible to others; for that we need to set our
status to public. We’ll do that in a little while; first lets take our node online so that
it can query the directory and contact other peers.