Skip to content

Latest commit

 

History

History
896 lines (579 loc) · 23.2 KB

ChainsApi.md

File metadata and controls

896 lines (579 loc) · 23.2 KB

\ChainsApi

All URIs are relative to http://localhost

Method HTTP request Description
ActivateChain Post /v1/chains/{chainID}/activate Activate a chain
AddAccessNode Put /v1/chains/{chainID}/access-node/{peer} Configure a trusted node to be an access node.
DeactivateChain Post /v1/chains/{chainID}/deactivate Deactivate a chain
GetChainInfo Get /v1/chains/{chainID} Get information about a specific chain
GetChains Get /v1/chains Get a list of all chains
GetCommitteeInfo Get /v1/chains/{chainID}/committee Get information about the deployed committee
GetContracts Get /v1/chains/{chainID}/contracts Get all available chain contracts
GetRequestIDFromEVMTransactionID Get /v1/chains/{chainID}/evm/tx/{txHash} Get the ISC request ID for the given Ethereum transaction hash
GetStateValue Get /v1/chains/{chainID}/state/{stateKey} Fetch the raw value associated with the given key in the chain state
RemoveAccessNode Delete /v1/chains/{chainID}/access-node/{peer} Remove an access node.
SetChainRecord Post /v1/chains/{chainID}/chainrecord Sets the chain record.
V1ChainsChainIDEvmGet Get /v1/chains/{chainID}/evm Ethereum JSON-RPC
V1ChainsChainIDEvmWsGet Get /v1/chains/{chainID}/evm/ws Ethereum JSON-RPC (Websocket transport)

ActivateChain

ActivateChain(ctx, chainID).Execute()

Activate a chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.ActivateChain(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.ActivateChain``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AddAccessNode

AddAccessNode(ctx, chainID, peer).Execute()

Configure a trusted node to be an access node.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    peer := "peer_example" // string | Name or PubKey (hex) of the trusted peer

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.AddAccessNode(context.Background(), chainID, peer).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.AddAccessNode``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
peer string Name or PubKey (hex) of the trusted peer

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeactivateChain

DeactivateChain(ctx, chainID).Execute()

Deactivate a chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.DeactivateChain(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.DeactivateChain``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetChainInfo

ChainInfoResponse GetChainInfo(ctx, chainID).Execute()

Get information about a specific chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

ChainInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetChains

[]ChainInfoResponse GetChains(ctx).Execute()

Get a list of all chains

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]ChainInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetCommitteeInfo

CommitteeInfoResponse GetCommitteeInfo(ctx, chainID).Execute()

Get information about the deployed committee

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

CommitteeInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetContracts

[]ContractInfoResponse GetContracts(ctx, chainID).Execute()

Get all available chain contracts

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetContracts(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetContracts``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetContracts`: []ContractInfoResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetContracts`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

[]ContractInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetRequestIDFromEVMTransactionID

RequestIDResponse GetRequestIDFromEVMTransactionID(ctx, chainID, txHash).Execute()

Get the ISC request ID for the given Ethereum transaction hash

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    txHash := "txHash_example" // string | Transaction hash (Hex)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
txHash string Transaction hash (Hex)

Other Parameters

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

Name Type Description Notes

Return type

RequestIDResponse

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]

GetStateValue

StateResponse GetStateValue(ctx, chainID, stateKey).Execute()

Fetch the raw value associated with the given key in the chain state

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    stateKey := "stateKey_example" // string | State Key (Hex)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
stateKey string State Key (Hex)

Other Parameters

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

Name Type Description Notes

Return type

StateResponse

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]

RemoveAccessNode

RemoveAccessNode(ctx, chainID, peer).Execute()

Remove an access node.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    peer := "peer_example" // string | Name or PubKey (hex) of the trusted peer

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.RemoveAccessNode(context.Background(), chainID, peer).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.RemoveAccessNode``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
peer string Name or PubKey (hex) of the trusted peer

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SetChainRecord

SetChainRecord(ctx, chainID).ChainRecord(chainRecord).Execute()

Sets the chain record.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    chainRecord := *openapiclient.NewChainRecord([]string{"AccessNodes_example"}, false) // ChainRecord | Chain Record

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.SetChainRecord(context.Background(), chainID).ChainRecord(chainRecord).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.SetChainRecord``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

chainRecord | ChainRecord | Chain Record |

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

V1ChainsChainIDEvmGet

V1ChainsChainIDEvmGet(ctx, chainID).Execute()

Ethereum JSON-RPC

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.V1ChainsChainIDEvmGet(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.V1ChainsChainIDEvmGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

V1ChainsChainIDEvmWsGet

V1ChainsChainIDEvmWsGet(ctx, chainID).Execute()

Ethereum JSON-RPC (Websocket transport)

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.V1ChainsChainIDEvmWsGet(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.V1ChainsChainIDEvmWsGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]