getChainState
Gets the current state of a given sidechain
Gets the current state of a given sidechain e.g. has chain started, is in configuration phase, is in candidature phase, is secret sharing phase, etc
/api/Producer/GetChainState
Usage and SDK Samples
curl -X GET "//api/Producer/GetChainState?chainName="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ProducerApi;
import java.io.File;
import java.util.*;
public class ProducerApiExample {
public static void main(String[] args) {
ProducerApi apiInstance = new ProducerApi();
String chainName = chainName_example; // String | Name of the sidechain
try {
apiInstance.getChainState(chainName);
} catch (ApiException e) {
System.err.println("Exception when calling ProducerApi#getChainState");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ProducerApi;
public class ProducerApiExample {
public static void main(String[] args) {
ProducerApi apiInstance = new ProducerApi();
String chainName = chainName_example; // String | Name of the sidechain
try {
apiInstance.getChainState(chainName);
} catch (ApiException e) {
System.err.println("Exception when calling ProducerApi#getChainState");
e.printStackTrace();
}
}
}
String *chainName = chainName_example; // Name of the sidechain (optional)
ProducerApi *apiInstance = [[ProducerApi alloc] init];
// Gets the current state of a given sidechain
[apiInstance getChainStateWith:chainName
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ServiceProviderApi = require('service_provider_api');
var api = new ServiceProviderApi.ProducerApi()
var opts = {
'chainName': chainName_example // {{String}} Name of the sidechain
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.getChainState(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getChainStateExample
{
public void main()
{
var apiInstance = new ProducerApi();
var chainName = chainName_example; // String | Name of the sidechain (optional)
try
{
// Gets the current state of a given sidechain
apiInstance.getChainState(chainName);
}
catch (Exception e)
{
Debug.Print("Exception when calling ProducerApi.getChainState: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiProducerApi();
$chainName = chainName_example; // String | Name of the sidechain
try {
$api_instance->getChainState($chainName);
} catch (Exception $e) {
echo 'Exception when calling ProducerApi->getChainState: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ProducerApi;
my $api_instance = WWW::SwaggerClient::ProducerApi->new();
my $chainName = chainName_example; # String | Name of the sidechain
eval {
$api_instance->getChainState(chainName => $chainName);
};
if ($@) {
warn "Exception when calling ProducerApi->getChainState: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.ProducerApi()
chainName = chainName_example # String | Name of the sidechain (optional)
try:
# Gets the current state of a given sidechain
api_instance.get_chain_state(chainName=chainName)
except ApiException as e:
print("Exception when calling ProducerApi->getChainState: %s\n" % e)
Parameters
Name | Description |
---|---|
chainName |
String
Name of the sidechain
|