How to Interact with a Codex Node

How to Interact with a Codex Node

Codex is a decentralised peer-to-peer (P2P) storage network that enables users to share and persist data in a distributed and verifiable way. 

Codex distinguishes itself from other distributed storage networks through its design as a Data Durability Engine (DDE), leveraging powerful durability and reliability features alongside an open marketplace for distributed data storage and retrieval.

The Codex protocol is currently operated as a Non-Incentivised Testnet, allowing anyone to join and experiment with durable and resilient p2p data storage, whether you're a developer building decentralised applications or a privacy-conscious user who wants to help create a sovereign, censorship-resistant digital future.

Users can install and run a Codex node using either the user-friendly CLI installer application or the binaries available in the Codex documentation. Once installed, there are various ways to interact with a local Codex node.

From using a streamlined web interface to direct API calls, Jessie, Guru, and Ben from the Codex team explored some of the ways users can interact with a node running peer-to-peer Altruistic Mode on the testnet, including interacting with a node running on Dappnode.

The code to build a Codex package for Dappnode is available on GitHub here.

Watch the video below or read further to learn more about interacting with the Codex network.

Running a Codex Node with the CLI Installer

The most straightforward way to get started with Codex is by using the official CLI installer. 

This approach is designed for ease of setup, allowing you to run a node without needing to configure everything manually. 

For a more information on how to run a Codex node with the CLI installer app, read our quick-start guide.

During setup, you’ll need to forward those ports used by the protocol, opening them to the public internet. 

By default, Codex uses UDP port 8090 for peer discovery and TCP port 8070 for block exchange, while the REST API is exposed on port 8080. These can be adjusted to avoid conflicts with existing services on your network.

Once the node is up and running, the installer gives you the option to link your node with an ERC-20 wallet address. This linking not only helps identify early contributors to the testnet but also could support community incentive programmes in future.

The installer also pushes regular updates to a live metrics dashboard on the Codex testnet, which is under active construction and aims to offer an overview of node activity and network growth over time.

Interacting with Codex via the REST API

For developers and technically inclined users, interacting with the Codex node directly through the REST API provides fine-grained control and automation possibilities. 

Tools such as Insomnia and Postman are useful for crafting and sending requests directly to your local Codex node.

Typical interactions begin by verifying node health through the /debug endpoint. To upload files, developers can send a POST /data request, which returns a CID (Content Identifier) for the uploaded file. This CID can then be shared or used for retrieval. 

To download a file, a GET request to /data/{cid} or /data/{cid}/network/ can be used, depending on whether the file exists locally or needs to be fetched from the wider network.

This method of directly using API requests is especially useful for developers building applications on top of Codex, as it exposes all network capabilities through a structured API. 

Full documentation of available endpoints can be found at api.codex.storage, providing information on functions related to everything from basic file handling to network diagnostics.

Using the Codex App Interface with Dappnode

For those looking for a more visual and user-friendly experience, the Codex web interface at app.codex.storage offers an easy, straightforward way to interact with a Codex node. 

This interface can be used to interact with a local Codex node installed through the CLI installer or on a platform such as Dappnode, with the user being required to point the application at their Codex node upon startup.

This web application allows you to easily inspect stored files, upload new ones, and retrieve files using their CID without manually making manual HTTP requests or using terminal commands. 

The app provides an intuitive way to manage your node and use Codex. The Codex team demonstrated this functionality by uploading a file to a Codex node running on Dappnode using terminal commands, and then retrieving that file from the node via the app’s UI using its CID.

The web interface can be used as an accessible front-end for Codex nodes operating in Altruistic Mode on the Codex testnet. 

Marketplace support will be made available for testing after the launch of the incentivised testnet, enabling nodes to run in Durability Mode and negotiate incentivised deals for persisting data on the network. Those nodes uploading large files will likely opt to use a different approach to the web interface to ensure stable and uninterrupted data uploads.

Privacy and Network Measurement

For users who value privacy and prefer not to send telemetry data, Codex supports the ability to manually set up a node without using the CLI installer. 

These nodes operate normally but do not report data to the Codex metrics dashboard. To maintain an accurate view of the testnet, Codex also employs a DHT (Distributed Hash Table) crawler that navigates the network by querying nodes for their peers. 

This crawler provides an independent estimate of network size, unaffiliated with the dashboard metrics, and captures organic network growth and participation more transparently.

In future updates, additional metrics such as data transfer volume, peer connection counts, and on-chain storage contract data will be incorporated. 

These statistics will help build a clearer picture of the network’s usage and performance, particularly through metrics stored on the Codex blockchain, such as contract sizes, durations, and success rates.

Join the Codex Testnet

Whether you’re a developer or an enthusiast, now is the perfect time to join the Codex testnet and help build a robust and reliable distributed storage network that can bring about a future of censorship-resistant, durable data.

Get started today - learn more about the protocol and how to run a node by following the setup guides at docs.codex.storage.

To explore early benchmarks and comparisons with systems like BitTorrent or IPFS, check out the Codex blog

Follow us on social media, join our Discord, and subscribe to our newsletter to get the latest updates from Codex.