All URIs are relative to https://api-mainnet.celenium.io/v1
Method | HTTP request | Description |
---|---|---|
GetValidator | Get /validators/{id} | Get validator info |
GetValidatorBlocks | Get /validators/{id}/blocks | Get blocks which was proposed by validator |
GetValidatorUptime | Get /validators/{id}/uptime | Get validator's uptime and history of signed block |
ListValidator | Get /validators | List validators |
ValidatorCount | Get /validators/count | Get validator's count by status |
ValidatorDelegators | Get /validators/{id}/delegators | Get validator's delegators |
ValidatorJails | Get /validators/{id}/jails | Get validator's jails |
ResponsesValidator GetValidator(ctx, id).Execute()
Get validator info
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
id := int32(56) // int32 | Internal validator id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.GetValidator(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.GetValidator``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetValidator`: ResponsesValidator
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.GetValidator`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | Internal validator id |
Other parameters are passed through a pointer to a apiGetValidatorRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponsesBlock GetValidatorBlocks(ctx, id).Limit(limit).Offset(offset).Execute()
Get blocks which was proposed by validator
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
id := int32(56) // int32 | Internal validator id
limit := int32(56) // int32 | Count of requested entities (optional)
offset := int32(56) // int32 | Offset (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.GetValidatorBlocks(context.Background(), id).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.GetValidatorBlocks``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetValidatorBlocks`: ResponsesBlock
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.GetValidatorBlocks`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | Internal validator id |
Other parameters are passed through a pointer to a apiGetValidatorBlocksRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | Count of requested entities | offset | int32 | Offset |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponsesValidatorUptime GetValidatorUptime(ctx, id).Limit(limit).Execute()
Get validator's uptime and history of signed block
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
id := int32(56) // int32 | Internal validator id
limit := int32(56) // int32 | Count of requested blocks (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.GetValidatorUptime(context.Background(), id).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.GetValidatorUptime``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetValidatorUptime`: ResponsesValidatorUptime
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.GetValidatorUptime`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | Internal validator id |
Other parameters are passed through a pointer to a apiGetValidatorUptimeRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | Count of requested blocks |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ResponsesValidator ListValidator(ctx).Limit(limit).Offset(offset).Jailed(jailed).Execute()
List validators
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
limit := int32(56) // int32 | Count of requested entities (optional)
offset := int32(56) // int32 | Offset (optional)
jailed := true // bool | Return only jailed validators (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.ListValidator(context.Background()).Limit(limit).Offset(offset).Jailed(jailed).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ListValidator``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListValidator`: []ResponsesValidator
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ListValidator`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListValidatorRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
limit | int32 | Count of requested entities | |
offset | int32 | Offset | |
jailed | bool | Return only jailed validators |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResponsesValidatorCount ValidatorCount(ctx).Execute()
Get validator's count by status
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.ValidatorCount(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorCount``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ValidatorCount`: ResponsesValidatorCount
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorCount`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiValidatorCountRequest struct via the builder pattern
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ResponsesDelegation ValidatorDelegators(ctx, id).Limit(limit).Offset(offset).ShowZero(showZero).Execute()
Get validator's delegators
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
id := int32(56) // int32 | Internal validator id
limit := int32(56) // int32 | Count of requested entities (optional)
offset := int32(56) // int32 | Offset (optional)
showZero := true // bool | Show zero delegations (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.ValidatorDelegators(context.Background(), id).Limit(limit).Offset(offset).ShowZero(showZero).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorDelegators``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ValidatorDelegators`: []ResponsesDelegation
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorDelegators`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | Internal validator id |
Other parameters are passed through a pointer to a apiValidatorDelegatorsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | Count of requested entities | offset | int32 | Offset | showZero | bool | Show zero delegations |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ResponsesJail ValidatorJails(ctx, id).Limit(limit).Offset(offset).Execute()
Get validator's jails
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/celenium-io/celenium-api-go"
)
func main() {
id := int32(56) // int32 | Internal validator id
limit := int32(56) // int32 | Count of requested entities (optional)
offset := int32(56) // int32 | Offset (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ValidatorAPI.ValidatorJails(context.Background(), id).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorJails``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ValidatorJails`: []ResponsesJail
fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorJails`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | Internal validator id |
Other parameters are passed through a pointer to a apiValidatorJailsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | Count of requested entities | offset | int32 | Offset |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]