On this page

latest contributor to this doc

Last Edit:

@smk762

CC Lib

The following methods interact with Antara Modules that make use of the -ac_cclib parameter.

cclib insert_method insert_evalcode \"[%22json_string%22, json_integer, ... ]\"

The cclib method allows the user to interact with the dynamic Antara Module associated with evalcode.

Each evalcode module has unique methods and json parameters associated, as well as unique responses.

Arguments for cclib methods are supplied as arrays. When executed in the terminal, the values for the array can be added in a normal fashion. However, when cclib methods are executed as a part of a script, the shell cannot parse the arrays without additional formatting.

In the terminal, the array is bound by '' single-quotation characters and strings are bound by "" double-quotation characters.

Terminal format:

./komodo-cli -ac_name=MUSIG  cclib send 18 '["03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",1]'

In a bash-script, the array is bound by \"\" escaped double-quotation characters and strings within the array are bound by %22 %22 characters. (0x22 is the ASCII encoding for ".)

This format can be used in a terminal directly or in shell scripts, and therefore some developers may default to it, although the format is not always necessary.

Script format:

./komodo-cli -ac_name=MUSIG  cclib send 18 \"[%2203d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a%22,1]\"

The cclibinfo method returns a complete list of available methods and their parameters for each unique evalcode.

NameTypeDescription
method(string)the unique name of the method
evalcode(decimal number)the EVALCODE of the module of interest
json_params(array)the parameters to be supplied to the method, provided as an array

NameTypeDescription
(the response for each EVALCODE is different)

Command:

./komodo-cli -ac_name=MUSIG cclib combine 18 \"[%220225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a%22,%2202d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567%22]\"

cclibaddress evalcode pubkey

The cclibaddress method returns information about the addresses related to the specified pubkey, and according to the Antara Module associated with the specified evalcode. If no pubkey is provided, the pubkey used to the launch the daemon is the default.

NameTypeDescription
evalcode(decimal number)the EVALCODE of the module of interest
pubkey(string, optional)the public key related to the requested address information

NameTypeDescription
result(string)whether the command executed successfully
CClibCCAddress(string)taking the parameter evalcode as a modifier, this is the public address that corresponds to the Antara Module's privkey
CCbalance(number)the amount of coins in the CClibCCAddress
CClibNormalAddress(string)the unmodified public address generated from the Antara Module's privkey
CClibCCTokensAddress(string)this property is used for development purposes only and can otherwise be ignored
myAddress(string)the normal address generated from the pubkey
myCCAddress(CClib)(string)taking the parameter evalcode as a modifier, this is the public address that corresponds to the pubkey
PubkeyCCaddress(CClib)(string)taking the parameter evalcode as a modifier, this is the public address that corresponds to the pubkey
myCCaddress(string)taking the parameter evalcode as a modifier, this is the public address that corresponds to the pubkey
myCCbalance(number)the amount of coins in myCCaddress
mybalance(number)the amount of coins in myAddress

Command:

./komodo-cli -ac_name=MUSIG cclibaddress 18 0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "cclibaddress", "params": ["18", "0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

cclibinfo

The cclibinfo method displays all the methods of all the modules that are available in the current library.

The library is loaded at runtime using the -ac_cclib parameter.

NameTypeDescription
(none)

NameTypeDescription
result(string)whether the command executed successfully
CClib(string)the name of the given CClibrary
methods(array of json objects)an array containing json objects, each of which describe a method of a module
evalcode(decimal number)the EVALCODE of the given Antara Module
funcid(character)this value is a mnemonic in the OP_RETURN for all generated transactions; if the provided method does not generate a transaction, this value is a single character that has no relevant meaning
name(string)the name of the Antara module
method(string)the name of the method
help(string)help for the method, including a description of the method's arguments
params_required(decimal number)the number of parameters that are required for the method to succeed
params_max(decimal number)the maximum number of parameters the method can accept

Command:

./komodo-cli -ac_name=MUSIG cclibinfo

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "cclibinfo", "params": [ ] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/