# Gargantua

Hyperbridge (short for hyper-scalable bridge) is innovated as a cross-chain solution built as an interoperability coprocessor. Hyperbridge is crafted to scale cryptographically secure, consensus, and state-proof-based interoperability across all blockchains.

### How to Connect to Gargantua

#### Using Private Endpoint

Using API keys on an RPC node provides better tracking and monitoring of API usage.

Secure your data, speed up your queries, and take control of your API usage with our RPC API endpoint and personalized API keys. [Sign up now](https://beta-app.blockops.network/?callback=api-service) to get your own API key.

To get your API key, create a project using a unique Identifier as the project name and select Gargantua from the network options.

<figure><img src="https://1708223268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdj2MsRM0vL9rfte6D4jZ%2Fuploads%2Fgit-blob-4062908fb5152c7588bc23af8ba48ed37115ddbe%2Fgargantua-create.png?alt=media" alt=""><figcaption><p>Create a Gargantua project</p></figcaption></figure>

Open the project to view your api key and rpc endpoints.

<figure><img src="https://1708223268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdj2MsRM0vL9rfte6D4jZ%2Fuploads%2Fgit-blob-c81fdbd81d7db09003b2b77b762b65c79e3ce839%2Fgargantua-view.png?alt=media" alt=""><figcaption><p>view Gargantua project</p></figcaption></figure>

#### Send requests

{% hint style="info" %}
All requests are `POST` requests.
{% endhint %}

**Connect via Command Line**

You can connect to the network using websocket or HTTP with your API key in two ways:

* Adding the API key as a query string `?api_key=${APIKEY}`
* Or the request header `-H 'authorization: APIKEY ${APIKEY}'`

**Curl**

For example, the following CURL command can be used to get header and body of a relay chain block.

{% code overflow="wrap" %}

```bash
curl -H "Content-Type: application/json" -H 'authorization: APIKEY xxxx'  -d '{"id":1, "jsonrpc":"2.0", "method": "chain_getBlock"}' https://gargantua-rpc.blockops.network/rpc
```

{% endcode %}

Here is the response you will receive back.

{% code overflow="wrap" %}

```bash
{"jsonrpc":"2.0","result":{"block":{"header":{"parentHash":"0x381dd358f0b1e328e861822b2a51a72e8dc064803a5c7ccc96277da3b16d7667","number":"0xe07a1d","stateRoot":"0xa2aacd7ef5d7ff66da1df6643b3e1c13975d210363c568f1bed51bad56cf40db","extrinsicsRoot":"0x00bc7f1504c9a07364835d80d2114ca3d4e7ad774453198b119bea9be2a1f7c1","digest":{"logs":["0x0642414245b50103d8000000d17aae1000000000768dc1931ba697bb9ab4a08debf5d710bd1f55e6325d65315161c2340cc0217170dfe2df24a3680c8ff48868ac665f4b34ebefa4bc844d510c848d9fc99252035db579a0acbf52cded336d6daf6ab7fdb1d1eee0d480e6388c2a12785d4de809"]},"justifications":null},"id":1}
```

{% endcode %}

**Wscat**

If you want to send data requests with WebSockets, you can use several libraries or wscat. You can install and use wscat as follows:

* Download wscat from <https://www.npmjs.com/package/wscat>
* Install wscat by running the following command: `npm install -g wscat`

You can connect to the network with wscat using two options by adding the API key as a query string.

{% code overflow="wrap" %}

```bash
wscat -c 'wss://gargantua-rpc.blockops.network/ws?api_key=*********************'
```

{% endcode %}

Or the request header.

{% code overflow="wrap" %}

```bash
wscat -c 'wss://gargantua-rpc.blockops.network/ws' --header 'authorization: APIKEY xxxx'
```

{% endcode %}

After executing the command, the terminal will display a message indicating that the connection has been enabled successfully.

```bash
Connected (press CTRL+C to quit)
>
```

Then, you can send the following request:

```
{"id":1, "jsonrpc":"2.0", "method": "chain_getBlock"}
```

{% hint style="info" %}
For more information on the Gargantua network, please see the official [Hyperbridge documentation](https://docs.hyperbridge.network/).
{% endhint %}

Login or set up an account [here](https://beta-app.blockops.network/?callback=api-service) to get started!

#### ***Quick Links***

[Website](https://research.polytope.technology/)

[Github](https://github.com/polytope-labs/hyperbridge)
