# How To Use

Running a client and using the subnet required connecting to the DHT as a client and running the session manager.

```python
config = ClientConfig()
config.initial_peers = BOOTNODES # Get bootnodes
config.update_period = 60

dht = DHT(
    initial_peers=config.initial_peers,
    identity_path=IDENTITY_PATH,
    start=True,
    num_workers=8,
    client_mode=True,
    startup_timeout=config.daemon_startup_timeout,
    announce_maddrs=ANNOUNCE_MADDRS_LIST
)

remote_manager = RemoteManager(
    config=config,
    dht=dht,
)

manager = SessionManager(remote_manager=remote_manager)

# Async generator example
async with manager.session() as session:
    async for output in session.run_task():

# Single response example
async with manager.session() as session:
    result = session.run_task()
```


---

# Agent Instructions: 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:

```
GET https://docs.hypertensor.org/subnet-template/client/how-to-use.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
