> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cowboy.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# cowboy deploy-code

> Upload a code blob as a content-addressed entry

## Synopsis

```bash theme={null}
cowboy deploy-code --code <path> [--rpc-url <url>] [--private-key <path>]
```

## Behavior

Uploads a code blob as a content-addressed entry (Model A.4 Part 2). Anyone can submit; the cost is `2 × cell_basefee × code.len()`.

1. Read the file at `--code` as raw bytes and compute its keccak256 hash.
2. Print `Deploying code: <n> bytes, code_hash=0x<hash>`.
3. Load the private key via [auto-discovery](https://docs.cowboy.inc/cli-specs/key-auto-discovery.md), fetch the account nonce, the current basefee, and the chain id.
4. Sign a `DeployCode` system instruction with limits estimated by the node, print the transaction hash, and `POST` it to `<rpc-url>/submit`.
5. Print `DeployCode submitted: <response>`. The command does not wait for the transaction to commit.

## Flags

| Flag | Default | Description |
| - | - | - |
| `--code` | Required | Path to the code file (`.py`, `.wasm`, ...) |
| `--rpc-url` | Auto-discovered | RPC endpoint |
| `--private-key` | Auto-discovered | Private key file |

## Example

```bash theme={null}
$ cowboy deploy-code --code actors/hello/main.py
Deploying code: 412 bytes, code_hash=0x9c0d...
Transaction hash: 0xdef789...
✓ DeployCode submitted: ...
```

## Edge Cases

* This is not `cowboy deploy`: it publishes bytes by hash and creates no actor. Use [cowboy deploy](https://docs.cowboy.inc/cli-specs/cowboy-deploy.md) to deploy a project actor.
* An unreadable file fails with `failed to read code file <path>` before any network call.
* A failed `/submit` reports a typed diagnostic naming the transaction hash; a submission the node skipped (`added: 0`) reports `transaction_skipped` with the skip reasons.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.