Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds moon_getLatestSyncedBlock to moonbeam custom API methods #974

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion builders/ethereum/json-rpc/moonbeam-custom-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ description: Discover Moonbeam's specialized API endpoints, featuring custom JSO

## Introduction {: #introduction }

Moonbeam nodes include support for two custom JSON-RPC endpoints: `moon_isBlockFinalized` and `moon_isTxFinalized`. These endpoints provide valuable functionality for checking the finality of on-chain events.
Moonbeam nodes include support for custom JSON-RPC endpoints:
dawnkelly09 marked this conversation as resolved.
Show resolved Hide resolved

- `moon_isBlockFinalized`
- `moon_isTxFinalized`
- `moon_getLatestSyncedBlock`

These endpoints provide valuable functionality for checking the finality of on-chain events.

To begin exploring Moonbeam's custom JSON-RPC endpoints, you can try out the provided curl examples below. These examples demonstrate how to query the public RPC endpoint of Moonbase Alpha. However, you can easily modify them to use with your own Moonbeam or Moonriver endpoint by changing the URL and API key. If you haven't already, you can obtain your endpoint and API key from one of our supported [Endpoint Providers](/builders/get-started/endpoints/){target=\_blank}.

Expand Down Expand Up @@ -58,3 +64,30 @@ To begin exploring Moonbeam's custom JSON-RPC endpoints, you can try out the pro
"params": ["INSERT_TRANSACTION_HASH"]
}' {{ networks.moonbase.rpc_url }}
```

???+ function "moon_getLatestSyncedBlock"

Returns the latest synced block number.

=== "Parameters"

None

=== "Returns"
dawnkelly09 marked this conversation as resolved.
Show resolved Hide resolved

Returns an integer: the latest synced block from Frontier's backend

=== "Example"

```bash
curl -H "Content-Type: application/json" -X POST --data '{
"jsonrpc": "2.0",
"id": "1",
"method": "moon_getLatestSyncedBlock",
"params": []
}' {{ networks.moonbase.rpc_url }}
```




Loading