Client-side scripting

From Open Transactions
Revision as of 19:52, 11 June 2013 by Cryptoman (talk | contribs) (Created page with "The ot script interpreter ("ot") has access to the entire OT Client API, including the low-level ''and'' high-level APIs. In fact, the opentxs command-li...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The ot script interpreter ("ot") has access to the entire OT Client API, including the low-level and high-level APIs. In fact, the opentxs command-line tool itself is written in ot script, just like any other script.

To make your own OT script, create a text file, and chmod u+x filename in order to be able to run it as an executable. Then put this shebang at the top of the file: #!/usr/bin/env ot

Now you can run that file like any other executable, just type: ./filename and the script will execute as an OT client, with full access to the OT low-level API as well as the OT high-level API.

OT is easy! Even a trained monkey can write OT-based scripts and client applications! If you want to see how the high-level API is used, check out the code for the opentxs CLI tool for example functions demonstrating all of the OT functionality. (In fact, you can actually CALL all those functions from your own OT scripts.)

See also: Smart contracts