Swagger UI for Ergo Node
Overview
The Ergo node provides a REST API accessible via HTTP for interaction and control. The full API specification, following the OpenAPI standard, is available here. When the node is running, a user-friendly Swagger UI interface for exploring and interacting with the API is typically available at 127.0.0.1:9053/swagger (assuming default port settings).
Note: 127.0.0.1 refers to your local machine (localhost).
Advanced Operations
The Swagger UI allows you to perform advanced operations that might not be available through graphical wallet interfaces, such as:
- Creating non-standard transactions with registers and context variables.
- Issuing tokens through transactions.
- Creating transactions that use specific boxes as inputs.
Accessing the API
Once the node is running, the API endpoints are typically accessible at 127.0.0.1:9053 (the default API port, distinct from the P2P port 9030).
To explore the API methods without setting up your own node, you can use the Swagger UI of public nodes, such as:
Note: Public node availability may vary.
To access protected API routes (like wallet operations), you must provide your API key (the secret phrase/password you set in the node configuration) in the api_key HTTP header of your requests. Alternatively, you can authorize your session directly within the Swagger UI interface by clicking the Authorize button and entering your API key there.
Note: Most wallet-related and node-control methods in the API are protected. You will need to provide the correct API key (hashed using Blake2b in your configuration file) to access these methods.
Authorization Process via Swagger UI
- 1Navigate to the Swagger UI page (e.g.,
127.0.0.1:9053/swagger). - 2Click the green
"Authorize"button located near the top right. - 3A dialog box will appear. Enter your plain text API key (the secret phrase you configured) into the
Valuefield. - 4Click
"Authorize"within the dialog, then"Close".
Your browser session is now authorized to access protected endpoints.
For example, navigate to the wallet/walletAddresses endpoint, click "Try it out", and then "Execute". If authorized correctly, you should see the list of addresses managed by your node's wallet.
Note: The Swagger UI authorization mechanism might appear to accept any input in the Value field. However, API calls to protected endpoints will fail if the provided API key does not match the apiKeyHash configured in your node. If you encounter authorization errors despite entering the correct key, potential causes include typos, incorrect hashing of the key in the config file, or, rarely, node database issues (try restarting the node first; a resync might be needed in severe cases).
Main Methods
Here are some of the main methods you can use:
Wallet Management
/wallet/init- Initialize a new wallet/wallet/restore- Restore existing wallet/wallet/unlock- Unlock the wallet/wallet/lock- Lock the wallet/wallet/status- Get wallet status
Transactions
/wallet/payment/send- Send payment/wallet/transactions- Get transaction list
Address Management
/wallet/deriveNextKey- Derive next key/wallet/deriveKey- Derive specific key
Balances
/wallet/balances- Get wallet balances
Example: Deriving Addresses
To derive a specific address, navigate to the /wallet/deriveKey endpoint, click "Try it out", and enter the desired derivation path in the derivationPath field. For example, to derive the first standard address:
"derivationPath": "m/44'/429'/0'/0/0"