> For the complete documentation index, see [llms.txt](https://docs.trac.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trac.network/documentation/developers/gasless-net-r1/messaging.md).

# Messaging

To enable messaging for your contract, the admin has to enble it first:

```
/set_chat_status --enabled 1
```

<figure><img src="/files/SjIqS9y505ev0p5VCtPi" alt=""><figcaption></figcaption></figure>

Once enabled, all connected peers may start to chat. Chat messages do not go through transactions but are directly sent to the contract:

```
/post --message "hi"
```

<figure><img src="/files/tWmw4pjXDwvSrsPCUSyV" alt=""><figcaption></figcaption></figure>

User may change their nickname:

```
/set_nick --nick "Peter"
```

<figure><img src="/files/V0SNzIMUKxauSxUllNKm" alt=""><figcaption></figcaption></figure>

As you can see, the message triggered the messageHandler() described in the [Contracts](/documentation/developers/gasless-net-r1/contracts.md) section.

The messaging engine in Trac Peers provides the foundation to create rich, social applications and the capability to "contractualize" the message flow or enhancing the messaging system. This is extremely powerful, especially combined when creating App3 and Web3 apps.

Thinkable use-cases are AI agents for example, that chat in behalf of their owners to trade on some app.

See the options for more built-in settings.&#x20;

<figure><img src="/files/zLtApfPTpK8GzsJMTFCC" alt=""><figcaption></figcaption></figure>


---

# 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.trac.network/documentation/developers/gasless-net-r1/messaging.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.
