🎮
RPC & REST API
Learn what Secret APIs are available via DataHub and how to use them

Time to play

Secret exposes both the Tendermint RPC and the Secret REST API which are both necessary for the development of applications on the Secret network.
If you're using secret CLI, configure DataHub RPC endpoints using secret CLI by following these steps -
1
# Install a local proxy server
2
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" |
3
sudo tee -a /etc/apt/sources.list.d/caddy-fury.list &&
4
sudo apt-get update &&
5
sudo apt-get install -y caddy
6
7
# Set its config
8
echo 'http://localhost:1234
9
10
reverse_proxy {
11
to https://secret-2--rpc--full.datahub.figment.io
12
header_up Authorization <YOUR_DATAHUB_API_KEY>
13
header_up Host secret-2--rpc--full.datahub.figment.io
14
}' | sudo tee /etc/caddy/Caddyfile
15
16
# Apply the new config
17
sudo systemctl restart caddy
18
19
# Point secretcli to your local proxy
20
secretcli config node http://localhost:1234
21
22
#Note - Just make sure to set <YOUR_DATAHUB_API_KEY> to your API key.
Copied!
Learn about the APIs available via Secret DataHub below -

Tendermint RPC

You can review the official Tendermint RPC documentation HERE

Secret REST API

You can review the official Secret REST API documentation HERE