# Light Client/REST
undcli binary comes packaged with a full REST capable server, from which the majority of the
undcli query ... and
undcli tx ... commands can also be served.
Before continuing, ensure you have gone through the following docs:
# Running a light client
The Light Client can be started using the following command:
undcli rest-server --laddr=[tcp://ip:port] --node [tcp://ip:port] --chain-id=[chain_id]
undcli rest-server --laddr=tcp://localhost:1317 --node tcp://18.104.22.168:26657 --chain-id=FUND-Mainchain-TestNet-v8
This will start the light client on your local host listening on
localhost:1317, and use the node hosted at
22.214.171.124:26657 to source its data and interface with the
FUND-Mainchain-TestNet-v8 chain (e.g. broadcast any transactions).
setting the listen address IP to
--laddr=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-ui/ to view all of the REST endpoints available.
undcli rest-server command specification can be found here.
# 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
pruning = "nothing"
Then, start the full node as usual using:
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.