forked from lthn/blockchain
This pull request introduces a comprehensive new API interface for the blockchain, leveraging OpenAPI v3 to facilitate direct consumption of chain data by GUI and web applications. This change significantly refines the project's build infrastructure, incorporating Conan for dependency management and CMake for configuration, alongside the integration of an OpenAPI Generator to produce SDKs for multiple languages. ### Highlights * **New API Interface**: Introduced a new API interface using OpenAPI v3 to enable GUI/WEB development to consume chain data without needing custom server applications. * **Build System Enhancements**: Significant updates to the build system, including Makefile, CMake, and Conan configurations, to streamline the build process and support new functionalities. * **Multi-language SDK Generation**: Integrated OpenAPI Generator to automatically create SDKs for various programming languages, including Go, Angular, and PHP, simplifying client-side integration.
3.8 KiB
Generated
3.8 KiB
Generated
\InfoUtilsSdkClientGo
All URIs are relative to http://127.0.0.1:36943
| Method | HTTP request | Description |
|---|---|---|
| GetInfo | Get /info | Get detailed information about the blockchain and daemon state |
| Version | Get /info/version | Get API version |
GetInfo
InfoModel GetInfo(ctx).Flags(flags).Execute()
Get detailed information about the blockchain and daemon state
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
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.InfoUtilsSdkClientGo.GetInfo(context.Background()).Flags(flags).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `InfoUtilsSdkClientGo.GetInfo``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetInfo`: InfoModel
fmt.Fprintf(os.Stdout, "Response from `InfoUtilsSdkClientGo.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
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Version
VersionModel Version(ctx).Execute()
Get API version
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/letheanVPN/blockchain/utils/sdk/client/go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.InfoUtilsSdkClientGo.Version(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `InfoUtilsSdkClientGo.Version``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `Version`: VersionModel
fmt.Fprintf(os.Stdout, "Response from `InfoUtilsSdkClientGo.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
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]