Skip to content

Latest commit

 

History

History
808 lines (523 loc) · 21.5 KB

File metadata and controls

808 lines (523 loc) · 21.5 KB

\ValidatorAPI

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
ValidatorMessages Get /validators/{id}/messages Get validator messages
ValidatorMetrics Get /validators/{id}/metrics Get validator's metrics
ValidatorVotes Get /validators/{id}/votes Get list of votes for validator
ValidatorsMetrics Get /validators/metrics Get validators metrics

GetValidator

ResponsesValidator GetValidator(ctx, id).Execute()

Get validator info

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

Other parameters are passed through a pointer to a apiGetValidatorRequest struct via the builder pattern

Name Type Description Notes

Return type

ResponsesValidator

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]

GetValidatorBlocks

[]ResponsesBlock GetValidatorBlocks(ctx, id).Limit(limit).Offset(offset).Execute()

Get blocks which was proposed by validator

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

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 |

Return type

[]ResponsesBlock

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]

GetValidatorUptime

ResponsesValidatorUptime GetValidatorUptime(ctx, id).Limit(limit).Execute()

Get validator's uptime and history of signed block

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

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 |

Return type

ResponsesValidatorUptime

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]

ListValidator

[]ResponsesValidator ListValidator(ctx).Limit(limit).Offset(offset).Jailed(jailed).Version(version).Execute()

List validators

Example

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)
	version := int32(56) // int32 | Current validator app version (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ValidatorAPI.ListValidator(context.Background()).Limit(limit).Offset(offset).Jailed(jailed).Version(version).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)
}

Path Parameters

Other Parameters

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
version int32 Current validator app version

Return type

[]ResponsesValidator

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]

ValidatorCount

ResponsesValidatorCount ValidatorCount(ctx).Execute()

Get validator's count by status

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiValidatorCountRequest struct via the builder pattern

Return type

ResponsesValidatorCount

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]

ValidatorDelegators

[]ResponsesDelegation ValidatorDelegators(ctx, id).Limit(limit).Offset(offset).ShowZero(showZero).Execute()

Get validator's delegators

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

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 |

Return type

[]ResponsesDelegation

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]

ValidatorJails

[]ResponsesJail ValidatorJails(ctx, id).Limit(limit).Offset(offset).Execute()

Get validator's jails

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

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 |

Return type

[]ResponsesJail

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]

ValidatorMessages

[]ResponsesMessage ValidatorMessages(ctx, id).Limit(limit).Offset(offset).Sort(sort).From(from).To(to).Execute()

Get validator messages

Example

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)
	sort := "sort_example" // string | Sort order (optional)
	from := int32(56) // int32 | Time from in unix timestamp (optional)
	to := int32(56) // int32 | Time to in unix timestamp (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ValidatorAPI.ValidatorMessages(context.Background(), id).Limit(limit).Offset(offset).Sort(sort).From(from).To(to).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorMessages``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ValidatorMessages`: []ResponsesMessage
	fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorMessages`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

Other parameters are passed through a pointer to a apiValidatorMessagesRequest struct via the builder pattern

Name Type Description Notes

limit | int32 | Count of requested entities | offset | int32 | Offset | sort | string | Sort order | from | int32 | Time from in unix timestamp | to | int32 | Time to in unix timestamp |

Return type

[]ResponsesMessage

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]

ValidatorMetrics

ResponsesMetrics ValidatorMetrics(ctx, id).Execute()

Get validator's metrics

Example

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.ValidatorMetrics(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorMetrics``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ValidatorMetrics`: ResponsesMetrics
	fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorMetrics`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

Other parameters are passed through a pointer to a apiValidatorMetricsRequest struct via the builder pattern

Name Type Description Notes

Return type

ResponsesMetrics

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]

ValidatorVotes

[]ResponsesVote ValidatorVotes(ctx, id).Limit(limit).Offset(offset).Execute()

Get list of votes for validator

Example

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.ValidatorVotes(context.Background(), id).Limit(limit).Offset(offset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorVotes``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ValidatorVotes`: []ResponsesVote
	fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorVotes`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 Internal validator id

Other Parameters

Other parameters are passed through a pointer to a apiValidatorVotesRequest struct via the builder pattern

Name Type Description Notes

limit | int32 | Count of requested entities | offset | int32 | Offset |

Return type

[]ResponsesVote

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]

ValidatorsMetrics

ResponsesTopNMetrics ValidatorsMetrics(ctx).Count(count).Execute()

Get validators metrics

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/celenium-io/celenium-api-go"
)

func main() {
	count := int32(56) // int32 | Count of aggregated entities (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ValidatorAPI.ValidatorsMetrics(context.Background()).Count(count).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ValidatorAPI.ValidatorsMetrics``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ValidatorsMetrics`: ResponsesTopNMetrics
	fmt.Fprintf(os.Stdout, "Response from `ValidatorAPI.ValidatorsMetrics`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiValidatorsMetricsRequest struct via the builder pattern

Name Type Description Notes
count int32 Count of aggregated entities

Return type

ResponsesTopNMetrics

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]