forked from lthn/blockchain
Introduces a generated Go SDK client for the Lethean Blockchain API, including OpenAPI spec, models, API interfaces, documentation, and tests. This enables Go applications to interact with Lethean blockchain endpoints for block, info, and transaction operations.
135 lines
3.6 KiB
Markdown
Generated
135 lines
3.6 KiB
Markdown
Generated
# \InfoAPI
|
|
|
|
All URIs are relative to *http://127.0.0.1:36943*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**GetInfo**](InfoAPI.md#GetInfo) | **Get** /info | Get detailed information about the blockchain and daemon state
|
|
[**Version**](InfoAPI.md#Version) | **Get** /info/version | Get API version
|
|
|
|
|
|
|
|
## GetInfo
|
|
|
|
> InfoModel GetInfo(ctx).Flags(flags).Execute()
|
|
|
|
Get detailed information about the blockchain and daemon state
|
|
|
|
### Example
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
openapiclient "github.com/letheanVPN/blockchain/lthn"
|
|
)
|
|
|
|
func main() {
|
|
flags := "flags_example" // string | Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
|
|
|
|
configuration := openapiclient.NewConfiguration()
|
|
apiClient := openapiclient.NewAPIClient(configuration)
|
|
resp, r, err := apiClient.InfoAPI.GetInfo(context.Background()).Flags(flags).Execute()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.GetInfo``: %v\n", err)
|
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
}
|
|
// response from `GetInfo`: InfoModel
|
|
fmt.Fprintf(os.Stdout, "Response from `InfoAPI.GetInfo`: %v\n", resp)
|
|
}
|
|
```
|
|
|
|
### Path Parameters
|
|
|
|
|
|
|
|
### Other Parameters
|
|
|
|
Other parameters are passed through a pointer to a apiGetInfoRequest struct via the builder pattern
|
|
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**flags** | **string** | Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. |
|
|
|
|
### Return type
|
|
|
|
[**InfoModel**](InfoModel.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
[[Back to Model list]](../README.md#documentation-for-models)
|
|
[[Back to README]](../README.md)
|
|
|
|
|
|
## Version
|
|
|
|
> VersionModel Version(ctx).Execute()
|
|
|
|
Get API version
|
|
|
|
|
|
|
|
### Example
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
openapiclient "github.com/letheanVPN/blockchain/lthn"
|
|
)
|
|
|
|
func main() {
|
|
|
|
configuration := openapiclient.NewConfiguration()
|
|
apiClient := openapiclient.NewAPIClient(configuration)
|
|
resp, r, err := apiClient.InfoAPI.Version(context.Background()).Execute()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.Version``: %v\n", err)
|
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
}
|
|
// response from `Version`: VersionModel
|
|
fmt.Fprintf(os.Stdout, "Response from `InfoAPI.Version`: %v\n", resp)
|
|
}
|
|
```
|
|
|
|
### Path Parameters
|
|
|
|
This endpoint does not need any parameter.
|
|
|
|
### Other Parameters
|
|
|
|
Other parameters are passed through a pointer to a apiVersionRequest struct via the builder pattern
|
|
|
|
|
|
### Return type
|
|
|
|
[**VersionModel**](VersionModel.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
[[Back to Model list]](../README.md#documentation-for-models)
|
|
[[Back to README]](../README.md)
|
|
|