6.1 Using REST API
Spicenet provides a comprehensive REST API for interacting with your node. Here are some key endpoints and their usage:
Get events for a specific slot:
Example: http://localhost:12346/ledger/events/17
Get events for a specific transaction:
Example: http://localhost:12346/ledger/txs/50/events/0
Get events with a specific key:
Example: http://localhost:12346/ledger/batches/10/txs/2/events/0
To use these endpoints, you can use curl in your terminal or any HTTP client. For example:
This will retrieve all events for slot 17 and format the JSON output for readability.
Last updated