> For the complete documentation index, see [llms.txt](https://docs.expanse.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.expanse.tech/developer/how-to-connect-to-the-expanse-network.md).

# How to connect to the Expanse Network?

Gexp continuously attempts to connect to other nodes on the network until it has peers. If you have UPnP enabled on your router or run Expanse on an Internet-facing server, it will also accept connections from other nodes.

Gexp finds peers through something called the discovery protocol. In the discovery protocol, nodes are gossipping with each other to find out about other nodes on the network. In order to get going initially, gexp uses a set of bootstrap nodes whose endpoints are recorded in the source code.

**Checking connectivity and ENODE IDs**

To check how many peers the client is connected to in the interactive console, the net module has two attributes that give you info about the number of peers and whether you are a listening node.

\> net.listening\
true\
\
\> net.peerCount\
4

To get more information about the connected peers, such as IP address and port number, supported protocols, use the peers() function of the admin object. admin.peers() returns the list of currently connected peers.

\> admin.peers\
\[{\
&#x20;    ID: ‘a4de274d3a159e10c2c9a68c326511236381b84c9ec52e72ad732eb0b2b1a2277938f78593cdbe734e6002bf23114d434a085d260514ab336d4acdc312db671b’,\
&#x20;    Name: ‘Gexp/v0.9.14/linux/go1.4.2’,\
&#x20;    Caps: ‘exp/60’,\
&#x20;    RemoteAddress: ‘5.9.150.40:30301’,\
&#x20;    LocalAddress: ‘192.168.0.28:39219’\
}, {\
&#x20;    ID: ‘a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c’,\
&#x20;    Name: ‘Gexp/v0.9.15/linux/go1.4.2’,\
&#x20;    Caps: ‘exp/60’,\
&#x20;    RemoteAddress: ‘52.16.188.185:30303’,\
&#x20;    LocalAddress: ‘192.168.0.28:50995’\
}, {\
&#x20;    ID: ‘f6ba1f1d9241d48138136ccf5baa6c2c8b008435a1c2bd009ca52fb8edbbc991eba36376beaee9d45f16d5dcbf2ed0bc23006c505d57ffcf70921bd94aa7a172’,\
&#x20;    Name: ‘pyethapp\_dd52/v0.9.13/linux2/py2.7.9’,\
&#x20;    Caps: ‘exp/60, p2p/3’,\
&#x20;    RemoteAddress: ‘144.76.62.101:30303’,\
&#x20;    LocalAddress: ‘192.168.0.28:40454’\
}, {\
&#x20;ID: ‘f4642fa65af50cfdea8fa7414a5def7bb7991478b768e296f5e4a54e8b995de102e0ceae2e826f293c481b5325f89be6d207b003382e18a8ecba66fbaf6416c0’,\
&#x20;Name: ‘++exp/Zeppelin/Rascal/v0.9.14/Release/Darwin/clang/int’,\
&#x20;Caps: ‘exp/60, shh/2’,\
&#x20;RemoteAddress: ‘129.16.191.64:30303’,\
&#x20;LocalAddress: ‘192.168.0.28:39705’\
} ]

To check the ports used by gexp and also find your enode URI run:

\> admin.nodeInfo\
{\
&#x20;Name: ‘Gexp/v0.9.14/darwin/go1.4.2’,\
&#x20;NodeUrl: ‘enode://3414c01c19aa75a34f2dbd2f8d0898dc79d6b219ad77f8155abf1a287ce2ba60f14998a3a98c0cf14915eabfdacf914a92b27a01769de18fa2d049dbf4c17694@\[::]:30303’,\
&#x20;NodeID: ‘3414c01c19aa75a34f2dbd2f8d0898dc79d6b219ad77f8155abf1a287ce2ba60f14998a3a98c0cf14915eabfdacf914a92b27a01769de18fa2d049dbf4c17694’,\
&#x20;IP: ‘::’,\
&#x20;DiscPort: 30303,\
&#x20;TCPPort: 30303,\
&#x20;Td: ‘2044952618444’,\
&#x20;ListenAddr: ‘\[::]:30303’\
}


---

# 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.expanse.tech/developer/how-to-connect-to-the-expanse-network.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.
