# Create script to grab topology peers

## Creating the topology\_push.sh script

Move to your scripts directory and open the new script:

```
cd ~/cardano-node/scripts
nano topology_push.sh
```

Copy/paste the following lines into the new script topology\_push.sh:

```bash
#!/bin/bash

curl -s -o /home/cardano/cardano-node/configuration/relay1/mainnet_candidate-topology.json "https://api.clio.one/htopology/v1/fetch/?max=7&customPeers=CoreIP:3000:4|Relay2:3002|relays-new.mainnet-candidate.dev.cardano.org:3001:2"
```

{% hint style="info" %}
the topology.json file name changes on each new genesis as well as the relays-new address.  If in doubt, check your topology file name and open the new topology file for the current genesis and see what relays-new address it shows.
{% endhint %}

Now we need to edit the script, check the picture below to see what items need changed:

![](/files/-MBGSGc2gZgCMGO1e8pt)

{% hint style="info" %}
&#x20;Save the changes by pressing: ctrl+o\
&#x20;Then Enter exit editor: ctrl+x
{% endhint %}

Once you are done with the edits, we can test it out after topologyUpdater has ran successfully for 3 hours you will be able to use this new script.  Let's set the execute permissions:

```bash
chmod +x topology_push.sh
```

Once you have been running topologyUpdater for 3 hours (check your logs) you can manually execute the following:

```bash
./topology_push.sh
```

This will go out, pull relay peers in the topology and automatically update your topology file.

Remember you MUST close the relay then restart it for the relay to read this new topology file.


---

# 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://topologyupdater.hivestaking.com/create-script-to-grab-topology-peers.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.
