How To Connect to Litecoin Node via GetBlock

By GetBlock | GetBlock News & Updates | 12 Oct 2022


Hello, it’s GetBlock. Today, we are going to show you what is going on when our clients are getting connected to Litecoin, one of the earliest Bitcoin (BTC) forks and large Proof-of-Work network.

Although Litecoin doesn’t support smart contracts, its node is very popular for analytical services, trading bots, charts dashboards, cross-chain DEXes and so on.

In this short guide we will experiment with Litecoin shared nodes. It is an entry-level offering by GetBlock: your services are using the same node with other clients. There's also a video on Youtube on how to connect to Litecoin (LTC) Node.

As such, we need to open the ‘Shared Nodes’ section in the Main Menu.

Let’s find the Litecoin node. You can use the ticker LTC. 

To start the demonstration we need to copy the endpoint address from the ‘Endpoints’ tab.

Then, we should copy the endpoint address to the Postman terminal and choose ‘POST’ as the type of request by changing ‘GET’ value to ‘POST’ value.

41d142ca8bdee3dd17c3d180993b7acd8f04a065256a4aa9bf06e67f80f8a298.png

Once this is done, go to the ‘Headers’ tab and set the parameters of our connection. First, let’s  input ‘x-api-key’ as the type of our key.

dec16b2d8534e45792a20461b8fac9e6a2259becfc526735be982ec2c8e13b26.png

To set the ‘VALUE’ properly, we need to have our unique API key, i.e. the number of our account assigned by GetBlock mechanisms. 

To do so, we need to get back to our GetBlock account and open the ‘Your API settings’ segment. We copy API data from the black field and paste them into the corresponding string of ‘Headers’. 

API Litecoin endpoint

(Once API data is filled, we need to set other inputs for our request in the ‘Body’ tab. We need ‘raw’ data about the blockchain processes, so let's choose ‘RAW’ as a type of data requested and JSON as data format.

RAW JSON

To set up the body of our request, let’s get back to GetBlock once again. In the ‘Main menu’, let’s open the ‘Documentation’ module.

Then please find the drop-down menu ‘Available Nodes Methods’ in the left section of the menu. Find the Litecoin point and choose ‘getblockhash’ command. 

Available Node Methods

What does this mean? This command allows us to see the hash (‘secret’) of the block with this or that number. In blockchains, hashes are used to secure the integrity of the block mining process.

As such, we need to copy the last seven strings of the requests (the part that starts after the words ‘data raw’) and paste it into the request field.

Right now, just one thing separates us from sending the request to the Litecoin blockchain: we need to know the number of blocks we’re seeking for a hash of. 

Let’s just repeat our first steps: go to the Litecoin section in the ‘Shared Nodes’ menu. Then, please, copy the ‘Height’ value: in blockchains, the number of last blocks added is called ‘block height’. 

Litecoin Height

Then, let’s copy this number to the ‘Params’ string and send the request (blue button in the upper right) to blockchain.

And that’s it: the hash is demonstrated in the ‘Result’ string. We’re good to go: we just reached the Litecoin blockchain with our GetBlock API key and extracted crucial raw data.

6517f02cac1d2d055249a7f1939cd4f92aa2427d6fda98536ae94af214c8380b.png

Have a great day and stay tuned for more updates from us!

How do you rate this article?

15


GetBlock
GetBlock Verified Member

GetBlock is a Blockchain RPC provider that offers fast and easy API connection to full nodes of 50+ blockchains, including Bitcoin (BTC), Ethereum (ETH), Binance Smart Chain (BSC), among others.


GetBlock News & Updates
GetBlock News & Updates

GetBlock is a Blockchain-as-a-Service (BaaS) platform that provides a fast and easy API connection to full nodes from many leading blockchain platforms. Here we're going to publish updates related to the project development.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.