# Light Client/REST
The und
binary comes packaged with a full REST capable server, from which the majority of
the und query ...
and und tx ...
commands can also be served.
The REST server is generally useful for third party services such as
wallets (opens new window) and
block explorers (opens new window). It interacts with, and can be used
alongside the und
RPC interface.
# Contents
# Prerequisites
Before continuing, ensure you have gone through the following docs:
# Running a light client
The Light Client can be started by setting the configuring options for a full node in app.toml
as follows:
[api]
enable = true
swagger = true
address = "tcp://0.0.0.0:1317"
Then running the und start
command as normal
und start
This will start the light client on your local host listening on localhost:1317
, and use the node
hosted at 11.22.33.44:26657
to source its data and interface with the FUND-Mainchain-TestNet-v8
chain
(e.g. broadcast any transactions).
TIP
setting the listen address IP to 0.0.0.0
, e.g. tcp://0.0.0.0:1317
will allow any host to connect to your REST server.
Once running, you can visit http://localhost:1317/swagger/ (opens new window) to view all the REST endpoints available.
# Running an Archive RPC node
Light Clients are more effective when interfacing with full nodes running in "archive" mode. Nodes running in archive mode do not prune any sync data, and keep a complete transaction event history.
The quickest way to get up and running with an archive node is to configure the pruning option in
$HOME/.und_mainchain/config/app.toml
:
pruning = "nothing"
Then, start the full node as usual using:
und start
Your light client can then be configured to connect to it via the --node
flag by passing tcp://127.0.0.1:26657
to it.