> For the complete documentation index, see [llms.txt](https://dozza.gitbook.io/pulsechain_node_guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dozza.gitbook.io/pulsechain_node_guide/part-7-rpc-tuning.md).

# Part 7 — RPC tuning (optional)

For low-latency mempool access (e.g. an arbitrage bot), the execution client can be launched with extra flags. This build edits `/blockchain/start_execution.sh`. Overwrite it cleanly to avoid manual-edit typos:

```bash
cat > /blockchain/start_execution.sh << 'EOF'
#!/bin/bash
echo "Starting geth"
sudo -u geth docker run -dt --restart=always \
--network=host \
--name execution \
-v /blockchain:/blockchain \
registry.gitlab.com/pulsechaincom/go-pulse:latest \
--pulsechain \
--authrpc.jwtsecret=/blockchain/jwt.hex \
--datadir=/blockchain/execution/geth \
--http \
--http.addr 0.0.0.0 \
--ws \
--ws.addr 0.0.0.0 \
--ws.port 8546 \
--state.scheme=path \
--gpo.ignoreprice 1 \
--metrics \
--pprof \
--maxpeers 50 \
--txpool.pricelimit 1 \
--txpool.globalslots 20000 \
--txpool.globalqueue 5000 \
--ws.api web3,eth,txpool,net,engine \
--http.api web3,eth,txpool,net,engine,admin,debug
EOF
```

**Apply the change** (a new container is required — restart alone won't pick up new flags):

```bash
docker stop execution && docker rm execution
/blockchain/start_execution.sh

# Verify WS is listening on all interfaces:
sudo ss -tlnp | grep 8546        # expect 0.0.0.0:8546 (or *:8546)

# Confirm flags applied:
docker inspect execution --format '{{.Args}}' | tr ',' '\n' \
  | grep -E 'ws|maxpeers|globalslots'
```

### Key flags explained

* `--http.addr / --ws.addr 0.0.0.0`: bind RPC to all interfaces so LAN clients can connect (safe only because UFW restricts these to the LAN).
* `--maxpeers 50`: peer count (default 50). Raise for broader gossip, lower if your modem struggles (see the note in Part 6).
* `--txpool.globalslots / globalqueue`: retain a deeper mempool (defaults 4096 / 1024) so more pending txs are visible.

{% hint style="info" %}
**Beacon peers too.** The consensus client (Lighthouse) also maintains its own peers. To cap them, add `--target-peers 30` to the `lighthouse bn` line in `/blockchain/start_consensus.sh` and recreate the `beacon` container the same way. Both clients' peer counts add up on your network.
{% endhint %}

## Test the mempool feed

```bash
# HTTP: pending/queued counts
curl -s -X POST http://127.0.0.1:8545 -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"txpool_status","params":[],"id":1}'

# WebSocket: live pending-tx stream (install wscat: sudo npm install -g wscat)
wscat -c ws://127.0.0.1:8546
#   then paste:
#   {"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newPendingTransactions"]}
```


---

# 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://dozza.gitbook.io/pulsechain_node_guide/part-7-rpc-tuning.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.
