Service Provider API

getChainPayment

Gets the payment in BBT per block of a given sidechain

Gets the payment in BBT that a producer will receive when he produces one block of a given sidechain


/api/Producer/GetChainPayment

Usage and SDK Samples

curl -X GET "//api/Producer/GetChainPayment?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.getChainPayment(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getChainPayment");
            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.getChainPayment(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getChainPayment");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Name of the Sidechain (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Gets the payment in BBT per block of a given sidechain
[apiInstance getChainPaymentWith: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.getChainPayment(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getChainPaymentExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Name of the Sidechain (optional) 

            try
            {
                // Gets the payment in BBT per block of a given sidechain
                apiInstance.getChainPayment(chainName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.getChainPayment: " + 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->getChainPayment($chainName);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->getChainPayment: ', $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->getChainPayment(chainName => $chainName);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->getChainPayment: [email protected]\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 payment in BBT per block of a given sidechain
    api_instance.get_chain_payment(chainName=chainName)
except ApiException as e:
    print("Exception when calling ProducerApi->getChainPayment: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Name of the Sidechain

Responses

Status: 200 - Chain payment retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving the payment information


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 ([email protected]) {
    warn "Exception when calling ProducerApi->getChainState: [email protected]\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

Query parameters
Name Description
chainName
String
Name of the sidechain

Responses

Status: 200 - Contract state retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving contract state


getContractInfo

Gets the contract information of a sidechain that is started and configured

Retrieves relevant information about a sidechain, e.g. payment per block, mininum producer stake to participate, required number of producers, max block size in bytes, etc


/api/Producer/GetContractInfo

Usage and SDK Samples

curl -X GET "//api/Producer/GetContractInfo?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.getContractInfo(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getContractInfo");
            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.getContractInfo(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getContractInfo");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Name of the sidechain (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Gets the contract information of a sidechain that is started and configured
[apiInstance getContractInfoWith: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.getContractInfo(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getContractInfoExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Name of the sidechain (optional) 

            try
            {
                // Gets the contract information of a sidechain that is started and configured
                apiInstance.getContractInfo(chainName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.getContractInfo: " + 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->getContractInfo($chainName);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->getContractInfo: ', $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->getContractInfo(chainName => $chainName);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->getContractInfo: [email protected]\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 contract information of a sidechain that is started and configured
    api_instance.get_contract_info(chainName=chainName)
except ApiException as e:
    print("Exception when calling ProducerApi->getContractInfo: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Name of the sidechain

Responses

Status: 200 - Contract information retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving the contract information


getProducerCandidature

Gets information about the participation state of the producer on a sidechain

Confirms if the producer has applied successfully to produce a given sidechain


/api/Producer/GetProducerCandidature

Usage and SDK Samples

curl -X GET "//api/Producer/GetProducerCandidature?chainName=&forceDelete="
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
        Boolean forceDelete = true; // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases
        try {
            apiInstance.getProducerCandidature(chainName, forceDelete);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getProducerCandidature");
            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
        Boolean forceDelete = true; // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases
        try {
            apiInstance.getProducerCandidature(chainName, forceDelete);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getProducerCandidature");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Name of the sidechain (optional)
Boolean *forceDelete = true; // This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Gets information about the participation state of the producer on a sidechain
[apiInstance getProducerCandidatureWith:chainName
    forceDelete:forceDelete
              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
  'forceDelete': true // {{Boolean}} This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.getProducerCandidature(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getProducerCandidatureExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Name of the sidechain (optional) 
            var forceDelete = true;  // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases (optional) 

            try
            {
                // Gets information about the participation state of the producer on a sidechain
                apiInstance.getProducerCandidature(chainName, forceDelete);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.getProducerCandidature: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiProducerApi();
$chainName = chainName_example; // String | Name of the sidechain
$forceDelete = true; // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases

try {
    $api_instance->getProducerCandidature($chainName, $forceDelete);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->getProducerCandidature: ', $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
my $forceDelete = true; # Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases

eval { 
    $api_instance->getProducerCandidature(chainName => $chainName, forceDelete => $forceDelete);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->getProducerCandidature: [email protected]\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)
forceDelete = true # Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases (optional)

try: 
    # Gets information about the participation state of the producer on a sidechain
    api_instance.get_producer_candidature(chainName=chainName, forceDelete=forceDelete)
except ApiException as e:
    print("Exception when calling ProducerApi->getProducerCandidature: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Name of the sidechain
forceDelete
Boolean
This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases

Responses

Status: 200 - Information retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving the information


getTotalCandidatesInChain

Gets the current number of candidates for a given sidechain

Gets the current number of candidates that have applied to produce a given sidechain


/api/Producer/GetTotalCandidatesInChain

Usage and SDK Samples

curl -X GET "//api/Producer/GetTotalCandidatesInChain?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.getTotalCandidatesInChain(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getTotalCandidatesInChain");
            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.getTotalCandidatesInChain(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getTotalCandidatesInChain");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Name of the sidechain (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Gets the current number of candidates for a given sidechain
[apiInstance getTotalCandidatesInChainWith: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.getTotalCandidatesInChain(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTotalCandidatesInChainExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Name of the sidechain (optional) 

            try
            {
                // Gets the current number of candidates for a given sidechain
                apiInstance.getTotalCandidatesInChain(chainName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.getTotalCandidatesInChain: " + 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->getTotalCandidatesInChain($chainName);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->getTotalCandidatesInChain: ', $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->getTotalCandidatesInChain(chainName => $chainName);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->getTotalCandidatesInChain: [email protected]\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 number of candidates for a given sidechain
    api_instance.get_total_candidates_in_chain(chainName=chainName)
except ApiException as e:
    print("Exception when calling ProducerApi->getTotalCandidatesInChain: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Name of the sidechain

Responses

Status: 200 - Total producers retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving total candidates information.


getTotalProducerPayment

Gets the total amount of BBT that needs to be paid to the producers at a given moment since the last settlement

The producer


/api/Producer/GetTotalProducerPayment

Usage and SDK Samples

curl -X GET "//api/Producer/GetTotalProducerPayment?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.getTotalProducerPayment(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getTotalProducerPayment");
            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.getTotalProducerPayment(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getTotalProducerPayment");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Name of the sidechain (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Gets the total amount of BBT that needs to be paid to the producers at a given moment since the last settlement
[apiInstance getTotalProducerPaymentWith: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.getTotalProducerPayment(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTotalProducerPaymentExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Name of the sidechain (optional) 

            try
            {
                // Gets the total amount of BBT that needs to be paid to the producers at a given moment since the last settlement
                apiInstance.getTotalProducerPayment(chainName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.getTotalProducerPayment: " + 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->getTotalProducerPayment($chainName);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->getTotalProducerPayment: ', $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->getTotalProducerPayment(chainName => $chainName);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->getTotalProducerPayment: [email protected]\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 total amount of BBT that needs to be paid to the producers at a given moment since the last settlement
    api_instance.get_total_producer_payment(chainName=chainName)
except ApiException as e:
    print("Exception when calling ProducerApi->getTotalProducerPayment: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Name of the sidechain

Responses

Status: 200 - Chain payment retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving the payments information


getTotalProducersNeeded

Gets the total producers requested for a given sidechain

Gets the number of sidechain producers requested for a given sidechain


/api/Producer/GetTotalProducersNeeded

Usage and SDK Samples

curl -X GET "//api/Producer/GetTotalProducersNeeded?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.getTotalProducersNeeded(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getTotalProducersNeeded");
            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.getTotalProducersNeeded(chainName);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#getTotalProducersNeeded");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Name of the sidechain (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Gets the total producers requested for a given sidechain
[apiInstance getTotalProducersNeededWith: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.getTotalProducersNeeded(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getTotalProducersNeededExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Name of the sidechain (optional) 

            try
            {
                // Gets the total producers requested for a given sidechain
                apiInstance.getTotalProducersNeeded(chainName);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.getTotalProducersNeeded: " + 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->getTotalProducersNeeded($chainName);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->getTotalProducersNeeded: ', $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->getTotalProducersNeeded(chainName => $chainName);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->getTotalProducersNeeded: [email protected]\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 total producers requested for a given sidechain
    api_instance.get_total_producers_needed(chainName=chainName)
except ApiException as e:
    print("Exception when calling ProducerApi->getTotalProducersNeeded: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Name of the sidechain

Responses

Status: 200 - Producers needed retrieved with success

Status: 400 - Invalid parameters

Status: 500 - Error retrieving the number of producers requested


sendCandidatureToChain

Sends a transaction to BlockBase Operations Contract that contains the producer application information for producing the sidechain

The producer uses this service to apply to producing a specific sidechain. With this service, they send information about how much time in seconds they are willing to work on that sidechain


/api/Producer/SendCandidatureToChain

Usage and SDK Samples

curl -X POST "//api/Producer/SendCandidatureToChain?chainName=&workTime=&forceDelete="
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 | Account name of the sidechain
        Integer workTime = 56; // Integer | How much time in seconds the producer will produce the sidechain
        Boolean forceDelete = true; // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases
        try {
            apiInstance.sendCandidatureToChain(chainName, workTime, forceDelete);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#sendCandidatureToChain");
            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 | Account name of the sidechain
        Integer workTime = 56; // Integer | How much time in seconds the producer will produce the sidechain
        Boolean forceDelete = true; // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases
        try {
            apiInstance.sendCandidatureToChain(chainName, workTime, forceDelete);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProducerApi#sendCandidatureToChain");
            e.printStackTrace();
        }
    }
}
String *chainName = chainName_example; // Account name of the sidechain (optional)
Integer *workTime = 56; // How much time in seconds the producer will produce the sidechain (optional)
Boolean *forceDelete = true; // This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases (optional)

ProducerApi *apiInstance = [[ProducerApi alloc] init];

// Sends a transaction to BlockBase Operations Contract that contains the producer application information for producing the sidechain
[apiInstance sendCandidatureToChainWith:chainName
    workTime:workTime
    forceDelete:forceDelete
              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}} Account name of the sidechain
  'workTime': 56, // {{Integer}} How much time in seconds the producer will produce the sidechain
  'forceDelete': true // {{Boolean}} This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.sendCandidatureToChain(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class sendCandidatureToChainExample
    {
        public void main()
        {

            var apiInstance = new ProducerApi();
            var chainName = chainName_example;  // String | Account name of the sidechain (optional) 
            var workTime = 56;  // Integer | How much time in seconds the producer will produce the sidechain (optional) 
            var forceDelete = true;  // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases (optional) 

            try
            {
                // Sends a transaction to BlockBase Operations Contract that contains the producer application information for producing the sidechain
                apiInstance.sendCandidatureToChain(chainName, workTime, forceDelete);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProducerApi.sendCandidatureToChain: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiProducerApi();
$chainName = chainName_example; // String | Account name of the sidechain
$workTime = 56; // Integer | How much time in seconds the producer will produce the sidechain
$forceDelete = true; // Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases

try {
    $api_instance->sendCandidatureToChain($chainName, $workTime, $forceDelete);
} catch (Exception $e) {
    echo 'Exception when calling ProducerApi->sendCandidatureToChain: ', $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 | Account name of the sidechain
my $workTime = 56; # Integer | How much time in seconds the producer will produce the sidechain
my $forceDelete = true; # Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases

eval { 
    $api_instance->sendCandidatureToChain(chainName => $chainName, workTime => $workTime, forceDelete => $forceDelete);
};
if ([email protected]) {
    warn "Exception when calling ProducerApi->sendCandidatureToChain: [email protected]\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 | Account name of the sidechain (optional)
workTime = 56 # Integer | How much time in seconds the producer will produce the sidechain (optional)
forceDelete = true # Boolean | This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases (optional)

try: 
    # Sends a transaction to BlockBase Operations Contract that contains the producer application information for producing the sidechain
    api_instance.send_candidature_to_chain(chainName=chainName, workTime=workTime, forceDelete=forceDelete)
except ApiException as e:
    print("Exception when calling ProducerApi->sendCandidatureToChain: %s\n" % e)

Parameters

Query parameters
Name Description
chainName
String
Account name of the sidechain
workTime
Integer (int32)
How much time in seconds the producer will produce the sidechain
forceDelete
Boolean
This parameter is here only to simplify testing purposes. It makes it more easy to restart the whole system and delete previous existing databases

Responses

Status: 200 - Candidature sent with success

Status: 400 - Invalid parameters

Status: 500 - Error sending candidature