CC Lib

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

cclib

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.

cclib formatting

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.

Array Formatting for Terminal

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]'

Array Formatting for Bash Scripts

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]\"

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

Arguments

Response

📌 Examples

Command:

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

<collapse-text hidden title="Response">

{
  "pkhash": "8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",
  "combined_pk": "03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",
  "result": "success"
}

</collapse-text>

<!-- Need to find the correct way to issue the command from jl

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": "cclib", "params": ["combine", "18", "0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a", "02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

</collapse-text>

-->

cclibaddress

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.

Arguments

Response

📌 Examples

Command:

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

<collapse-text hidden title="Response">

{
  "result": "success",
  "CClibCCAddress": "RKWS7jxyjPX9iaJttk8iMKf1AumanKypez",
  "CCbalance": 2.0977,
  "CClibNormalAddress": "RQHYfxb21ow4Xppt2H9x7k5XMhk7PMbKCc",
  "CClibCCTokensAddress": "RVjvG3or8b8asoYBJua9p97pf3RSpaEhRG",
  "myAddress": "RUfCUd3UryKJ49baQvSuAs42wakNunvvfT",
  "myCCAddress(CClib)": "RPYCYEtS7GAt1W9LvJWXHsndozaA8yy4H9",
  "PubkeyCCaddress(CClib)": "RPYCYEtS7GAt1W9LvJWXHsndozaA8yy4H9",
  "myCCaddress": "RPYCYEtS7GAt1W9LvJWXHsndozaA8yy4H9",
  "myCCbalance": 0.0,
  "myaddress": "RUfCUd3UryKJ49baQvSuAs42wakNunvvfT",
  "mybalance": 94.60081561
}

</collapse-text>

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/

<collapse-text hidden title="Response">

{
  "result": {
    "result": "success",
    "CClibCCAddress": "RKWS7jxyjPX9iaJttk8iMKf1AumanKypez",
    "CClibCCBalance": 0.0,
    "CClibNormalAddress": "RQHYfxb21ow4Xppt2H9x7k5XMhk7PMbKCc",
    "CClibNormalBalance": 0.0,
    "CClibCCTokensAddress": "RVjvG3or8b8asoYBJua9p97pf3RSpaEhRG",
    "PubkeyCCaddress(CClib)": "RPYCYEtS7GAt1W9LvJWXHsndozaA8yy4H9",
    "PubkeyCCbalance(CClib)": 0.0,
    "myCCAddress(CClib)": "RJ2bk7v8nUZhensBW5FB2kx1TQcnmEtGTp",
    "myCCbalance(CClib)": 0.0,
    "myaddress": "RN727JeeiZ6NXic7PUKTCiHT1HvuBN4RDa",
    "mybalance": 100005.1364497
  },
  "error": null,
  "id": "curltest"
}

</collapse-text>

cclibinfo

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.

Arguments

Response

📌 Examples

Command:

./komodo-cli -ac_name=MUSIG cclibinfo

<collapse-text hidden title="Response">

{
  "result": "success",
  "CClib": "sudoku",
  "methods": [
    {
      "evalcode": 16,
      "funcid": "F",
      "name": "faucet2",
      "method": "fund",
      "help": "amount",
      "params_required": 1,
      "params_max": 1
    },
    {
      "evalcode": 16,
      "funcid": "G",
      "name": "faucet2",
      "method": "get",
      "help": "<no args>",
      "params_required": 0,
      "params_max": 0
    },
    {
      "evalcode": 17,
      "funcid": "G",
      "name": "sudoku",
      "method": "gen",
      "help": "<no args>",
      "params_required": 0,
      "params_max": 0
    },
..... (omitted for brevity)
}

</collapse-text>

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/

<collapse-text hidden title="Response">

{
  "result": {
    "result": "success",
    "CClib": "sudoku",
    "methods": [
      {
        "evalcode": 16,
        "funcid": "F",
        "name": "faucet2",
        "method": "fund",
        "help": "amount",
        "params_required": 1,
        "params_max": 1
      },
      {
        "evalcode": 16,
        "funcid": "G",
        "name": "faucet2",
        "method": "get",
        "help": "<no args>",
        "params_required": 0,
        "params_max": 0
      },
      {
        "evalcode": 17,
        "funcid": "G",
        "name": "sudoku",
        "method": "gen",
        "help": "<no args>",
        "params_required": 0,
        "params_max": 0
      },
      ..... (omitted for brevity)

    ]
  },
  "error": null,
  "id": "curltest"
}

</collapse-text>

Last updated