Go API client for lthn¶
OpenAPI for Lethean Blockchain
Overview¶
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 6.0.1
- Package version: 1.0.0
- Generator version: 7.16.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://lt.hn/
Installation¶
Install the following dependencies:
Put the package under your project folder and add the following in import:
To use a proxy, set the environment variable HTTP_PROXY:
Configuration of Server URL¶
Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.
Select Server Configuration¶
For using other server than the one defined on index 0 set context value lthn.ContextServerIndex of type int.
Templated Server URL¶
Templated server URL is formatted using default variables from configuration or from context value lthn.ContextServerVariables of type map[string]string.
ctx := context.WithValue(context.Background(), lthn.ContextServerVariables, map[string]string{
    "basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
URLs Configuration per Operation¶
Each operation can use different server URL defined using OperationServers map in the Configuration.
An operation is uniquely identified by "{classname}Service.{nickname}" string.
Similar rules for overriding default operation server index and variables applies by using lthn.ContextOperationServerIndices and lthn.ContextOperationServerVariables context maps.
ctx := context.WithValue(context.Background(), lthn.ContextOperationServerIndices, map[string]int{
    "{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), lthn.ContextOperationServerVariables, map[string]map[string]string{
    "{classname}Service.{nickname}": {
        "port": "8443",
    },
})
Documentation for API Endpoints¶
All URIs are relative to http://127.0.0.1:36943
| Class | Method | HTTP request | Description | 
|---|---|---|---|
| BlockUtilsSdkClientGo | CreateBlockTemplate | Post /block/template | Create a block template for mining | 
| BlockUtilsSdkClientGo | GetBlock | Get /block/{identifier} | Get a block by its hash or height (ID) | 
| BlockUtilsSdkClientGo | GetBlocks | Get /block | Get one or more blocks, with optional pagination. | 
| BlockUtilsSdkClientGo | GetHeight | Get /block/height | Get the current blockchain height | 
| BlockUtilsSdkClientGo | SubmitBlock | Post /block/submit | Submit a new block to the network | 
| InfoUtilsSdkClientGo | GetInfo | Get /info | Get detailed information about the blockchain and daemon state | 
| InfoUtilsSdkClientGo | Version | Get /info/version | Get API version | 
Documentation For Models¶
- BlockDetailsModel
- BlockProcessingPerformanceModel
- BlockTemplateModel
- BlockTemplateRequestModel
- DbStatInfoModel
- HeightModel
- InfoModel
- MaintainersInfoModel
- PerformanceModel
- PosEntryModel
- SubmitBlockRequestModel
- SubmitBlockResponseModel
- TransactionAttachmentModel
- TransactionDetailsModel
- TransactionExtraModel
- TransactionInputModel
- TransactionOutputModel
- TxGenerationContextModel
- TxPoolPerformanceModel
- TxProcessingPerformanceModel
- VersionModel
Documentation For Authorization¶
Endpoints do not require authorization.
Documentation for Utility Methods¶
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
- PtrBool
- PtrInt
- PtrInt32
- PtrInt64
- PtrFloat
- PtrFloat32
- PtrFloat64
- PtrString
- PtrTime