1. Ports
  2. Port 1317

Port 1317 is the default port for the Light Client Daemon (LCD) REST API in Cosmos SDK-based blockchains. If you've ever used a web-based wallet for Cosmos Hub, Osmosis, or any other Cosmos chain, you've connected through this port.

What Runs on Port 1317

The Cosmos SDK exposes an HTTP/1.1 REST API server on port 1317, commonly called the LCD (Light Client Daemon). This server provides a REST interface to query blockchain data and submit transactions without needing to run a full node or understand the underlying RPC protocol.12

Port 1317 uses TCP.

The Problem It Solves

Here's the fundamental issue: blockchains in the Cosmos ecosystem use gRPC for efficient communication between nodes and clients. gRPC requires HTTP/2. Browsers don't fully support HTTP/2 in ways that would allow direct gRPC connections.3

So if you're building a web application that needs to query a Cosmos blockchain—checking balances, reading validator information, submitting transactions—you can't use gRPC directly. Port 1317 provides the bridge. It accepts standard REST requests over HTTP/1.1 and translates them into gRPC calls that the blockchain understands.

How It Works

The LCD is built on gRPC-Gateway, which exposes gRPC endpoints as REST endpoints. When you make a REST API call to port 1317:

  1. Your HTTP request arrives at the LCD server
  2. gRPC-Gateway routes the request to the corresponding gRPC endpoint
  3. The blockchain processes the query
  4. The response returns as JSON with base64-encoded Protobuf data1

This happens transparently. From the web application's perspective, it's just a REST API. From the blockchain's perspective, it's a normal gRPC call.

Configuration

Cosmos SDK nodes configure port 1317 in the app.toml file under the [api] section:

[api]
address = "tcp://0.0.0.0:1317"
enable = true

The port can be changed, but 1317 is the conventional default across the Cosmos ecosystem. Public node operators and RPC providers typically keep it at 1317 for consistency.1

Swagger Documentation

Every Cosmos SDK node running the LCD exposes a Swagger specification file at http://localhost:1317/swagger, which documents all available REST endpoints. This makes it straightforward to discover what queries and transactions the API supports without diving into blockchain documentation.1

Security Considerations

Port 1317 exposes read access to blockchain data and accepts transaction submissions. While the blockchain itself validates all transactions (so you can't forge invalid transactions), you should still be careful:

  • Public nodes: If you're running a validator or public RPC node, ensure port 1317 is properly firewalled if you don't intend to serve public API traffic
  • Rate limiting: Public LCD endpoints can be abused for DDoS. Consider rate limiting and access controls
  • TLS: Production deployments should use TLS/SSL (running the LCD behind a reverse proxy like nginx is common)

The LCD itself doesn't authenticate users—it's a read-mostly API where transactions still require proper signatures. But exposing it publicly means anyone can query your node's view of the blockchain state.

Why Port 1317?

There's no official IANA registration for port 1317—it's in the registered ports range (1024-49151) but was chosen by convention within the Cosmos ecosystem. The number itself has no special significance. It's simply the default port the Cosmos SDK team selected for the LCD, and it stuck.

As the Cosmos ecosystem grew—Osmosis, Terra, Juno, dozens of other chains—everyone kept port 1317 for consistency. If you're connecting to a Cosmos chain's REST API, you know to try port 1317 first.

Checking What's Listening

To see if a Cosmos LCD is running on port 1317:

On Linux/macOS:

lsof -i :1317
# or
curl http://localhost:1317/cosmos/base/tendermint/v1beta1/node_info

On Windows:

netstat -an | findstr :1317

If you get a JSON response with node information from the curl command, you've got a Cosmos SDK node running.

  • Port 26657: CometBFT (formerly Tendermint) RPC port, used for direct RPC queries to Cosmos chains
  • Port 9090: gRPC port for native gRPC clients (not usable from browsers)
  • Port 26656: CometBFT P2P port for node-to-node communication

Port 1317 sits between the user-facing web world and the blockchain's native protocols. It's not the most efficient way to query a blockchain (that would be gRPC on port 9090), but it's the most accessible.

The Unassigned Question

Port 1317 has no official IANA assignment. The Cosmos SDK team selected it, and the ecosystem adopted it. This is common for application-specific defaults—developers pick an unused port in the registered range and hope it doesn't conflict with anything else.

So far, it hasn't. Port 1317 has become synonymous with Cosmos REST APIs. But technically, any application could use port 1317 for anything. The convention holds because the Cosmos ecosystem is large enough and consistent enough that everyone knows what 1317 means.

Frequently Asked Questions About Port 1317

ئایا ئەم پەڕەیە بەسوود بوو؟

😔
🤨
😃