Command line mode

I am currently working on a command line mode so that you can run the client without any graphical user interface. It is planned that you handover the required parameters at execution depending on what you want to do. Further updates will be posted here!

It is very important to have command line mode for automated payment solutions. Simply imagine a virtual or physical cash register that runs the client ins command line mode! You create your transaction and go shopping. At the cash register you handover the transaction and the program running in command line mode will process the payment. That’s why we need this! If we can offer this to the people the overall acceptance will be much higher!

Just finished work on the command line mode. From now on you can run the program in CMD mode (command line mode) or GUI mode.

How to execute the program in GUI mode:
./ucs_client.sh

How to execute the program in CMD mode:
./ucs_client.sh [OPTION]

OPTIONS (for CMD-MODE ONLY!!!):

 -action <ACTION>		possible actions:

						create_user	to create a user
						create_trx	to create a transaction
						read_trx	to read a transaction
						create_sync	to create a syncronisation
						read_sync	to read a syncronisation
						sync_uca	to sync with UCAs
						create_backup	to create a backup
						restore_backup	to restore a backup
						show_stats	to display the statistics

  -user <USER>			name of the account.	

  -pin <PIN>			PIN of the account

  -password <PW>		password of the account

  -sender <ADRESS>		sender of a transaction. can be used to handover 
						a adress only instead of user and pin seperately. 
						If you use this parameter, skip -user and -pin 

  -receiver <ADRESS>	receiver of transaction. used only for action
						create_trx

  -amount <AMOUNT>		amount of transaction. used only for action
						create_trx

  -asset <ASSET>		asset to be used. if no asset type is defined
						the value $main_asset of control/config.conf is
						used as default asset

  -purpose "<TEXT>"		purpose of the transaction. used only for action
						create_trx

  -type <TYPE>			possible values are "partial" or "full".
						when creating a transaction this value is used to 
						specifiy wheter a big or small transaction should 
						be created. 

						when reading a transaction or reading 
						a sync file this parameter is used to specify 
						wheter only new files should be extracted or 
						all files should be extracted.

  -path <PATH>			path where output file is stored. 
						path from where to read input file.

  -no_ledger			don't build a ledger at start and only perform basic 
						integrity checks. should only be performed after a
						certain action to ensure information are up-to-date.
						when option is applied the usage of auto_uca_start 
						setting in control/config.conf is disabled.
		
						Option will be ignored for action create_trx.

  -help					Display this HELP

NOTE: If you run the script in CMD mode script will exit with returncode 0 if everything was successfull. If not returncode will be greater than 0. In both cases the script will display important info. For example you will get your balance displayed before and after you have created a transaction or read in a file (sync file or transaction file). If the script fails and exits with returncode greater 0 the output might not be complete.

HOW TO CREATE A USER

EXAMPLE COMMAND:
./ucs_client.sh -action create_user -user TESTUSER -password TESTPASSWORD

OUTPUT:
USER:<ACCOUNTNAME>
PIN:<PIN>
PASSWORD:>PW< # NOTE: PW PUT IN ><
ADRESS:<ADRESS>
KEY:<KEYFILE>
KEY_PUB_HOME:ACCOUNTNAME_PIN_STAMP_pub.asc
KEY_PRV_HOME:ACCOUNTNAME_PIN_STAMP_priv.asc

NOTE: Currently the exported private is always stored in script control/keys/- folder while the public key is always stored in /keys-folder. So if youhandover a path where these keys should be stored, it will NOT be used! These exported keys are your public and private backup keys - you better keep them under your pillow! With these keys you will be able to restore your account if everything is lost.

HOW TO CREATE A SMALL TRANSACTION (only pack new
files, if possible)

EXAMPLE COMMAND:
./ucs_client.sh -action create_trx -user TESTUSER -pin 12345 -password TESTPASSWORD -receiver ADRESS -amount 1.000000000 -asset ASSET -purpose “PURPOSE TEXT“ -type partial -path /path/to/outputdir

NOTE: Type “partial” means the program will check whether sender and receiver have common transaction knowledge and if so it will only add data to the transaction file that are new to the sender. This can reduce the size of a transaction file.

HOW TO CREATE A BIG TRANSACTION (pack all files)

EXAMPLE COMMAND:
./ucs_client.sh -action create_trx -user TESTUSER -pin 12345 -password TESTPASSWORD -receiver ADRESS -amount 1.000000000 -asset ASSET -purpose “PURPOSE TEXT“ -type full -path /path/to/outputdir

NOTE: Type “full” means it will pack all data independent of common transaction knowledge.

HOW TO PARTIALLY READ A TRANSACTION FILE (only unpack
new files)

EXAMPLE COMMAND:
./ucs_client.sh -action read_trx -user TESTUSER -pin 12345 -password TESTPASSWORD -type partial -path /path/to/file/file.trx

NOTE: Type “partial” means the program will check whether sender and receiver have common transaction knowledge and if so it will only unpack data that are new to the sender. This is standard and you should always do it this way to avoid that other files you already have being overwritten.

HOW TO FULLY READ A TRANSACTION FILE (unpack all files):

EXAMPLE COMMAND:
./ucs_client.sh -action read_sync -user TESTUSER -pin 12345 -password TESTPASSWORD -type full -path /path/to/file/file.trx

NOTE: Type “full” means the program unpacks all data of the transaction file. This overrides your existing data and should only be done with a lot of precaution and awareness! E.g. this allows you to restore you data by a transaction file only if corrupted. BE CAREFUL WITH THIS!

HOW TO CREATE A SYNCRONISATION FILE (contains all files):

EXAMPLE COMMAND:
./ucs_client.sh -action create_sync -user TESTUSER -pin 12345 -password TESTPASSWORD -path /path/to/outputdir

NOTE: As there is no explicit receiver for a synchronization file it always contains all data of all users. It is up to the receiver of the file which data to extract (full or partial).

HOW TO PARTIALLY READ A SYNCRONISATION FILE (only
unpack new):

EXAMPLE COMMAND:
./ucs_client.sh -action read_sync -user TESTUSER -pin 12345 -password TESTPASSWORD -type partial -path /path/to/file/file.sync

NOTE: Type “partial” means the program will check whether sender and receiver have common transaction knowledge and if so it will only unpack data that are new to the sender. This is standard a nd you should always do it this way to avoid that other files you already have being overwritten.

HOW TO FULLY READ A SYNCRONISATION FILE (unpack all):

EXAMPLE COMMAND:
./ucs_client.sh -action read_sync -user TESTUSER -pin 12345 -password TESTPASSWORD -type full -path /path/to/file/file.sync

NOTE: Type “full” means the program unpacks all data of the synchronization file. This overrides your existing data and should only be done with a lot of precaution and awareness! E.g. this allows you to restore you data by a synchronization file only if corrupted. BE CAREFUL WITH THIS!

HOW TO SYNC WITH UCA:

EXAMPLE COMMAND:
./ucs_client.sh -action sync_uca -user TESTUSER -pin 12345 -password TESTPASSWORD

NOTE: The action “sync_uca” will create no output if successful and will always exit with code 0 even if the receive/send of data to the defined UCA(s) failed. If receive/send to one more of UCAs failed it will output a “ERROR” message containing used IP (<uca_ip>) and Port (<ucs_snd_port>) as defined in ~/control/uca.conf.

HOW TO CREATE A BACKUP:

EXAMPLE COMMAND:
./ucs_client.sh -action create_backup

HOW TO RESTORE A BACKUP:

EXAMPLE COMMAND:
./ucs_client.sh -action restore_backup -path /path/to/ucs/backup/<STAMP>.bcp

HOW TO DISPLAY STATISTICS:

EXAMPLE COMMAND:
./ucs_client.sh -action show_stats -user TESTUSER -pin 12345 -password TESTPASSWORD