If `addrs` param is supplied, it will be used to dial the peer, otherwise the `peerId` is used to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
peer_id = 'peer_id_example' # str | Peer that should be dialed.
addrs = ['addrs_example'] # List[str] | If supplied, it will be used to dial the peer. The address has to target the listening address of the peer, which is specified with the `--listen-addrs` CLI flag. (optional)
try:
# Connect to a peer
api_instance.connect_peer(peer_id, addrs=addrs)
except Exception as e:
print("Exception when calling NodeApi->connect_peer: %s\n" % e)
**peer_id** | **str**| Peer that should be dialed. |
**addrs** | [**List[str]**](str.md)| If supplied, it will be used to dial the peer. The address has to target the listening address of the peer, which is specified with the `--listen-addrs` CLI flag. | [optional]
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successfully connected to peer | - |
**400** | Peer either not found or was not possible to dial | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
print("Exception when calling NodeApi->get_peer_id: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
**str**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: plain/text, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Node's Peer ID | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
print("Exception when calling NodeApi->get_spr: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
**str**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: plain/text, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Node's SPR | - |
**503** | Node SPR not ready, try again later | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)