Testing Prebuilt ENI Operations

See Testing ENI Operations for more details.

Test Prebuilt Shared Libraries

Here we demonstrate how to test the ENI operation built from our examples and tools with the CLI tools eni_gas and eni_run.

Test “eni_reverse.so” (examples/eni/reverse)

eni_gas ${LIBENI_PATH}/lib/eni_reverse.so reverse '["Hello World!"]'
eni_run ${LIBENI_PATH}/lib/eni_reverse.so reverse '["Hello World!"]'

The first call eni_gas will output 12, and the second one eni_run will output [“!dlroW olleH”].

Test “eni_crypto.so” (tools/eni_crypto)

Get the JSON files for testing from the directory test/t0004.

eni_gas ${LIBENI_PATH}/lib/eni_crypto.so rsa_encrypt "$(cat pub_encrypt.json)"
eni_run ${LIBENI_PATH}/lib/eni_crypto.so rsa_encrypt "$(cat pub_encrypt.json)"
eni_gas ${LIBENI_PATH}/lib/eni_crypto.so rsa_decrypt "$(cat priv_decrypt.json)"
eni_run ${LIBENI_PATH}/lib/eni_crypto.so rsa_decrypt "$(cat priv_decrypt.json)"

Output for the above lines.

["An encrypted hex-string that is 512 characters in length."]
["Hello World!"]

Test “eni_scrypt.so” (tools/eni_scrypt)

eni_gas ${LIBENI_PATH}/lib/eni_scrypt.so scrypt '["00"]'
eni_run ${LIBENI_PATH}/lib/eni_scrypt.so scrypt '["00"]'

Output for the above lines.