> For the complete documentation index, see [llms.txt](https://docs.scrt.network/secret-network-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scrt.network/secret-network-documentation/development/resources-api-contract-addresses/connecting-to-the-network/usage-examples.md).

# Usage examples

### RPC

With `secretcli` (replace `"$URL"`):

```
$ secretcli config node "$URL"
$ secretcli config chain-id secret-4 # or pulsar-3
```

Or:

```
$ secretcli status --node "$URL" --chain-id secret-4 # or --chain-id pulsar-3
```

### gRPC-web

With `secretjs@beta` (replace `"$URL"`):

```
import { SecretNetworkClient } from "secretjs";

const grpcWebUrl = "$URL";
const chainId = "secret-4"; // or "pulsar-3"

// Readonly Client
const secretjs = await SecretNetworkClient.create({
  grpcWebUrl,
  chainId,
});

// Or a signer client with Keplr integration
await window.keplr.enable(chainId);
const [{ address: myAddress }] = await keplrOfflineSigner.getAccounts();

const secretjs = await SecretNetworkClient.create({
  grpcWebUrl,
  chainId,
  wallet: window.getOfflineSignerOnlyAmino(chainId),
  walletAddress: myAddress,
  encryptionUtils: window.getEnigmaUtils(chainId),
});
```

### LCD

Swagger/OpenAPI UI can be found under `$URL/swagger/` and `$URL/openapi/`.

With (the deprecated) `secretjs` (replace `"$URL"`):

```
import { CosmWasmClient, SigningCosmWasmClient } from "secretjs";

const lcdUrl = "$URL";
const chainId = "secret-4"; // or "pulsar-3"

// Readonly Client
const queryJs = new CosmWasmClient(lcdUrl);

// Or a signer client with Keplr integration
await window.keplr.enable(chainId);
const offlineSigner = window.getOfflineSigner(chainId);
const enigmaUtils = window.getEnigmaUtils(chainId);
const accounts = await offlineSigner.getAccounts();

const secretJS = new SigningCosmWasmClient(
  lcdUrl,
  accounts[0].address,
  offlineSigner,
  enigmaUtils
);
```

### Seeds

Usage example:

```
$ perl -i -pe 's/^seeds =.*/seeds = "${URL_1},${URL_2},${URL_3}"/' ~/.secretd/config/config.toml
```

Note that when you initialize a node with `secretd init --chain-id secret-4` these seeds are automatically populated into `~/.secretd/config/config.toml`.

### Peers

Usage example:

```
$ perl -i -pe 's/^persistent_peers =.*/persistent_peers = "${URL_1},${URL_2},${URL_3}"/' ~/.secretd/config/config.toml
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scrt.network/secret-network-documentation/development/resources-api-contract-addresses/connecting-to-the-network/usage-examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
