RPC Methods
RPC methods are a set of functions that allow developers to interact directly with the Stellar network. You can learn more about all the RPC methods here. The Lab provides an easy way to use these methods from the UI. To access the "RPC Methods" section, click on the "API Explorer" link in the main navigation, which will open a new page listing all RPC methods by name.
RPC URL is required to submit these methods. You can update or set the RPC URL in the network selector in the main navigation bar.
Example
We’ll select the getLedgerEntries
method as an example. At the top of the page is a "View Docs" link to learn more about this method. The read-only input field shows the RPC URL (you’ll see a warning to provide the RPC URL if the input is empty). Next to the input is a Submit button, which will be disabled until all the required data is filled and valid. The Share and Save buttons are next to the Submit button. More about them below.
There are two ways to input the Ledger Key: XDR Base64 string or manual inputs. You can change the input mode by clicking the "Switch input" button. Here’s an example when inputting XDR string AAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAE=
. Manual inputs are generated as read-only (XDR string would be generated if the manual input mode was selected and correctly filled).
You can add multiple ledger keys by clicking the "Add another ledger key" button.
You can change the response format in the "XDR Format" dropdown: base64
(XDR) or json
(more human-readable).
The "Payload" section generates a preview of the payload that will be submitted.
To submit the request, click the Submit button at the top (it should be enabled if all the fields are correct). Once the request is processed, the response will be displayed at the bottom of the page.
Share Feature
The Stellar Lab allows you to share RPC methods with filled data. Simply click on the Share button (next to the Submit button) to copy the link to share. Here is an example of the shareable link from the above.
Saved Requests
You can save methods in the browser’s local storage by clicking the Save button (next to the Share button). Once you click that button, a modal will pop up, where you will need to enter the name and click save. To view your saved RPC methods in the Lab, click the "Saved Requests" link in the menu, then click the "RPC Methods" tab in the top right.
Only items for the selected network are shown. If you don’t see the item you’re looking for, try changing the network.
Every saved request item has the following:
- RPC method name - quickly identify the method you need.
- Name - makes finding the RPC method you’re looking for easy. You can update the name anytime by clicking the edit button and saving the new name.
- RPC URL - where to submit the request.
- Share the URL to view the method with all the data in the Lab.
- View the item in the API Explorer, where you can submit it.
- View payload.
- The last saved date and time.
- Delete the item if it’s no longer needed.