qrtz is the processing language for hybrixd. It is used to handle routing requests. Each routing request
spawns a process that follows qrtz steps to a result, or a failure.
A qrtz command always consists of 4 characters. The parameters are
separated by spaces:
head parameter1 parameter2 ...
Recipe
Recipes are JSON files that contain parameters and qrtz methods for asset handling, data source queries or actionable engines. A recipe, depending on what it does, fits in one of three categories: asset, source, or engine.
A source-recipe in principle contains only methods to query read-only data sources.
An engine-recipe contains methods to perform actions based on incoming data, business logic and often interfaces with other programming languages.
An asset-recipe contains methods to query value-related ledger or cryptocurrency API's. It returns path options to the hybrixd routing engine for users or machines to perform actions like, for example, querying the balance of an address.
The categories above make it easier to recognize the functionality of a recipe instantly, and analyze it from the proper context. Source and engine recipes are interpreted identically by the scheduler. However, they are available through separate paths: /source and /engine. Asset recipes are specifically tailored to be used in the context of decentralized banking and are available through the routing path: /asset.
Data flow
Every step in a qrtz recipe has the potential to alter the data of the process in which the script is running. Process data is available by using the dollar sign $. It is also available as input to every new process step. It behaves like a variable in qrtz in that it can be read anywhere. However, the difference with a variable is that the data of the process can be changed by every step of the process. The design consideration is that this coaxes you to design your qrtz script with a concise data flow in mind.
Here is an example of some qrtz steps and the resulting data flow.
data 'Hello dog!' // data 'Hello dog!' - set the data of the process
drop -4 // data 'Hello ' - drops the last 4 characters
repl ' ' ' world!' // data 'Hello world!' - replaces the ' ' (space) by ' world!'
Variables and scopes
$ the main stream variable it is the output of the previous step. Use $$ to escape the dollar sign (for example in regular expressions).
$variable Retrieve a property from the recipe scope (read only)or process scope if no recipe variable is found.
$local::variable Use a local scope (maintained between all processes spawned from the same recipe).
$otherRecipe::variable the recipe scope of another recipe (read-only)
${.property} To retrieve a sub properties
of objects and arrays. For example: if data
is {a:{b:1}}} then ${.a.b} will
return 1
Debugging
qrtz processes flow can be analyzed using the debug tool. These are only available to node operators with root access.
CLI debugging
Adding the -d flag to a cli api call will provide the debug output. This will illustrate the programe flow of all subprocesses and steps.
case upper // input: 'what is THIS?', returns: 'WHAT IS THIS?'
case lower // input: 'what is THIS?', returns: 'what is this?'
case words // input: 'what is THIS?', returns: 'What Is This?'
case first // input: 'what is THIS?', returns: 'What is this?'
case camel // input: 'what is THIS?', returns: 'whatIsThis?'
case inverse // input: 'what is THIS?', returns: 'WHAT IS this?'
drop [offset=1] [ending=0] Drop elements from the start or end of an array or string.
(Reversed function of pick and push.)
Drop elements from the start or end of an array or string.
(Reversed function of pick and push.)
Name
Type
Description
offset
Integer
[Optional, default = 1] Amount of elements to delete from start.
ending
Integer
[Optional, default = 0] Amount of elements to include or trim from end.
drop 5 // drop from the left input: 'this_is_my_data', output: 'is_my_data'
drop -5 // drop from the right input: 'this_is_my_data', output: 'this_is_my'
drop 5 5 // drop from both edges input: 'this_is_my_data', output: 'is_my'
drop a // drop key from object input: {a:1,b:2}, output: {b:2}}
drop [1,3] // drop indices input: 'this_is_my_data', output: 'ti_is_my_data'
drop [a,b] // drop keys from object input: {a:1,b:2,c:3}, output: {c:3}}
exclvalue [multi=false] [onFound=1] [onNotFound=1] Exclude elements from an array or input string based on their value.
Jump to a target based on success or failure.
(Reversed function of filt.)
Exclude elements from an array or input string based on their value.
Jump to a target based on success or failure.
(Reversed function of filt.)
Name
Type
Description
value
object
Remove specified value from string, array or object.
multi
Boolean
[Optional, default = false] Treat value input as list of values to exclude.
onFound
Integer
[Optional, default = 1] Jump this many steps when the value is found.
onNotFound
Integer
[Optional, default = 1] Jump this many steps when the value is not found.
filt [property=''] value [multi=false] [onFound=1] [onNotFound=1] Filter all specified elements from an array, removing all other entries.
(Reversed function of excl.)
Filter all specified elements from an array, removing all other entries.
(Reversed function of excl.)
Name
Type
Description
property
string
[Optional, default = ''] Filter on certain property
value
object
Keep only specified value from string, array or object.
multi
Boolean
[Optional, default = false] Treat value input as list of values to filter.
onFound
Integer
[Optional, default = 1] Jump this many steps when the value is found.
onNotFound
Integer
[Optional, default = 1] Jump this many steps when the value is not found.
findneedle [onFound=1] [onNotFound=1] Find a string in an array of objects, and return the object it was found in.
Find a string in an array of objects, and return the object it was found in.
Name
Type
Description
needle
Object
The object to find
onFound
Number
[Optional, default = 1] Where to jump when the data is found
onNotFound
Number
[Optional, default = 1] Where to jump when the data is not found
find world 1 2 // input: 'hello world', jumps one if found, 2 if not found
find 'eth.' // input: ['btc','eth','eth.wbtc','eth.hy','vic','vic.hy'], output: ['eth.wbtc','eth.hy']
find {'id':'abcd'} // input: [{'id':'abcd'},{'id':'efgh'}], output: [{'id':'abcd'}]
flip Flip reverse the contents of an array or string.
[Optional, default = 1] The amount of characters to get.
data 'abc'
head // return 'a'
head 1 // return 'a'
head 2 // return 'ab'
inclkey Check if array or string includes a certain value. Boolean version of indx.
Check if array or string includes a certain value. Boolean version of indx.
Name
Type
Description
key
String
key for the item to delete
incl needle 1 2 // if data is an array or string that includes "needle" then jump 1, 2 otherwise
incl myVar needle 1 2 // if myVar is an array or string that includes "needle" then jump 1, 2 otherwise
indxneedle [backwardSearch=false] [arraySearch=false] Find a string in a string or an array of strings, and return the index(es) of it. For a boolean version see incl.
Find a string in a string or an array of strings, and return the index(es) of it. For a boolean version see incl.
Name
Type
Description
needle
String
The string to find the index of
backwardSearch
Boolean
[Optional, default = false] Search backwards
arraySearch
Boolean
[Optional, default = false] Return index from every array element
indx 'needle' // input: 'This is a needle and not a needle...', output: 10
indx 'needle' true // input: 'This is a needle and not a needle...', output: 27
indx 'needle' // input: ['This is a needle...','This is not','needle'] output: 3
indx 'needle' false true // input: ['This is a needle...','This is not','needle'] output: [10,-1,0]
isctdata Return the intersect of an array or string.
many [amount=2] Keep all duplicate elements in an array of which there are many, removing all single, or less available entries.
Keep all duplicate elements in an array of which there are many, removing all single, or less available entries.
Name
Type
Description
amount
Number
[Optional, default = 2] Optional: Group amount above which to keep elements.
many // input: ['g','l','o','l','l','s','s'], output: ['l','l','l','s','s']
many 3 // input: ['g','l','o','l','l','s','s'], output: ['l','l','l'] - more than 3 entries
movesourceKey [sourceCount=0] [sourceOffset=0] [targetOffset=0] [targetCount=0] Move elements from one array to another.
regx [variable=data] pattern [flags=[]] [onMatch=1]] [onNoMatch=1]] Test the data against the regex pattern
Test the data against the regex pattern
Name
Type
Description
variable
String
[Optional, default = data] the variable to perform the regex on
pattern
String
the regex pattern
flags
Array
[Optional, default = []] optional flags like ig (case insensitive, global search)
onMatch
Integer
[Optional, default = 1]]
onNoMatch
Integer
[Optional, default = 1]]
data 'applepie'
regx '^apple' 1 2 // match when start of the string contains 'apple'
regx variable '^apple' 1 2 // match when start of variable contains 'apple'
regx variable '^apple' ['i'] 1 2 // match when start of variable contains 'apple' or 'Apple' (case insensitive)
done 'Match!'
done 'No Match'
repl [string=] [replace=''] [regexModifier=false] Replace part or parts of a string. All matched occurrences are replaced.
Regular expressions can be used by specifying regexModifier.
Replace part or parts of a string. All matched occurrences are replaced.
Regular expressions can be used by specifying regexModifier.
Name
Type
Description
string
String
[Optional]'] The string to replace.
replace
String
[Optional, default = ''] The value to replace all occurrences of string with.
regexModifier
String
[Optional, default = false] Modify replace to use regular expressions.
repl // input: 'Many apples for you.', returns: 'Manyapplesfor ou.'
repl 'apples ' // input: 'Many apples for you.', returns: 'Many for you.'
repl 'apples' 'pears' // input: 'Many apples for you.', returns: 'Many pears for you.'
repl ['apples','you'] 'foo' // bulk replacement mode -> input: 'Many apples for you.', returns: 'Many foo for foo.'
repl ['apples','you'] ['pears','me'] // bulk replacement mode -> input: 'Many apples for you.', returns: 'Many pears for me.'
repl 'o' ['A','I'] // bulk replacement mode -> input: 'Many apples for you.', returns: 'Many apples fAr yIu.'
repl 'apples' '' true // regex replacement mode -> input: 'Many apples for your apples.', returns: 'Many for your apples.'
repl 'apples' '' g // regex replacement mode -> input: 'Many apples for your apples.', returns: 'Many for your .'
repl 'apples.$$' 'pears.' true // regex replacement mode -> input: 'Many apples for your apples.', returns: 'Many apples for your pears.' (double $ to specify the actual $ sign, and not a variable)
repl 'aPPles' 'pears' gi // regex replacement mode -> input: 'Many apples for your apples.', returns: 'Many pears for your pears.'
shuf [amount] Shuffle elements in an array or input string randomly or shift them left or right.
Shuffle elements in an array or input string randomly or shift them left or right.
Name
Type
Description
amount
Number
[Optional] Optional: Amount to shift, if omited the array is shufled randomly
shuf // input: ['A','B','C'], output: ['B','A','C'] (or any other random combination)
shuf 1 // input: ['A','B','C'], output: ['C','A','B']
shuf -1 // input: ['A','B','C'], output: ['B','C','A']
size [input] Count the amount of entries a list, string or object has.
Count the amount of entries a list, string or object has.
sort // input: 'BADEFC', sorts the object ascending by value: 'ABCDEF'
sort desc // input: [10,8,5,9], sorts the object descending by value: [10,9,8,5]
sort asc // input: [10,8,5,9], sorts the object descending by value: [5,8,9,10]
sort .b asc // input: [{'a':4,'b':'B'},{'a':2,'b':'A'}], sorts the array by the value of object key 'b': [{'a':2,'b':'A'},{'a':4,'b':'B'}]
sort .b desc // input: [{'a':4,'b':'B'},{'a':2,'b':'A'}], sorts the array by the value of object key 'b': [{'a':2,'b':'B'},{'a':4,'b':'A'}]
splt [separator=] [elements=undefined] Explode a string into an array, split by separator.
Explode a string into an array, split by separator.
Name
Type
Description
separator
String
[Optional]'] Separator character to use for splitting.
elements
String
[Optional, default = undefined] Elements to select from splitted string.
takestart [length=all] Take elements cutting them from an array or input string.
Take elements cutting them from an array or input string.
Name
Type
Description
start
Number
Amount of elements to take off the start.
length
Number
[Optional, default = all] How many elements to keep
take // input: 'abcdefg', output: 'bcdefg'
take 2 // input: 'abcdefg', output: 'cdefg'
take 2 2 // input: 'abcdefg', output: 'cd'
take -2 // input: 'abcdefg', output: 'abcde'
take -2 3 // input: 'abcdefg', output: 'bcde'
trim [leftOrBothTrim=] [rightTrim=leftOrBothTrim] [reverseTrim=false] Trim elements from left and or right side of a string or array.
Trim elements from left and or right side of a string or array.
Name
Type
Description
leftOrBothTrim
String | Array
[Optional]'] The character(s) to trim from the ends of the string, or the left end if the second argument is specified.
rightTrim
String | Array
[Optional, default = leftOrBothTrim] The character(s) to trim from the right side of the string.
reverseTrim
Boolean
[Optional, default = false] Trim only the right side of the string. Useful for trimming only the rear side.
trim // input: " hello world ", output: 'hello world'
trim '_' // input: "__hello_world___", output: 'hello_world'
trim '_' null true // input: "__hello_world___", output: '__hello_world'
trim null '_' true // input: "__hello_world___", output: '__hello_world'
trim ['_','-'] // input: "_-_hello-_world_-_-_", output: 'hello-_world'
trim ['_','-'] '_' // input: "_-_hello-_world_-_-_", output: 'hello-_world_-_-'
uniq [groupSize=1] Remove all duplicate elements from an array, leaving only unique entries.
Remove all duplicate elements from an array, leaving only unique entries.
Name
Type
Description
groupSize
Number
[Optional, default = 1] Maximum group size of which to keep elements.
uniq // input: ['g','l','o','l','l','s','s'], output: ['g','l','o','s']
uniq 2 // input: ['g','l','o','l','l','s','s'], output: ['g','l','l','o','s','s'] - two or less unique entries
Cryptography
decr [keys] keys.publicKeykeys.secretKey [salt] [onSuccess=1] [onFail] Decrypt serialized data using a public and private keypair.
Decrypt serialized data using a public and private keypair.
Name
Type
Description
keys
Object
[Optional] Provide keys to decrypt. For root this will default to the node keys, which are not available to non root users.
keys.publicKey
String
keys.secretKey
String
salt
String
[Optional]
onSuccess
Integer
[Optional, default = 1]
onFail
Integer
[Optional]
decr {publicKey:$publicKey,secretKey:$secretKey} // decrypts the data stream into a string
decr {publicKey:$publicKey,secretKey:$secretKey} 1 2 // decrypts the data stream, jump 1 on success, 2 on failure
decr {publicKey:$publicKey,secretKey:$secretKey} 'SALT' 1 2 // decrypts the data stream using specified salt
decr // encrypts the data stream using node keys (requires root!)
encr [keys] keys.publicKeykeys.secretKey [salt] [onSuccess=1] [onFail=1] Encrypt and serialize data into an URL-safe format using a static key.
Encrypt and serialize data into an URL-safe format using a static key.
Name
Type
Description
keys
Object
[Optional] Provide keys to encrypt. This will default to the node keys.
keys.publicKey
String
keys.secretKey
String
salt
String
[Optional]
onSuccess
Integer
[Optional, default = 1]
onFail
Integer
[Optional, default = 1]
encr {publicKey:$publicKey,secretKey:$secretKey} // encrypts the data stream into an URL-safe format
encr {publicKey:$publicKey,secretKey:$secretKey} 1 2 // encrypts the data stream, jump 1 on success, 2 on failure
encr {publicKey:$publicKey,secretKey:$secretKey} 'SALT' 1 2 // encrypts the data stream using specified salt
encr // encrypts the data stream using node keys (requires root!)
hash [method='sha256'] Create a sha256 hash from an input string.
Create a sha256 hash from an input string.
Name
Type
Description
method
String
[Optional, default = 'sha256'] Method to use for hashing, defaults to SHA256. Available: md5, djb2, sha244, sha256
keys [secret] Create or reproduce cryptographic signing keys.
Create or reproduce cryptographic signing keys.
Name
Type
Description
secret
String
[Optional] The secret key to recreate a public key from.
keys // generate a random public and secret key pair
keys node // reproduce keys that belong to the node
keys '$secretKey' // reproduce public and secret keypair from $secretKey
node [request] Return information about the hybrix node
Return information about the hybrix node
Name
Type
Description
request
String
[Optional] The information you want to request
node // returns the public key / node ID
signkey [signature] [onSuccess] [onFail] Sign a message with a secret key or verify the signature for a public key.
Sign a message with a secret key or verify the signature for a public key.
Name
Type
Description
key
String
The secret key ot sign with of the public key to verify
signature
Boolean | String
[Optional] Indication to create a detached signature or a detached signature to verify.
onSuccess
Boolean | String
[Optional] Amount of instructions lines to jump on success.
onFail
Boolean | String
[Optional] Amount of instructions lines to jump on success.
sign secretKey // create and return signature for the message in data stream
sign publicKey signature 1 2 // verify the signature for the message and jump accordingly
const baseCode = require('../../../common/basecode');
Flow
flow [onTrue=1] [onFalse=1] Change the flow of execution based on a string or value comparison.
Change the flow of execution based on a string or value comparison.
Name
Type
Description
String
[variableName] Variable to check
String | Object
[compare] String(s) or value(s) to compare to.
onTrue
Integer
[Optional, default = 1] Amount of instructions lines to jump when condition matches true. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
onFalse
Integer
[Optional, default = 1] Amount of instructions lines to jump when condition matches false. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
flow yes 1 -3 // test if data equals 'yes', if true jump to the next instruction, if false jump back three instructions
flow {yes:3,no:2} // if data equals 'yes' jump three instructions, if no jump two instructions, else jump to next instruction
flow {yes:3,no:2} 5 // if data equals 'yes' jump three instructions, if no jump two instructions, else jump five instructions
flow {0:3,3:2} 5 // if data equals 0 jump three instructions, if data equals 3 jump two instructions, else jump five instructions
flow [3,2] 5 // if data equals 0 jump three instructions, if 1 jump two instructions, else jump five instructions
flow variable 'okay' 2 5 // if variable equals 'okay' jump two instructions, else jump five instructions
flow variable {0:3,3:2} 5 // if variable equals 0 jump three instructions, if variable equals 3 jump two instructions, else jump five instructions
hook [onError] [errorCode=1] Indicates a fallback target when an error is encountered.
Indicates a fallback target when an error is encountered.
Name
Type
Description
onError
String | Integer
[Optional] Determines fallback behaviour. If integer: jump, if not stop with error code err. If ommited resets the hook.
errorCode
Integer
[Optional, default = 1] Error code for stopping hook.
hook "Something went wrong." 0
fail "Something caused an error"
// this will fail but the hook will cause a non error output of "Something went wrong."
hook "Something went wrong." 1
fail "Something caused an error"
// this will fail but the hook will overwrite the error output with "Something went wrong."
hook 2
fail "Something caused an error"
done "Something went wrong."
// this will fail but the hook will cause a jump and a non error output of "Something went wrong."
hook
hook
jumpstep Jump forward or backward several instructions. Using labels is also supported.
Jump forward or backward several instructions. Using labels is also supported.
Name
Type
Description
step
Integer
Amount of instructions lines to jump. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
jump 2 // jump over the next instruction
jump -3 // jump backwards three instructions
jump
looppositionvariablecondition [initValue=1] [stepOperation=+1] Loop back to position or label based on criteria.
Loop back to position or label based on criteria.
Name
Type
Description
position
String
Position to loop back to.
variable
String
Variable to store the loop count.
condition
String
Condition that keeps the loop going. If given an array or object, iterates over the amount of elements.
initValue
String
[Optional, default = 1] Value to initialize the loop.
stepOperation
String
[Optional, default = +1] Optional: How the loop variable is iterated.
loop
root [onRoot]] [onNotRoot]] Check whether process has sufficient permissions.
Check whether process has sufficient permissions.
Name
Type
Description
onRoot]
Integer
[Optional]
onNotRoot]
Integer
[Optional]
root // fails if not root
root 2 // jumps two if root, else continues
root 1 2 // jumps one if root, two otherwise
ship [variable] [onPositive=1] [onZero=1] [onNegative=1] [onNaN=1] Test a number to be positive, zero or negative (named after the spaceship operator)
Test a number to be positive, zero or negative (named after the spaceship operator)
Name
Type
Description
variable
String
[Optional] which variable to test,defaults to data stream.
onPositive
Integer
[Optional, default = 1] Amount of instructions lines to jump when number is positive.
onZero
Integer
[Optional, default = 1] Amount of instructions lines to jump when number is zero.
onNegative
Integer
[Optional, default = 1] Amount of instructions lines to jump when number is negative.
onNaN
Integer
[Optional, default = 1] Amount of instructions lines to jump when data is not a number.
ship 1 2 2 3 // if data value is positive jump one step, if zero or negative jump two steps, if not a number jump three steps
ship variable 1 2 2 3 // if value in variable is positive jump one step, if zero or negative jump two steps, if not a number jump three steps
test [variableName] onTrue [onFalse=1] Evaluate condition and jump accordingly. For mathematical conditionals use the 'true' function.
Evaluate condition and jump accordingly. For mathematical conditionals use the 'true' function.
Name
Type
Description
variableName
String | Integer
[Optional] Variable to test, defaults to data stream
onTrue
Integer
Amount of statements to jump when condition evaluates to true. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
onFalse
Integer
[Optional, default = 1] Amount of statements to jump when condition evaluates to false. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
test 4 1 // if data contains a truthy value jump four statements else 1 statement
test myVariable 1 -3 // if the myVariable variable evaluates to true jump one statement, else jump back three
test [a,b,c] 2 1 // if all variables a,b and c evaluate to true jump two statements, else jump one
truecondition [onTrue=1] [onFalse=1] Test truth of a math condition and choose to jump. The condition is evaluatated mathematically and jumped accordingly.
Test truth of a math condition and choose to jump. The condition is evaluatated mathematically and jumped accordingly.
Name
Type
Description
condition
Boolean
Mathematical condition to analyse. (Example: $A>5)
onTrue
Integer
[Optional, default = 1] Amount of instructions lines to jump when condition matches true. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
onFalse
Integer
[Optional, default = 1] Amount of instructions lines to jump when condition matches false. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
true >3 1 -3 // test if data>3, if true jump to the next instruction, if false jump back three instructions
true <=1 -4 1 // test if data<=1, if true jump back four instructions, if false jump to the next instruction
true >3 -5 // test if data>3, if true jump back five instructions, else default jump to the next instruction
true ==3 -5 // test if data=3, if true jump back five instructions, else default jump to the next instruction
true $myVar==3 3 // test if $myVar=3, if true jump three instructions, else default jump to the next instruction
true '$b<=100 and $b>1' 2 // test if $b<=100 and $b>1, if true jump two instructions, else default jump to the next instruction
type [type] Return or set the type of the data stream.
Return or set the type of the data stream.
Name
Type
Description
type
String
[Optional] Type to convert data stream variable to.
type // input: 'hello', returns: 'string'
type string // makes the data type string
type string 1 2 // if data type is string, jump 1 step, else 2 steps
type {string:1} 2 // if data type is string, jump 1 step, else 2 steps
type var string 1 2 // if var type is string, jump 1 step, else 2 steps
type var {string:1} 2 // if var type is string, jump 1 step, else 2 steps
void [variableName] or [onTrue=1] [onFalse=1] Change the flow of execution based on void analysis.
Change the flow of execution based on void analysis.
Name
Type
Description
variableName
String
[Optional] Variable to check, uses data stream otherwise.
or
Strin
Object} [compare=void] Type of void to analyse. Possible values: void, undefined, null, string, array, object, empty, zero, false, any.
onTrue
Integer
[Optional, default = 1] Amount of instructions lines to jump when condition matches true. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
onFalse
Integer
[Optional, default = 1] Amount of instructions lines to jump when condition matches false. (1 = jump forward 1 instruction, 2 = jump backward two instructions)
void 1 -3 // test if data is null or undefined, if true jump to the next instruction, if false jump back three instructions
void void 1 -3 // test if data is null or undefined, if true jump to the next instruction, if false jump back three instructions
void {null:3,undefined:2} // if data is null jump three instructions, if undefined jump two instructions, else jump to next instruction
void {string:3,array:2} 5 // if data equals '' jump three instructions, if an empty array jump two instructions, else jump five instructions
void myVariable any 1 2
void myVariable {string:5, array:6} 2
Interactive
exit Exits the interactive shell, only available in interactive cli mode.
Exits the interactive shell, only available in interactive cli mode.
Name
Type
Description
exit
help [func] Provides help on provided qrtz command, only available in interactive cli mode.
Provides help on provided qrtz command, only available in interactive cli mode.
Name
Type
Description
func
String
[Optional] function to find help for
help done
modeswitch1 [switch2...] Toggles modes in interactive shell, only available in interactive cli mode.
Toggles modes in interactive shell, only available in interactive cli mode.
Name
Type
Description
switch1
String
Toggle for modes
switch2...
String
[Optional] Toggle for modes
mode debug=on
mode verbose=off debug=off
quit Quits the interactive shell, only available in interactive cli mode.
Quits the interactive shell, only available in interactive cli mode.
Name
Type
Description
quit
Logging
infomessages... Logs data to error output (information).
Logs data to error output (information).
Name
Type
Description
messages...
String
The messages you want to log.
info 'An informative message' // logs "[i] An informative message"
logs [messages...] Logs data to log output (progress).
Logs data to log output (progress).
Name
Type
Description
messages...
String
[Optional] The messages you want to log.
logs 'My progress' // logs "[.] My progress"
warnmessages... Logs data to error output (warnings).
Logs data to error output (warnings).
Name
Type
Description
messages...
String
The messages you want to log.
warn 'Houston, we have a problem' // logs "[!] Houston, we have a problem"
Numbers
atom [reduce=false] [factor=$factor] Convert a number from atomic units (large integer), or convert to atomic units.
Convert a number from atomic units (large integer), or convert to atomic units.
Name
Type
Description
reduce
Number
[Optional, default = false] When true reduces the input data.
factor
Number
[Optional, default = $factor] Factor to use (sometimes also called decimals).
atom // input: 1000000000, output: "10.00000000" (using $factor = 8)
atom 6 // input: 1000000000, output: "1000.000000"
atom false // input: 1000000000, output: "10.00000000" (using $factor = 8)
atom true // input: 10, output: "1000000000" (using $factor = 8)
atom false 4 // input: 8, output: "0.0008"
atom true 4 // input: 8, output: "80000"
atom true btc // input: 8, output: "800000000"
form [factor=$factor] Format a (floating point) number and return a neatly padded string, rounding down for sufficiency.
Format a (floating point) number and return a neatly padded string, rounding down for sufficiency.
Name
Type
Description
factor
Number | String
[Optional, default = $factor] The amount of decimals desired or the symbol of the asset which factor will be used
form // input: 10, output: "10.00000000" (using $factor = 8)
form 8 // input: 10, output: "10.00000000"
form 4 // input: 8.34562, output: "8.3456"
form btc // input: 10, output: "10.00000000"
form eth // input: 10, output: "10.000000000000000000"
mathequation [followUpEquation...] Calculates numbers and variables. Mathematical calculations can be done with very large numbers.
Calculates numbers and variables. Mathematical calculations can be done with very large numbers.
Name
Type
Description
equation
String
String containing the equation or function to calculate outcome of.
followUpEquation...
String
[Optional] optional subsequent equations.
math 1034+8-(3^4) // returns 267
math ^25 // returns the value of data to the power of two times five
math + // adds all the numbers in the data array
math round // round the value in data stream
math +3 2 // adds three to the value in data stream and then multiplies it by two
math '+3 2' // adds six to the value in data stream
math 2 round // multiplies the value in data stream and then rounds it
math abs(-23) // calculate the absolute value of -23, returns 23
math catalan(7) // derive the catalan number of 7, returns 429
math conj // compute the complex conjugate of a complex value in the data stream
math ['2','1','2'] // add up all numbers in the array, overriding data stream input
math ['2','1','2'] // multiply all numbers in the array, overriding data stream input
rand [start] [until] Return a random number between 0 and 1, an integer, or return a random index number from an array.
Return a random number between 0 and 1, an integer, or return a random index number from an array.
Name
Type
Description
start
Number
[Optional] When specified, becomes the range or start to return a random integer.
until
Number
[Optional] When specified returns a random integer between start and until.
rand // return a random float between 0 and 1, like for instance 0.233
rand 1 // return a random integer number: 0 or 1
rand 200 // return a random integer number: between 0 and 200
rand 20 30 // return a random integer number: between 20 and 30
rand index // return a random index number based on the amount of elements in the input object
rand index $data // return a random index number based on the amount of elements in $data
rand pick // return a random picked item from the input data
rand pick $data // return a random picked item from the elements in $data
Process
callcommand [data=data] Execute a quartz routine in the same engine. Call creates a new process and waits for the data of that process
to be returned (combining Qrtz commands fork and read).
Execute a quartz routine in the same engine. Call creates a new process and waits for the data of that process
to be returned (combining Qrtz commands fork and read).
Name
Type
Description
command
String
A string containg the command path. E.g. "command/a/b". The child process provides its arguments: $1 = "a", $2 = "b"
data
Object
[Optional, default = data] Optional data to be passed to the new process.
call balance/_dummyaddress_ // Call the balance routing and pass the result to next step.
data test // Fill the data stream with string 'test'.
data {key:'test'} // Fill the data stream with object {key:'test'}.
done [data=data] Stop processing and return message.
Stop processing and return message.
Name
Type
Description
data
Object
[Optional, default = data] Message/data passed to parent process.
done // stop processing without error
done "Success" // stop processing without error and put "Success" in main process data field
eachcommand- Iterate through elements of a container. eachute a given function for all elements in parallel.
Iterate through elements of a container. eachute a given function for all elements in parallel.
Name
Type
Description
command
String
A string containg the call and path. "call/a/b": this calls Qrtz function using $1 = "a", $2 = "b".
-
meta
Meta data to be passed along
data ["a","b","c"]
each test // calls test with data = {key=0, value="a"}, and further
data {"a":0,"b":1}
each test/x/y // calls test starting with data = {data: {"a":0,"b":1}, key:"a", value:0} and $1 = "x", $2 = "y", and further
data {"a":0,"b":1}
each test/x/y z // calls test starting with data = {data: {"a":0,"b":1}, key:"a", value:0, meta: "z"} and $1 = "x", $2 = "y", and further
execname Execute a command line script or binary. Allows passing of environment variables. This method is needs root.
Execute a command line script or binary. Allows passing of environment variables. This method is needs root.
Name
Type
Description
name
String
Name and path of the script/binary. Passing arguments is possible.
fail [data=data] Fail processing and return message.
Fail processing and return message.
Name
Type
Description
data
Object
[Optional, default = data] Message/data passed to parent process.
fail // stop processing and set error to 1
fail "Something wrong!" // stop processing, set error code to 1, and put "Something wrong!" in main process data field
fail 404 "Cannot find file!" // stop processing, set error code to 404, and put "Cannot find file!" in main process data field
foldcommand- Iterate through elements of a container. Execute a given function for every element sequentially, failing completely if a single iteration fails. The parallel version of this method is each.
Iterate through elements of a container. Execute a given function for every element sequentially, failing completely if a single iteration fails. The parallel version of this method is each.
Name
Type
Description
command
String
A string containg the call and path. "call/a/b": this calls Qrtz function using $1 = "a", $2 = "b".
-
meta
Meta data to be passed along
data ["a","b","c"]
fold test // calls test with data = {key=0, value="a"}, and further
data {"a":0,"b":1}
fold test/x/y // calls test starting with data = {key:"a", value:0} and $1 = "x", $2 = "y", and further
data {"a":0,"b":1}
fold test/x/y z // calls test starting with data = {key:"a", value:0, meta: "z"} and $1 = "x", $2 = "y", and further
forkcommand [data=data] [childReferenceID] Creates a new process by calling the command asynchronously.
Creates a new process by calling the command asynchronously.
Name
Type
Description
command
String
A string containing the call and path. "command/a/b". This calls 'command' using $1 = "a", $2 = "b".
data
Object
[Optional, default = data] Optional data to be passed to the new process.
childReferenceID
Number
[Optional] If undefined then the new process will be independant. If true this will be a single child. Otherwise it will be instantiated as one of multiple child processes of the current process.
fork "balance/_dummyaddress_" // starts a process to retrieve the dummy balance and continue without waiting for a reply
funcname Execute a javascript module function. Only if the script is run from a recipe with a non-Quartz module defined.
Execute a javascript module function. Only if the script is run from a recipe with a non-Quartz module defined.
Name
Type
Description
name
String
Name of the function. Passing arguments is possible.
qrtz:
data 'hello'
func 'myFunction'
done // returns 'hello world'
module.js:
function myFunction(proc,data){
proc.done(data+' world');
}
the data type. default: 'data': data as is; 'file': for static file content retrieval.
mime data // set the data type to 'data'
done hello // stop processing, set no error and pass string 'hello' in a data object
mime text/plain // set the data type to 'text/plain', which returns raw data
done hello // stop processing, and pass raw string 'hello'
mime file:data // set the data type to 'file:data'
done hello.txt // stop processing, set no error and pass the content of the hello.txt file as data in the result json
mime file:text/html // set the data type to 'text/html'
done hello.html // stop processing, set no error and pass the content of the hello.html file as flat file, resulting in webserver behaviour
mime blob // set the data type to 'blob', which makes it possible to return binary data
[Optional, default = data] Store data in this subprocess data field. Passed to parent process.
pass // push data stream contents to master process
pass 'Nice dude!' // push data "Nice dude!" to master process
pass 'Wow: $' // push data "Wow:" with previous subprocess data concatenated
prog [start] [end] [second] Set progress of parent process directly, or incrementally in a set amount of time.
Set progress of parent process directly, or incrementally in a set amount of time.
Name
Type
Description
start
Number
[Optional] Current progress amount, specified as a number between 0 and 1, or the starting value.
end
Number
[Optional] When specified, sets progress from the start value, finishing at the end value.
second
Number
[Optional] Amount of seconds to automatically set progress.
prog // return progress data
prog 0.5 // progress is set to 0.5 (which means 50%)
prog 2 5 // progress is set to 0.4 (which means 40%, or step 2 of 5)
prog 0 1 // progress is automatically set ranging from 0 to 1, in a matter of 5 seconds
prog auto // restore automatic progress reporting (alternative notation)
readprocessIDs [interval=500] Wait for one or more processes to finish and return the results.
Wait for one or more processes to finish and return the results.
Name
Type
Description
processIDs
Array
A string containing the processID or an array of strings containing multiple processIDs.
interval
Number
[Optional, default = 500] The amount of millisecs between each check if processes are finished.
read '123456' // wait for process 123456 to finish and return its data
read ["123456',"654321"] // wait for processes 123456 and 654321 to finish and return their data combined into an array
read {"a":null,"b":34} // wait for processes 123456 and 654321 to finish and return their data combined into an object with property labels a and b
servpath Serve a file
Note: can only be defined as singular command in a method
Serve a file
Note: can only be defined as singular command in a method
Name
Type
Description
path
String
File path of the file to serve
serv myFile.html
stop [err=0] [data=data] Stop processing and return data.
Stop processing and return data.
Name
Type
Description
err
Number
[Optional, default = 0] Set the error flag of the subprocess. (0 = no error, 1 or higher = error)
data
Object
[Optional, default = data] Store data in this subprocess data field. (Passed to parent process on stop.)
stop // stop processing and set no error
stop "OK" // stop processing, set no error, and put "OK" in main process data field
stop 0 "All is good." // stop processing, set no error, and put "All is good." in main process data field
stop 404 "HELP! Not found." // stop processing, set error to 404, and put "HELP! Not found." in main process data field
syncname Execute a javascript module function and return the result directly (used for serving web content through api). Only if the script is run from a recipe with a non-Quartz module defined.
Note: can only be defined as singular command in a method
Execute a javascript module function and return the result directly (used for serving web content through api). Only if the script is run from a recipe with a non-Quartz module defined.
Note: can only be defined as singular command in a method
Name
Type
Description
name
String
Name of the function. Passing arguments is possible.
sync myFunction
module.js:
function myFunction(proc,data){
proc.done('hello world');
}
time [millisecs] [data=data] [err=1] Set timeout of current process.
Set timeout of current process.
Name
Type
Description
millisecs
Number
[Optional] Amount of milliseconds to wait. If not specified the timeout is unlimited, and only limited by the scheduler engine.
data
Object
[Optional, default = data] Set data variable as soon as the process times out.
err
Object
[Optional, default = 1] Value to set the error flag to as soon as the process times out.
time // set unlimited timeout
time 0 // immediately timeout the process
time 1000 // set timeout to one second
time 1000 "Time's up!" 0 // set timeout to one second, if exceeded set data to "Time's up!" and give no error
waitmillisecs Wait a specified amount of time before continuing the process.
Wait a specified amount of time before continuing the process.
Name
Type
Description
millisecs
Number
Amount of milliseconds to wait.
wait 2000 // wait for two seconds, before continuing process
withvariableqrtza, Performs a data command using a specific variable. The data buffer is left untouched.
Performs a data command using a specific variable. The data buffer is left untouched.
Name
Type
Description
variable
String
Variable to read/write to.
qrtz
String | Array
command A string containg the Qrtz command. When using an array, the arguments may be specified as elements in the array.
a,
String | Array
b, c, etc. Arguments to be passed to the Qrtz command, or further commands.
with someVariable math +1 // increment $someVariable by +1
with someVariable [math,+1] // increment $someVariable by +1 (same as above, but array notation which is used for multiple commands)
with someVariable [math,+1] [math,+100] [atom] // increment $someVariable by +1, then +100, then convert to atomic units
with [var1,var2] [math,+1] [math,+100] [atom] // increment both variables by +1, then +100, then convert to atomic units
with {var1:1,var2:3} [math,+1] [math,+100] [atom] // initializes and then increment both variables by +1, then +100, then convert to atomic units
with var[].a math +1 // if var = [{a:1},{a:2}] update to [{a:2},{a:3}]
with var{}.a math +1 // if var = {x:{a:1},y:{a:2}} update to {x:{a:2},y:{a:3}}
burn myFavoriteColor 1 2 // deletes the item under key 'myFavoriteColor' - if successful jump 1, else 2
burn myFavoriteColor:${publicKey}:${signature} // deletes the item under key 'myFavoriteColor' only if the key is signed by the originator
file [success=1] [failure=1] File reads the data of a filekey into process memory.
File reads the data of a filekey into process memory.
Name
Type
Description
success
Number
[Optional, default = 1] Where to jump when the data is found
failure
Number
[Optional, default = 1] Where to jump when the data is not found
file 2 1 // reads file contents and if successful jumps two steps, on failure jump one step
hopskey [value=0] Read or set the value of the amount of hops that a file is from its originator.
Read or set the value of the amount of hops that a file is from its originator.
Name
Type
Description
key
String
Key under which to store data
value
Number
[Optional, default = 0] Value of hops to store
hops storeDataStuff // returns the amount of hops storeDataStuff
hops storeDataStuff 1 // sets the hops value of storeDataStuff to 1, leaving data stream untouched
list [key] [onSuccess=1] [onFail=1] [onEmpty=onSuccess] Return a list of storage keys based on a string. Wildcards are supported.
Return a list of storage keys based on a string. Wildcards are supported.
Name
Type
Description
key
String
[Optional] Key for which to compile the list.
onSuccess
Integer
[Optional, default = 1] Key for which to compile the list.
onFail
Integer
[Optional, default = 1] Key for which to compile the list.
onEmpty
Integer
[Optional, default = onSuccess] Key for which to compile the list.
list // list based on string from the data stream
list 1 2 // list based on string from the data stream, on failure jump 2 steps
list myFavorite // list all keys starting with 'myFavorite'
list myFavorite? // list all keys with 'myFavorite' and any character following it
list myFavorite['s','d'] // list all keys that are 'myFavorites' or 'myFavorited'
load [key] Retrieve a string value stored under key.
NOTE: When loading saved objects, pass them through jpar for object conversion.
Retrieve a string value stored under key.
NOTE: When loading saved objects, pass them through jpar for object conversion.
Name
Type
Description
key
String
[Optional] Key from which to retrieve data.
load
metakey Retrieve the storage metadata based on a key.
Retrieve the storage metadata based on a key.
Name
Type
Description
key
String
Key for which to get storage metadata.
meta myFavoriteColor // retrieve the meta data for myFavoriteColor
savekey [value=data] Store a key value pair. When value is an object, it will be stored as a string.
Store a key value pair. When value is an object, it will be stored as a string.
Name
Type
Description
key
String
Key under which to store data
value
Object
[Optional, default = data] Value to store
save storeDataStuff // saves the data stream variable under key storeDataStuff
save myFavoriteColor 'blue' // saves "blue" under key myFavoriteColor
save myFavoriteColor:${publicKey}:${signature} 'blue' // saves and signs "blue" under key myFavoriteColor, protecting the key-value
save myObject {key:'storeme'} // saves data "{key:\"storeme\"}" under key myObject
seek [key=data] [onFound=1] [onNotFound=1] Seek a storage key and jump on existence or not. Wildcards are supported.
Seek a storage key and jump on existence or not. Wildcards are supported.
Name
Type
Description
key
String
[Optional, default = data] Key for which to seek.
onFound
Integer
[Optional, default = 1] Steps to jump when key is found.
onNotFound
Integer
[Optional, default = 1] Steps to jump when key is not found.
seek 1 2 // seek key from the data stream, if found jump one step, else jump two steps
seek myFavoriteColor 1 2 // seek key 'myFavoriteColor', if found jump one step, else jump two steps
seek myFavorite 1 2 // seek key 'myFavorite', if for example 'myFavoriteColor' is found it jumps one step, else jump two steps
Transformers
codetarget [source='base256'] Change encoding of a string from one format to the other.
Change encoding of a string from one format to the other.
Name
Type
Description
target
String
Target encoding.
source
String
[Optional, default = 'base256'] Source encoding.
code bin // convert ASCII to binary - input: 'woot', returns: '1110111011011110110111101110100'
code utf8 base58 // convert UTF8 to base58 - input: 'this_is_my_data', returns: '4FtePA9kj2RpFH4tBkPUt'
code hex base58 // convert HEX to base58 - input: '8BA9C1B4', returns: '4a4JJF'
date [format='epoch'] [timestamp=''] Convert a date String and return it's Unix timestamp.
Convert a date String and return it's Unix timestamp.
Name
Type
Description
format
String
[Optional, default = 'epoch'] Specify the format for the date
timestamp
String
[Optional, default = ''] Specify 'now' to use the current time.
date // input 07-01-1985, output: '473904000' (The date/time epoch for January 7th 1985.)
date now // output: '1549468836' (The current date/time epoch.)
date 'yyyy-mm-dd hh:MM:ss' // input 07-01-1985, output: '1985-01-07 00:00:00' (Formatted date/time epoch for January 7th 1985.)
date 'yyyy-mm-dd hh:MM:ss' now // output: '2020-09-02 18:30:55' (Formatted current date/time.)
date epoch '1985-01-07' // output: '473904000' (Formatted date/time epoch for January 7th 1985.)
date 'isoUtcDateTime' // output: '2020-09-02T18:30:55Z' (ISO formatted current date/time.)
pack Compress and serialize data into an URL-safe format.
Compress and serialize data into an URL-safe format.
Name
Type
Description
pack // serializes and compresses the data stream into an URL-safe format
scantest [cumulative] [cinit=0] Scan through the values of an array or object, and return values that pass the test.
This method will filter out any non-numeric characters.
Scan through the values of an array or object, and return values that pass the test.
This method will filter out any non-numeric characters.
Name
Type
Description
test
String
Test to perform when scanning.
cumulative
String
[Optional] Cumulative operation.
cinit
Number
[Optional, default = 0] Initial value of cumulative counter.
tranpattern [success=1] [failure=1] Transforms data using a pattern definition.
Also for arrays and dictionaries of property paths.
Also for explicit primitive values.
Transforms data using a pattern definition.
Also for arrays and dictionaries of property paths.
Also for explicit primitive values.
Name
Type
Description
pattern
Object
A string or nested array/dictionary of strings containing:
explicit values (Example: "Hello")
property paths to test and pass prefixed with "." (Example: ".foo.bar")
expressions prefixed with "=" (Example: "=a+b", "=.foo.bar|default")
success
Number
[Optional, default = 1] Amount of instructions lines to jump on success.
failure
Number
[Optional, default = 1] Amount of instructions lines to jump on failure.
tran '.foo' 1 2 // input: {foo:"bar"} - passes "bar" to next
tran '.foo.bar[2]' 1 2 // input: {foo:{bar:[0,1,5]}} - passes 5 to next
tran '.foo.bar[2]' 1 2 // input: {foo:"bar"} - Jumps 2 instructions and passes {foo:"bar"}
tran ['.foo','.hello'] 1 2 // input: {foo:"bar",hello:"world"} - passes ["bar","world"] to next
tran {a:'.foo',b:'.hello',c:'test'} 1 2 // input: {foo:"bar",hello:"world"} - passes {a:"bar", b:"world", c:"test"} to next
tran '=.hello|default' 1 2 // input: {hello:"world"} - passes "world" to next, ignoring fallback value
tran '=.hello|default' 1 2 // input: {foo:"bar"} - passes "default" to next, using fallback value
tran '{}.a' 1 2 // input: {x:{a:1},y:{a:2}} - passes {x:1,y:2} to next, iterating through elements
tran '[].a' 1 2 // input: [{a:1},{a:2}] - passes [1,2] to next, iterating through elements
tran '[]{a:.a,b:2}' 1 2 // input: [{a:1},{a:2}] - passes [{a:1,b:2},{a:2,b:2}] to next, iterating through elements
tran '[][.a,.b]' 1 2 // input: [{a:1,b:2},{a:3,b:4}] - passes [[1,2],[3,4]] to next, iterating through elements
tran {c:'.a',d:'.b'}[] 1 2 // input: {a:[1,2,3], b:[4,5,6]} - passes [{c:1,d:4},{c:2,d:5},{c:3,d:6}] to next, zipping through elements
tran '[]=.a|null' 1 2 // input: [{a:1},{b:2}] - passes [1,null] to next, iterating through elements
tran '=[].a|null' 1 2 // input: [{a:1},{b:2}] - passes null to next, iterating through elements
tran '{:}' 1 2 // input: {x:{a:1},y:{a:2}} - passes ['x','y'] to next, effectively passing the key names only, iterating through elements
tran '{:}' 1 2 // input: {x:{a:1},y:{a:2}} - passes [{a:1},{a:2}] to next, effectively passing the values only, iterating through elements
tran '[].[this:thing]' 1 2 // input: {"this:thing":1,"y":2} - passes [1] to next, allowing for colon in key name
tran '[][.name, =size(.name), =atom(.value,true,2)] 1 2 // input: {"name":"yolo","value":1} - passes ["yolo",4,100] to next, iterating through elements and utilizing built-in atom and size functionality of tran
unpk [onSuccess=1] [onFailure=1] [parse=true] Deserialize and decompress data, jump on success or failure.
Deserialize and decompress data, jump on success or failure.
Name
Type
Description
onSuccess
Number
[Optional, default = 1] Amount of instructions lines to jump on success.
onFailure
Number
[Optional, default = 1] Amount of instructions lines to jump on success.
parse
Boolean
[Optional, default = true] Parse as json
unpk
Variables/Objects
copysourcetarget Copy a variable to another variable. The data stream is left untouched.
Copy a variable to another variable. The data stream is left untouched.
Name
Type
Description
source
String
Variable to copy.
target
String
Variable(s) to store copies in.
copy('variableA','variableB') // copy variableA to variableB
copy('variableA','variableB','variableC') // copy variableA to variableB and variableC
havepatternobjectDefinition [onExist] [onNotExist] Checks for data object to contain other objects.
Also for arrays and dictionaries of property paths, and for explicit primitive values.
Checks for data object to contain other objects.
Also for arrays and dictionaries of property paths, and for explicit primitive values.
Name
Type
Description
pattern
Object
A (or nested array/dicationary of) strings containing:
explicit values (Example: "Hello")
property paths to test and pass, prefixed with "." (Example: ".foo.bar")
expressions, prefixed with "=" (Example: "=a+b", "=.foo.bar|default")
objectDefinition
Object
The data object to check for.
onExist
Number
[Optional] Amount of instructions lines to jump on success.
onNotExist
Number
[Optional] Amount of instructions lines to jump on failure. Fails if not defined.
have 'foo' 3 2 // jumps 3 instructions if variable foo exists, two otherwise
have 'foo' // jumps 1 instruction if variable foo exists, fails otherwise
have '.foo' 1 2 // input: {foo:"bar"} : jumps 1 instruction
have '.foo.bar[2]' 1 2 // input: {foo:{bar:[0,1,5]}} : jumps 1 instruction
have myVar '.foo.bar[2]' 1 2 // myVar contains {apple:"pie"} : jumps 2 instructions
peek [key] [default] Gets data from a variable that was defined by poke. Used inside of other instructions.
Gets data from a variable that was defined by poke. Used inside of other instructions.
Name
Type
Description
key
String
[Optional] Variable name to get data from.
default
Object
[Optional] Fallback value in case result is undefined.
peek fee // returns value in recipe variable fee (non mutable, based on the recipe .json file)
peek userDefined // given that the recipe does not have property userDefined returns value in processor variable userDefined (runtime, non persistant)
peek proc::fee // returns value in processor variable fee (runtime, non persistant)
peek root::fee // returns value in process root parent variable fee (runtime, non persistant)
peek local::fee // returns value in recipe local variable fee (runtime, persisted in the .vars.json file)
peek btc::fee // returns value in btc recipe variable fee (non mutable, based on the recipe btc.json file)
peek btc::local::fee // returns value in btc recipe variable fee (based on the recipe .btc.vars.json file)
peek 2 // returns value of the second command path in the current process (non mutable)
peek [key1,key2,key3] // returns an array containing the values of key1,key2,key3
pokekey [value=data] [default] Put data in a variable for later use. Use peek to retrieve.
Put data in a variable for later use. Use peek to retrieve.
Name
Type
Description
key
String
Variable name to get data from.
value
String
[Optional, default = data] The data to store in the variable. This is also stored in this subprocess data field.
default
String
[Optional] Used if the value and stream data are undefined.
poke key // sets the stream value in processor variable key (runtime, non persistant)
poke key value // sets the value 'value' in processor variable key (runtime, non persistant)
poke proc::key value // sets value in processor variable key (runtime, non persistant)
poke local::key value // sets value in recipe local variable key (runtime, persisted in the .vars.json file)
poke ::key value // same as poke("local::key",value)
poke btc::fee // results in an error since fee is write protected
poke btc::local::fee // results in an error since fee is write protected
poke [key1,key2,key3] // sets the stream array value in processor variables key1, key2 and key3 (runtime, non persistant)
poke [key1,key2] [where,how] // sets variable key1 to 'where' and variable key2 to 'how'
poke {a:a,b:b} // sets the stream array value in processor variables key1, key2 and key3 (runtime, non persistant)
poke 2 // results in an error since the command paramters are write protected
poke local::key undefined // unsets/deletes a locally stored key
poke key $default1 ... $defaultn // sets value to first default that is defined
Misc
bankmethod [login] [login.username] [login.password] [login.publicKey] [login.secretKey] [login.accountFile] [login.importKey] [login.importKeyFile] [login.auth] [onSuccess=1] [onFailure] Banking functions to control hybrix accounts from Qrtz.
bank uses the hybrix-jslib methods to check balances, manage keys and perform transactions.
See https://api.hybrix.io/help/hybrix-jslib#reference for all methods.
Note: if you want to use deterministic transactions client-side, please use the
hybrix-jslib for this purpose.
For security, this command can only be used as sessionID root.
Banking functions to control hybrix accounts from Qrtz.
bank uses the hybrix-jslib methods to check balances, manage keys and perform transactions.
See https://api.hybrix.io/help/hybrix-jslib#reference for all methods.
Note: if you want to use deterministic transactions client-side, please use the
hybrix-jslib for this purpose.
For security, this command can only be used as sessionID root.
Name
Type
Description
method
String
The propertiesOrKey of the hybrix account.
login
Object
[Optional]
login.username
Object
[Optional] Use a username password pair to create a session
login.password
Object
[Optional] Use a username password pair to create a session
login.publicKey
Object
[Optional] Use a publicKey secretKey pair to create a session
login.secretKey
Object
[Optional] Use a publicKey secretKey pair to create a session
login.accountFile
Object
[Optional] Import username password object from a json file
login.importKey
Object
[Optional] Use a privateKey for the given asset to import directly instead of using a hybrix session
login.importKeyFile
Object
[Optional] Import privateKey from a file for the given asset to import directly instead of using a hybrix session
login.auth
Object
[Optional] Use {auth:node} to login with node keys. Requires permissions: {nodeKeys:true}
onSuccess
Int
[Optional, default = 1]
onFailure
Int
[Optional]
bank createAccount // create new account credentials
data {symbol:btc}
bank getBalance $login // Get the account balance of Bitcoin
data {symbol:nxt}
bank getPublicKey $login // Get the account public key of NXT
data {symbol:flo}
bank getSecretKey $login // Get the account secret/private key of Florincoin
data {symbol:eth}
bank getKeys $login // Get the account keys in an object of Ethereum
data {symbol:doge, amount: 0.1 target}
bank transaction $login // Send 0.1 Dogecoin to address $target
data {symbol:lsk, amount: 0.1 target}
bank rawTransaction $login // Return the raw transaction bytecode for sending 0.1 Lisk to address $target, without pushing it to the network.
bytedirectionvariablemethodparameter [code] Encoding and decoding data from/to a bitstream.
Encoding and decoding data from/to a bitstream.
Name
Type
Description
direction
String
'encode' or 'decode'
variable
String
the variable to read or write to when encoding or decoding respectively
method
String
The method used. 'fixed' for fixed data of size parameter. 'indexed' for storing the data length in a parameter sized index followed by the data. 'delimited' for storing the data delimited by the parameter. 'enum' for storing the index of an enum array.
parameter
Number | String | Array
paramer used for method
code
String
[Optional] the encoding of the data
data x
poke var
data ''
byte encode var fixed 10
curl [target=$host] [querystring=""] [method="GET"] [headers={}] [overwriteProperties={}] [onSuccess=1] [onFail=1] Use API queue to perform a curl call to an external host.
Use API queue to perform a curl call to an external host.
Name
Type
Description
target
String
[Optional, default = $host] A string containing on of the following options.
"[user[:password]@]host[:port]"
querystring
String
[Optional, default = ""] A string containing the querypath. Example: "/road/cars?color=red"
method
String
[Optional, default = "GET"] GET (default) ,POST or PUT.
headers
Object
[Optional, default = {}] HTTP headers passed to call.
overwriteProperties
Object
[Optional, default = {}] Properties to change the behaviour of curl.
retry: max nr of retries allowed
throttle: max amount of calls per second
timeout: timeout of a curl call in seconds
interval: try a new call if no response
user:
password:
proxy:
host:
rejectUnauthorized: Whether to reject TLS unauthorized errors. (Defaults to true.)
ignore404=false: whether to fail when receiving 404 status
ignoreError=false: whether to fail when receiving error status (<100 || >=300)
onSuccess
Integer
[Optional, default = 1] Amount of instructions lines to jump on success.
onFail
Integer
[Optional, default = 1] Amount of instructions lines to jump on failure.
qrtz [method] List all available methods (use call to call them) or the qrtz code for a given method
List all available methods (use call to call them) or the qrtz code for a given method
Name
Type
Description
method
String
[Optional] Method to inspect
qrtz
qrtz myMethod
routpath [host] [onSuccess=1] [onFailure] Route a path through hybrixd and pass the result to the next step. /api/help for API information.
Route a path through hybrixd and pass the result to the next step. /api/help for API information.
Name
Type
Description
path
String
Provide the routing path
host
String
[Optional] Provide the host, defaults to self, or object to set interval and host
onSuccess
String
[Optional, default = 1] Amount of steps to jump on success
onFailure
String
[Optional] Amount of steps to jump on failure
rout '/asset/dummy/balance/__dummyaddress__' // retrieve the balance for the dummy asset
rout '/asset/dummy/fee'