Difference between revisions of "Client-side scripting"

From Open Transactions
Jump to navigation Jump to search
(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...")
 
m (fixed API link)
 
Line 3: Line 3:
 
To make your own OT script, create a text file, and <code>chmod u+x filename</code> in order to be able to run it as an executable. Then put this shebang at the top of the file: <code>#!/usr/bin/env ot</code>
 
To make your own OT script, create a text file, and <code>chmod u+x filename</code> in order to be able to run it as an executable. Then put this shebang at the top of the file: <code>#!/usr/bin/env ot</code>
  
Now you can run that file like any other executable, just type: <code>./filename</code> and the script will execute as an OT client, with full access to the OT [[API|low-level API]] as well as the OT [[Use Cases|high-level API]].
+
Now you can run that file like any other executable, just type: <code>./filename</code> and the script will execute as an OT client, with full access to the [[API|OT 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 [https://github.com/FellowTraveler/Open-Transactions/blob/master/scripts/ot/ot_commands.ot 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.)
 
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 [https://github.com/FellowTraveler/Open-Transactions/blob/master/scripts/ot/ot_commands.ot 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]]
 
See also: [[Smart contracts]]

Latest revision as of 11:43, 15 June 2013

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 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