Getting Started with Marmara Chain

The following guide has been prepared for use in terminal/command line for different operating systems. The sample outputs are provided for demonstration purposes.

Build Marmara from Source

Building from source code

One may build Marmara Credit Loops Smart Chain from source. This is not required, however building from source is considered as the best practice in a production environment, since this allows one to instantly update to the latest patches and upgrades.

System requirements

Linux:
For Ubuntu, we recommend using the 16.04 or 18.04 releases
64-bit Processor
Minimum 2 CPUs
Minimum 4GB of free RAM (8GB+ recommended)
MacOS:
OSX (version > 10.11)
Minimum 4GB of free RAM (8GB+ recommended)
Windows:
Linux machine or Virtual Machine-based installation of Ubuntu Linux

Install dependencies

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget curl bsdmainutils automake cmake clang ntp ntpdate nano -y

MacOS
Issue the following command in a terminal
xcode-select –install
Ensure brew is Installed
usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Execute each command separately
brew update
brew upgrade
brew tap discoteq/discoteq; brew install flock
brew install autoconf autogen automake
brew install gcc@8
brew install binutils
brew install protobuf
brew install coreutils
brew install wget

sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl libsodium-dev cmake mingw-w64
Install Rust
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup target add x86_64-pc-windows-gnu
Configure the compiler to use POSIX thread model
sudo update-alternatives --config x86_64-w64-mingw32-gcc
After having issued the above command, select the POSIX option as indicated below:

Selection    Path                                   Priority   Status
------------------------------------------------------------
  0            /usr/bin/x86_64-w64-mingw32-gcc-win32   60        auto mode
  1            /usr/bin/x86_64-w64-mingw32-gcc-posix   30        manual mode
* 2            /usr/bin/x86_64-w64-mingw32-gcc-win32   60        manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
Issue the following command:
sudo update-alternatives --config x86_64-w64-mingw32-g++
Having executing the above command, select the POSIX option as below:
There are 2 choices for the alternative x86_64-w64-mingw32-g++ (providing /usr/bin/x86_64-w64-mingw32-g++).
Selection    Path                                   Priority   Status
------------------------------------------------------------
  0            /usr/bin/x86_64-w64-mingw32-g++-win32   60        auto mode
  1            /usr/bin/x86_64-w64-mingw32-g++-posix   30        manual mode
* 2            /usr/bin/x86_64-w64-mingw32-g++-win32   60        manual mode
Press <enter> to keep the current choice[*], or type selection number: 1.

Clone the Marmara Repository

cd ~
git clone https://github.com/marmarachain/marmara komodo --branch master --single-branch

Changing swap size to 4GB (optional)

Swap is a space on a disk which is used when the amount of physical RAM memory is full. If the system has 4 GB of RAM, to avoid cases of running out of RAM, swap space needs to be configured.

Check if OS already has swap enabled using sudo swapon --show. If swapfile exists and is not configured as at least 4 GB then turn off the swap before configuring it by sudo swapoff /swapfile

Execute the following commands to allocate 4 GB of RAM for the swap space.
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Fetch the Zcash Parameters & Build 
cd komodo

./zcutil/fetch-params.sh

Linux (Ubuntu 18.04 & 20.04)

./zcutil/build.sh -j$(nproc)

MacOS

./zcutil/build-mac.sh -j$(nproc)

Windows

./zcutil/build-win.sh -j$(nproc)

Once this step is completed, you will find komodod & komodo-cli files inside the src directory.
In Windows Build you will find komodod.exe & komodo-cli.exe files inside the src directory.

cd src

Install Precompiled Binaries

Downloading Assets from Releases

One can download and unzip our pre-compiled binaries. This is the simplest method and hence requires no compiling procedure. Each operating system need to install zcash params.

After downloading MCL-linux.zip from releases page needs to be unzipped and install dependencies and to run fetch-params.

Install the dependency packages

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install libgomp1

Make sure to follow the following instructions on the downloaded directory or any other directory where you moved or copied

sudo apt install unzip
unzip MCL-linux.zip
sudo chmod +x komodod komodo-cli fetch-params.sh
./fetch-params.sh

After downloading MCL-mac.zip from releases page needs to be unzipped and install dependencies and to run fetch-params.
Issue the following command in a terminal
xcode-select –install

Ensure brew is Installed

usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew install/master/install)"
Change directory to the location of komodod & komodo-cli on the terminal.

./fetch-params.sh

After downloading MCL-win.zip from releases page to your windows computer and extract&place the files (komodod.exe & komodo-cli.exe) in a new folder on the Desktop called MCL or any other location you prefer.

run fetch.params.bat

Start Marmara with parameters

Start and run Marmara Chain with parameters

komodod is used with MCL parameters to connect to Marmara chain. komodo-cli is used for RPC calls.

Run the following commands in Terminal where the komodod and komodo-cli files are located.

 To Start Marmara Chain:

./komodod -ac_name=MCL -ac_supply=2000000 -ac_cc=2 -addnode=37.148.210.158 -addnode=37.148.212.36 -addnode=149.202.158.145 -addressindex=1 -spentindex=1 -ac_marmara=1 -ac_staked=75 -ac_reward=3000000000 &

To Stop Chain:

./komodo-cli -ac_name=MCL stop

To Start Marmara Chain:

komodod.exe -ac_name=MCL -ac_supply=2000000 -ac_cc=2 -addnode=37.148.210.158 -addnode=37.148.212.36 -addnode=149.202.158.145 -addressindex=1 -spentindex=1 -ac_marmara=1 -ac_staked=75 -ac_reward=3000000000 &

To Stop Chain:

komodo-cli.exe -ac_name=MCL stop

Launching MCL with pubkey*

Relaunch your daemon using the required parameters, and make sure to include your pubkey as an additional parameter. For example:

Linux & MacOS

./komodod -ac_name=MCL -ac_supply=2000000 -ac_cc=2 -addnode=37.148.210.158 -addnode=37.148.212.36 -addnode=149.202.158.145 -addressindex=1 -spentindex=1 -ac_marmara=1 -ac_staked=75 -ac_reward=3000000000 -gen -genproclimit=1 -pubkey=DO_NOT_USE_THIS_ADDRESS019n79b0921a1be6d3ca6f9e8a050mar17eb845fe46b9d756 &

Windows
komodod.exe -ac_name=MCL -ac_supply=2000000 -ac_cc=2 -addnode=37.148.210.158 -addnode=37.148.212.36 -addnode=149.202.158.145 -addressindex=1 -spentindex=1 -ac_marmara=1 -ac_staked=75 -ac_reward=3000000000 -gen -genproclimit=1 -pubkey=DO_NOT_USE_THIS_ADDRESS019n79b0921a1be6d3ca6f9e8a050mar17eb845fe46b9d756 &

For in depth details on the meaning of parameters, please refer to here.

(*) It is important to use pubkey that belongs to your wallet.dat inside your current blockchain setup. If you have not created a wallet address or did not obtain a pubkey, please refer to Wallet & privkey section.

Wallet & privkey

Creating an address and getting pubkey

To use Marmara Credit Loops, a user must have a pubkey and launch the chain with a pubkey. Otherwise, any mining or staking in the smart chain would be in vain. Since all mined or staked coins will also be sent to this address.

In order to get a pubkey, start the Marmara Chain with the normal launch parameters and execute the getnewaddress and validatenewaddress API commands.

Then the dumpprivkey method has to be used to get the respective privkey. The Privkey received in this way consists of a hard to remember combination of letters and number. Note that keeping this privkey safe and secure and reachable only by you is very important and essential way to reach your assets.

Hence, one can generate a privkey from his/her own set of words and keep a record of these words to generate the respective privkey whenerever needed. For this, use convertpassphrase API command as instructed below.

Privkey and backup wallet

To get the respective privkey for a pubkey, one has to use dumpprivkey method. This method is used in case that the user used getnewaddress and validatenewaddress API commands to get a pubkey. 

If the user wants to import his owned private key to the wallet, he/she may issue the importprivkey method to add the respective private key to the wallet address.

Having a backup of the wallet.dat is very crucial for one since it holds the financial assets. Hence, it is highly recommended to take a backup and hold it securely in a safe location.

Wallet Info & pubkey

One may start the Marmara chain without pubkey and then use the setpubkey command to set the indicated pubkey for the chain. This method can be used in place of the pubkey launch parameter, when necessary. setpubkey method works only once per daemon start. It can't be used to change the pubkey that has already been set.

marmarainfo command returns important details about one's wallet such as the normal amount in the pubkey, the activated amount, the details of credit loops made, the total amount locked in credit loops, the number of credit loops closed and the details of credit loops closed.

getnewaddress

The getnewaddress method returns a new address for receiving payments.

./komodo-cli -ac_name=MCL getnewaddress

komodo-cli.exe -ac_name=MCL getnewaddress

DO_NOT_USE_THIS_ADDRESSgg5jonaes1J5L786

validateaddress

The validateaddress method returns information about the given address.

./komodo-cli -ac_name=MCL validateaddress RMC5GBzX2jw1yEyRgoYsTPeerSBL9Lu5SS

komodo-cli.exe -ac_name=MCL validateaddress RMC5GBzX2jw1yEyRgoYsTPeerSBL9Lu5SS

Sample result

{
  "isvalid": true,
  "address": "RMC5GBzX2jw1yEyRgoYsTPeerSBL9Lu5SS",
  "scriptPubKey": "76a91482a9bd6b506854c2cf2fa5f5bc43d17527865c1188ac",
  "segid": 52,
  "ismine": true,
  "iswatchonly": false,
  "isscript": false,
  "pubkey": "028b319b15476166241ca6d2f7ebdc877fcba0dbc961f6529d4e2e4d533e6effa5",
  "iscompressed": true,
  "account": ""
}

convertpassphrase

This command is used to create a privkey from one's own seeds. Make sure that the 12 set of keywords have no special characters in them. For instance using seeds: "can create your own keywords and generate privkey from these whenever needed".

./komodo-cli -ac_name=MCL convertpassphrase "can create your own keywords and generate privkey from these whenever needed"

komodo-cli.exe -ac_name=MCL convertpassphrase "can create your own keywords and generate privkey from these whenever needed"

Sample result

{
  "agamapassphrase": "can create your own keywords and generate privkey from these whenever needed",
  "address": "RCna416S62uNVAKMwRuFtmRH2X3xJuTidD",
  "pubkey": "03a3c416d3bafe44448dcb3a56e5dd13db5cc3e6992051a61a2f5675b4796c0d7a",
  "privkey": "9005f5b2593ab3e662e1330ceca848d62fb2021165c6484ac7037cb4efc5317e",
  "wif": "UtqWJyhXjJWYigKyKCm5ML96LvSZFDfZrT2HYXAdGs8byZ3uCMzy"
}

importprivkey

The importprivkey method adds a private key to one's wallet. The command may take several arguments as described in here. The simplest form of command for this is given below for demo purposes.

./komodo-cli -ac_name=MCL importprivkey "DONOTUSETHISxxxxxxxxxxxxxxxxx7KkCmRnnSg7iXvRUqhYoxC9Y"

komodo-cli.exe -ac_name=MCL importprivkey "DONOTUSETHISxxxxxxxxxxxxxxxxx7KkCmRnnSg7iXvRUqhYoxC9Y"

R9z796AehK5b6NCPeVkGUHSpJnawerf8oP

dumpprivkey

The dumpprivkey method reveals the private key corresponding to the indicated address. The command for this is given below for demo purposes.

Linux & MacOS

./komodo-cli -ac_name=MCL dumpprivkey "PWqwYaWNEVT7V9SdfFHARWnoB7vcpSfdvs"

Windows

komodo-cli.exe -ac_name=MCL dumpprivkey "PWqwYaWNEVT7V9SdfFHARWnoB7vcpSfdvs"

Sample result

DONOTUSETHISxxxxxxxxxxxxxxxxx7KkCmRnnSg7iXvRUqhYoxC9Y

Backup wallet.dat

Backing up the wallet.dat file is very essential as it holds the assets of one. One method to backup this file is to archive a copy of the file.

Linux

On a Linux machine, the file could be found in: ~/.komodo/MCL/wallet.dat

#Copy the wallet.dat file
cp -av ~/.komodo/MCL/wallet.dat ~/wallet.dat

#Rename the wallet.dat file
mv ~/wallet.dat ~/2020-08-09-wallet_backup.dat

# Make an archieve of the wallet.dat file
tar -czvf ~/2020-08-09-wallet_backup.dat.tgz ~/2020-08-09-wallet_backup.dat

# Move the final file to a secure location

MacOS

On MacOS, the wallet.dat file is located here: ~/Library/Application\ Support/Komodo/MCL/wallet.dat

# Copy the file
cp -av ~/Library/Application\ Support/Komodo/MCL/wallet.dat ~/wallet.dat

# Rename file
mv ~/wallet.dat ~/2019-05-17-wallet_backup.dat

# To make archive
tar -czvf ~/2019-05-17-wallet_backup.dat.tgz ~/2019-05-17-wallet_backup.dat

# Move the final file to a secure location

Windows

On Windows machine, the file is located at: %HOMEPATH%\AppData\Roaming\Komodo\MCL\wallet.dat

setpubkey

It is very important to intiate the Marmara node by setting the pubkey. The chain can be launched with the parameters extended with the pubkey or the setpubkey command could be used after starting the marmara chain to by indicating the pubkey.

Linux & MacOS

./komodo-cli -ac_name=MCL setpubkey pubkey

Windows

komodo-cli.exe -ac_name=MCL setpubkey pubkey

getinfo

getinfo command returns important details such as

  • the version of MARMARA through "version";

  • synchronization status of your node through synced (this parameter's value is true if the parameters "blocks" and "longestchain" are equal );

  • difficulty of the chain through "difficulty";

  • number of nearest connected nodes to the chain through "connections";

  • the pubkey with which you are connected to the chain through "pubkey":

Linux & MacOS

./komodo-cli -ac_name=MCL getinfo

Windows

komodo-cli.exe -ac_name=MCL getinfo

Sample result

{
  "version": 3000300,
  "protocolversion": 170009,
  "KMDversion": "0.5.3",
  "synced": true,
  "notarized": 616208,
  "prevMoMheight": 616208,
  "notarizedhash": "0ba0864989083e050df8409b0d91bc4d910ba05aee691e68b172d1da62518bad",
  "notarizedtxid": "786cbda956bfb058c5aa6fdfceafafbbf1e21d62efda8ce48dfd17ef8c2e1681",
  "notarizedtxid_height": "mempool",
  "KMDnotarized_height": 0,
  "notarized_confirms": 0,
  "walletversion": 60000,
  "balance": 0.00000000,
  "blocks": 616226,
  "longestchain": 616226,
  "tiptime": 1616766087,
  "difficulty": 583612.9172907906,
  "keypoololdest": 1606903639,
  "keypoolsize": 101,
  "paytxfee": 0.00000000,
  "sapling": 61,
  "timeoffset": 0,
  "connections": 16,
  "proxy": "",
  "testnet": false,
  "relayfee": 0.00000100,
  "errors": "",
  "pubkey": "028b319b15476166241ca6d2f7ebdc877fcba0dbc961f6529d4e2e4d533e6effa5",
  "CCid": 2,
  "name": "MCL",
  "p2pport": 33824,
  "rpcport": 33825,
  "magic": -1687041972,
  "premine": 2000000,
  "reward": "3000000000",
  "halving": "0",
  "decay": "0",
  "endsubsidy": "0",
  "notarypay": "0",
  "staked": 75
}

marmarainfo

marmarainfo command returns important details such as

  • the normal amount in the pubkey through "myPubkeyNormalAmount";

  • the activated amount through "myActivatedAmount";

  • the details of credit loops made through "Loops";

  • the total amount locked in credit loops through "TotalLockedInLoop";

  • the number of credit loops closed through "numclosed"; and

  • the details of credit loops closed through "closed".

./komodo-cli -ac_name=MCL marmarainfo 0 0 0 0 pubkey

komodo-cli.exe -ac_name=MCL marmarainfo 0 0 0 0 pubkey

{
  "result": "success",
  "myNormalAddress": "RMC5GBzX2jw1yEyRgoYsTPeerSBL9Lu5SS",
  "myPubkeyNormalAmount": 0.00000000,
  "myWalletNormalAmount": 0.00000000,
  "myCCActivatedAddress": "RBHXWwAAGcZzfA5JmYCnDmeGziMbpSDmjp",
  "myActivatedAmount": 0.00000000,
  "myTotalAmountOnActivatedAddress": 0.00000000,
  "myCCAddress": "RJy9KU8XKSWoZ3hUzPNyQdkox2P3g4wF8Z",
  "myCCBalance": 0.00000000,
  "Loops": [
  ],
  "TotalLockedInLoop": 0.00000000,
  "issuer": "028b319b15476166241ca6d2f7ebdc877fcba0dbc961f6529d4e2e4d533e6effa5",
  "firstheight": 0,
  "lastheight": 2147483647,
  "minamount": 0.00000000,
  "maxamount": 92233720368.54775807,
  "currency": "MARMARA",
  "n": 0,
  "numpending": 0,
  "issuances": [
  ],
  "totalamount": 0.00000000,
  "numclosed": 0,
  "closed": [
  ],
  "totalclosed": 0.00000000
}

Useful RPC Commands

komodod & komodo-cli

The komodod software application is the Smart Chain daemon that powers all Komodo blockchains.
The komodo-cli software application allows a developer to execute API calls to komodod via the command line.

RPC Commands

Marmara smart chain is 25% mineable and 75% stakeable where staking could only be done when users lock their coins in one of the two funds, namely; "Activated" and "Locked in Credit Loop" (LCL) funds.

marmaralock is used to activate the coins. Active coins are needed for staking and if there are none then even if the staking mode is on, no blocks would be found through staking.

The mode of the node may be checked using getgenerate command. Additionally, the setgenerate command is useful for setting the node to staking or mining mode.

marmaraunlock is used for converting the activated amount to normal account. Normal Amount is utilized for sending payments directly to an address through sendtoaddress command. The payment is made based on the Normal Amount available on the respective wallet with a small transaction fee deducted from normal coins.

getinfo command returns important details about the node such as the version of MARMARA, the synchronization status of one's node, difficulty of the chain, the number of nearest connected nodes to the chain, the pubkey with which one's node is connected to the chain.

For checking the node's near one's node, getpeerinfo command may be used.

The listaddressgroupings method lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions.

getaddressesbyaccount method returns the list of addresses for the given account.

One can check out the methods for Marmara Chain in more detail by issuing help in the terminal/command line with the blockchain name provided as in here.

marmaralock

marmaralock is used to activate the coins. The entire command is given below and the amount is to be replaced by the amount of coins such as 1000.

To see the activated coins, use marmarainfo command provided earlier and search for the value across the "myActivatedAmount" parameter.

In order to confirm marmaralock transaction, copy the hex returned through the JSON object and validate it through the sendrawtransaction command.

Linux & MacOS

./komodo-cli -ac_name=MCL marmaralock amount

Windows
komodo-cli.exe -ac_name=MCL marmaralock amount
Sample Result
{
"result": "success",
"hex":"0400008085202f89020039b219200ae4b5c83d77bffce7a8af054d6fb..........e9181f6aac3e1beb1e260e9a1f49ed24e6ac00000000edeb04000000000000000000000000"
}

marmaraunlock

marmaraunlock is used deactivate the coins i.e. turn them into normal amount.

The amount parameter in the command is to be replaced by the amount of coins to be deactivated such as 500.

In order to confirm marmaraunlock transaction, copy the hex returned through the JSON object and validate it through the sendrawtransaction command.

Linux & MacOS

./komodo-cli -ac_name=MCL marmaraunlock amount

Windows
komodo-cli.exe -ac_name=MCL marmaraunlock amount

sendrawtransaction

sendrawtransction method submits raw transaction (serialized, hex-encoded) to local nodes and the network.

This method has to be executed after the following commands issued:

  • marmaralock

  • marmaraunlock

  • marmarareceive

  • marmaraissue

If the above command gets successfully executed in the blockchain, it gives out a transaction id in response. One may check if this transaction is verified by searching the respective id in the Marmara Explorer.

Note that the raw transactions are collected in the mempool and a few blocks may be needed to found to see the transaction recorded on the block.

Linux & MacOS

./komodo-cli -ac_name=MCL sendrawtransaction hex

Windows
komodo-cli.exe -ac_name=MCL sendrawtransaction hex

setgenerate 

This method is used to set the node to mining or staking mode. The commands presented below changes the node to staking mode.

Note that "staking": true will not be of use if you have no activated coins (if you have not locked the coins)!

The mode of the node is checked using getgenerate method.

Linux & MacOS

./komodo-cli -ac_name=MCL setgenerate true 0

komodo-cli.exe -ac_name=MCL setgenerate true 0

getgenerate

getgenerate command is used to check the mode of the node.

  • "staking": false means that staking is off.

  • "generate": true means that mining is active.

  • "numthreads": 1 refers to the number of cores used for mining. In this case, this parameter was set to one earlier.

./komodo-cli -ac_name=MCL getgenerate

komodo-cli.exe -ac_name=MCL getgenerate
Sample Result

{
  "staking": false,
  "generate": true,
  "numthreads": 1
}

sendtoaddress

sendtoaddress command is used to send a payment to a given address. The amount is rounded to the nearest 0.00000001. A transaction fee is deducted for the transaction being made from one's Normal Amount.

This command directly sends payment to the specified address and should be used carefully. As, the payment sent through this method cannot be redeemed later.

Linux & MacOS

./komodo-cli -ac_name=MCL sendtoaddress "MCL_address" amount

Windows

komodo-cli.exe -ac_name=MCL sendtoaddress "MCL_address" amount

Sample Result

Website may use cookies to personalize and facilitate maximum navigation of the User by this site. The User may configure his / her browser to notify and reject the installation of the cookies sent by us.

getpeerinfo   

getpeerinfo command returns detailed information on nearest connected nodes to the chain around your node.

./komodo-cli -ac_name=MCL getpeerinfo

komodo-cli.exe -ac_name=MCL getpeerinfo
Sample Result
[
  {
    "id": 1,
    "addr": "37.148.210.158:33824",
    "addrlocal": "46.106.36.203:17932",
    "services": "0000000070000005",
    "lastsend": 1617004153,
    "lastrecv": 1617004153,
    "bytessent": 122607,
    "bytesrecv": 8224441,
    "conntime": 1617003195,
    "timeoffset": -2,
    "pingtime": 10.546878,
    "version": 170009,
    "subver": "/MagicBean:3.0.3beta1(bitcore)/",
    "inbound": false,
    "startingheight": 620149,
    "banscore": 0,
    "synced_headers": 620164,
    "synced_blocks": 620164,
    "inflight": [
    ],
    "whitelisted": false
  },

{ ....

}

]

marmaraamountstat

marmaraamountstat command is used to get all the activated, normal and locked in loop amount of the Marmara blockchain irrespective of the owner. If the begin_height and end_height inputs are set to zero(0), it gets the entire set of data from blocks.

./komodo-cli -ac_name=MCL marmaraamountstat begin_height end_height

Windows
komodo-cli.exe -ac_name=MCL marmaraamountstat begin_height end_height
Sample Result

{
  "result": "success",
  "BeginHeight": 50000,
  "EndHeight": 60000,
  "TotalNormals": 166854.85464948,
  "TotalPayToScriptHash": 0.00000000,
  "TotalActivated": 582681.11953150,
  "TotalLockedInLoops": 237510.00000000,
  "TotalUnknownCC": 0.02820000,
  "SpentNormals": 161377.88109325,
  "SpentPayToScriptHash": 0.00000000,
  "SpentActivated": 382128.12128773,
  "SpentLockedInLoops": 143510.00000000,
  "SpentUnknownCC": 0.00000000
}

listaddressgroupings  

listaddressgroupings is used to list the pairs of wallet addresses and respective normal amounts in them.

./komodo-cli -ac_name=MCL listaddressgroupings

komodo-cli.exe -ac_name=MCL listaddressgroupings

Website may use cookies to personalize and facilitate maximum navigation of the User by this site. The User may configure his / her browser to notify and reject the installation of the cookies sent by us.

getaddressesbyaccount  

getaddressesbyaccount is used to return the list of addresses for the given account.

./komodo-cli -ac_name=MCL getaddressesbyaccount ""

komodo-cli.exe -ac_name=MCL getaddressesbyaccount ""

[
  "RMC5GBzX2jw1yEyRgoYsTPeerSBL9Lu5SS"
]

Credit loops Commands

Marmara version 1

The current Marmara Credit loops currently work based on Protocol 1 which is in 100% collateralization mode. 100 % collateralization is made by issuer on behalf of both himself/herself and holder. Both issuer and holder have the 3x staking chance to get blockchain rewards. Issuer has the 3x staking chance until maturity date of credit whereas holder has the 3x staking chance until he/she endorses/transfers the credit to a new holder who will continue staking with the issuer. The Credit loops can be made using only activated coins

Terminology

Issuer: The person who first creates a credit in a credit loop. It is the person who forms the first node in the credit loop. The credit may be collateralized 100% or with even zero-collateralization until maturity date of a credit.

Bearer (Holder): The last node in a credit loop is always called bearer (holder). When someone transfers a credit in a loop, that node becomes immediately an endorser.

Endorser: All other nodes that fall between the issuer, which is the first node in the credit loop, and the last node, and transfer the credit to the next node.

Maturity: The time a credit expires. It is measured as blocks in estimation. The block per day is 1440 (60 blocks an hour times 24 hours a day). Suppose a credit is for 100 days, the maturity is 1440x100, i.e. 144,000 blocks.

Settlement: When a credit matures, settlement is made to the holder, the last node in a loop. Settlement may be automatic or manual.

Escrow: Trust based parties for Protocol 2. If EscrowOn is false, then 100% collateralization is used and settlement is automatic. There is no need for escrows in protocol 1 which works as complete trustless version.

Avalist: Avalists support issuer or endorsers with MCL as additional colletarization and can earn with 3x staking with those support. In case of non-redemption, their funds are utilized. Avalists are available only in Protocol 2. The parameter avalcount is always zero for protocol 1.

BlockageAmount: This is a term for protocol 2. An issuer may be asked to put some collateralization by a holder. In that case, the issuer gets benefit of 3x staking in protocol 2.

Dispute Expiry: It is grace period for solving non-redemption problem in credit loops in protocol 2. An issuer may have this time as blocks when creating a credit under protocol 2 without or insufficient collateralization. Before this period expires, an escrow should do all actions according to aggrement with the issuer to solve non-redemption. Otherwise, the escrow is penalized in the system.

Important Commands for Making Credit Loops

marmarareceive is used to get a credit from an issuer or an endorser. It has two uses which are when asking a credit from an issuer, i.e. the first node or when transfering the credit to a new bearer by the endorser.

marmaraissue is only used by the issuer, the first node to create/issue a credit. By this, a credit is also transferred to the first holder, i.e. the second node.

marmarareceivelist method could be used to see the receive requests made to the issuer himself/herself by using it with the pubkey parameter.

marmaracreditloop method could be used to display the credit loop between the issuer and the holder.

marmaraholderloops method returns the bearer's (holder) open and closed loops.

marmaratransfer method is used for transferring the credit loop to a new holder which in this case becomes the endorser.

sendrawtransaction method is used for verifying the transactions made by methods such as marmarareceive, marmaraissue and marmaratransfer.

Creating a Credit Loop

This is the case where two nodes are making a credit loop for the first time. This credit loop may be created for a sale of a good or service in the market. In such case, the holder (the one selling the product/service) should request for a credit from the issuer (the one paying the product/service) by writing down the marmarareceive command as indicated:

  • senderpk is the pubkey address of the issuer (the one paying the product/service)

  • amount is the payment amount. Please note that this amount should be available in activated fund of the issuer and if not then must be activated thru marmaralock command by th issuer.

  • currency is MARMARA

  • matures is the time that respective credit expires, 60 blocks an hour times 24 hours a day making 1440 blocks per day.

  • {"avalcount":"n"} is the number of avalists i.e. '{"avalcount":"0"}' for protocol 1. Replace n with 0 for Protocol 1.

Linux & MacOS

./komodo-cli -ac_name=MCL marmarareceive senderpk amount currency matures '{"avalcount":"n"}'

Windows
komodo-cli.exe -ac_name=MCL marmarareceive senderpk amount currency matures {\"avalcount\":\"n\"}

This marmarareceive call generates a hex code. This HEXCODE needs to be verified by the holder by executing the sendrawtransaction command:

Linux & MacOS

./komodo-cli -ac_name=MCL sendrawtransaction HEXCODE

Windows
komodo-cli.exe -ac_name=MCL sendrawtransaction HEXCODE

Once this command is executed, a transaction id named txid gets generated. This txid along with the receiverpk needs to be communicated to the issuer to complete the credit loop. But, an alternative to this communication would be the use of marmarareceivelist method which could be used to see the receive requests made to the issuer himself/herself

marmarareceivelist

marmarareceivelist command is issued with a pubkey and a maxage parameter. This pubkey is the pubkey address of the issuer connected to the Marmara Chain and the max age by default is 24*60. The response of this command is a list of pair of txid's created by the respective pubkeys.

marmarareceivelist method would be executed by the issuer by using the following command. Replace the pubkey and maxage parameters with related inputs:

This marmarareceive call generates a hex code. This HEXCODE needs to be verified by the holder by executing the sendrawtransaction command.

Linux & MacOS

./komodo-cli -ac_name=MCL marmarareceivelist pubkey maxage

Windows
komodo-cli.exe -ac_name=MCL marmarareceivelist pubkey maxage
Sample Result
{
    "version": 2,
    "txid": "5247d7d7e26eaaff51c67b0f9674........503e52c4e0d3440a.....",
    "creationtxid": "0000000000000000000000000000000000000000000000000000000000000000",
    "funcid": "B",
    "amount": 1.00000000,
    "matures": 1194769,
    "receivepk": "......dcfd40df475c22c210........b49e9a065be6848390da458c",
    "issuerpk": "0.....313a41befdfa50cbdd68b0d33b267e367cf8f5286826c069......"
  }

marmaraissue

marmaraissue command is only used by issuer, the first node to create/issue a credit. By this, a credit is also transferred to the first holder, i.e. the second node. Many of the parameters for a credit loop is decided between the issuer and the first holder. marmaraissue method takes in the following arguments:

  • receiverpk is the pubkey of the receiver which is the holder.

  • "avalcount":"n" is the number of avalists i.e. '{"avalcount":"0"}' for protocol 1.

  • "autosettlement":"true"|"false" AutoSettlement is true due to 100% collateralization in Protocol 1.

  • "autoinsurance":"true"|"false" Autoinsurance is true due to 100% collateralization in Protocol 1.

  • "disputeexpires":"offset" Dispute expiry is set to 0 due to 100 collateralization in Protocol 1.

  • "EscrowOn":"true"|"false" EscrowOn is set to false due to 100% collateralization in Protocol 1.

  • "BlockageAmount":"amount blockage amount is set to 0 due to 100 collateralization in Protocol 1.

  • requesttxid is the txid generated by the holder communicated to the issuer.

Linux & MacOS

./komodo-cli -ac_name=MCL marmaraissue receiverpk '{"avalcount":"n", "autosettlement":"true"|"false", "autoinsurance":"true"|"false", "disputeexpires":"offset", "EscrowOn":"true"|"false", "BlockageAmount":"amount" }' requesttxid

Typical Example of the command:

./komodo-cli -ac_name=MCL marmaraissue receiverpk '{"avalcount":"0", "autosettlement":"true", "autoinsurance":"true", "disputeexpires":"0", "EscrowOn":"false", "BlockageAmount":"0" }' requesttxid

Windows

komodo-cli.exe -ac_name=MCL marmaraissue receiverpk "{\"avalcount\":\"n\", \"autosettlement\":\"true"|"false\", \"autoinsurance\":\"true"|"false\", \"disputeexpires\":\"offset\", \"EscrowOn\":\"true"|"false\", \"BlockageAmount\":\"amount\"}" requesttxid

Typical Example of the command:

komodo-cli.exe -ac_name=MCL marmaraissue receiverpk "{\"avalcount\":\"0\" \"autosettlement\":\"true\" \"autoinsurance\":\"true\" \"disputeexpires\":\"offset\" \"EscrowOn\":\"false\" \"BlockageAmount\":\"0\"}" requesttxid

This marmaraissue command in turn returns a hex code response, and now the issuer has to execute the sendrawtransaction method to get the transaction executed on the blockchain.

This creates a credit loop between the issuer and the holder. The credits locked in a loop can be circulated to buy things during shopping. The issuer and the holder get 3 times of chances of staking on the MCL funds until the maturity of the credit loop.

marmaracreditloop

To display the credit loop between the issuer and the holder, the marmaracreditloop command may be executed:

txid is the baton transfer id of the Marmara Credit Loop.

Linux & MacOS

./komodo-cli -ac_name=MCL marmaracreditloop txid

Windows
komodo-cli.exe -ac_name=MCL marmaracreditloop txid

marmaraholderloops

This command returns the bearer's open and closed loops which can be constrainted by setting the first and last height and the minimum and maximum amount. The method returns all the available data if all the parameters are set to zero.

Linux & MacOS

./komodo-cli -ac_name=MCL marmaraholderloops firstheight lastheight minamount maxamount pubkey

Windows
komodo-cli.exe -ac_name=MCL marmaraholderloops firstheight lastheight minamount maxamount pubkey

Transfering a Credit Loop

This is the case where a holder wishes to utilize the coins locked in loop by buying goods/services on the same credit loop created earlier. For such case, when the holder transfers a credit in a loop, that node immediately becomes an endorser. And in such way, the last node in a credit loop is always called the bearer (holder).

In other words, all endorsers are previously holders. One should bear in mind that endorsers lose the 3x staking power when a credit is transferred to a new holder.

The new holder makes a marmarareceive request to the endorser to get the credit for selling the goods/services by the marmarareceive command.

  • senderpk is the pubkey address of the endorser (the one buying the product/service)

  • batontxid is the baton transaction id of the previously created credit loop

  • {"avalcount":"n"} is the number of avalists i.e. {"avalcount":"0"} for protocol 1.

Linux & MacOS

./komodo-cli -ac_name=MCL marmarareceive senderpk batontxid '{"avalcount":"n"}'

komodo-cli.exe -ac_name=MCL marmarareceive senderpk batontxid {\"avalcount\":\"n\"}

This marmarareceive call generates a hex code. This HEXCODE needs to be verified by the new holder by executing the sendrawtransaction command.

Once this sendrawtransaction command is executed, a transaction id named txid gets generated.

This txid along with the receiverpk needs to be communicated to the endorser to complete the credit loop.

But, an alternative to this communication would be the use of marmarareceivelist method which could be used by the endorser to see the receive requests made to himself/herself.

Then, the endorser executes the following marmaratransfer command to get the credits transferred to the new holder:

  • receiverpk is the pubkey of the receiver which is the new holder.

  • "avalcount":"n" is the number of avalists i.e. '{"avalcount":"0"}' for protocol 1 (n=0).

  • requesttxid is the txid generated by the new holder communicated to the endorser.

./komodo-cli -ac_name=MCL marmaratransfer receiverpk '{"avalcount":"n"}' requesttxid

Windows
komodo-cli.exe -ac_name=MCL marmaratransfer receiverpk {\"avalcount\":\"n\"} requesttxid

Then, the endorser executes the sendrawtransaction command with the hex code resulting from marmaratransfer command.

In this way, the credit loops can circulate up to 1000th node within the maturity time to buy goods/services.