> ## Documentation Index
> Fetch the complete documentation index at: https://trust-link-tsn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# tsn-cranker — Configure an operator

> Run the supported TSN Cranker SDK setup commands with a local signer, gateway RPC, and the required token-account arguments.

The `tsn-cranker` CLI configures Solana operator state; it is not the payment-policy engine and does not replace Node authorization.

## Signature

```bash theme={null}
npm start -- <command> [arguments]
```

## Commands

| Command              | Arguments                                                                       | Purpose                                         |
| -------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------- |
| `init-mother`        | none                                                                            | Initialize Mother escrow on chain.              |
| `migrate-mother`     | none                                                                            | Rewrite an invalid or old Mother escrow layout. |
| `register-cranker`   | none                                                                            | Register the operator as a Cranker.             |
| `set-funding-policy` | `true` or `false`                                                               | Set the Cranker funding policy.                 |
| `init-vault`         | `<TOKEN_MINT>`                                                                  | Initialize the operator's token vault.          |
| `fund-cranker`       | `<TOKEN_MINT> <FUNDER_KEYPAIR_PATH> <FUNDER_TOKEN_ACCOUNT> <AMOUNT_BASE_UNITS>` | Fund the Cranker vault.                         |
| `withdraw-cranker`   | `<TOKEN_MINT> <FUNDER_KEYPAIR_PATH> <FUNDER_TOKEN_ACCOUNT> <AMOUNT_BASE_UNITS>` | Withdraw vault funds.                           |

## Environment

<ParamField path="KEYPAIR_PATH" type="string" required={false}>Signer keypair path; defaults to `./cranker-keypair.json`.</ParamField>
<ParamField path="PROGRAM_ID" type="string" required={true}>Required when no command is supplied.</ParamField>
<ParamField path="TINS_PROGRAM_ID" type="string" required={false}>TIN program ID; defaults to the source-defined program ID.</ParamField>
<ParamField path="TSN_RPC_GATEWAY_URL" type="string" required={false}>Gateway RPC URL selected by `resolveSolanaRpcUrl`.</ParamField>

<CodeGroup>
  ```bash Setup theme={null}
  KEYPAIR_PATH=./cranker-keypair.json PROGRAM_ID=<TSN_PROGRAM_ID> npm start -- register-cranker
  ```

  ```bash Vault theme={null}
  npm start -- init-vault <TOKEN_MINT>
  npm start -- fund-cranker <TOKEN_MINT> <FUNDER_KEYPAIR_PATH> <FUNDER_TOKEN_ACCOUNT> <AMOUNT_BASE_UNITS>
  ```
</CodeGroup>

The CLI throws for a missing keypair, malformed keypair, missing required environment variable, invalid boolean, or unknown command. On-chain failures are returned by the delegated SDK transaction helper.

Source: [`cli.ts:20-188`](https://github.com/Trustlink-Labs/TSN-Protocol/blob/main/tsn-protocol/sdks/tsn-cranker-sdk/src/cli.ts#L20-L188)
