Skip to content

Getting started


Get the Ledger code from Git.

Full initial installation and build instructions are here.


cd into build folder.

Run make etch.


cd into apps/etch.

Run ./etch with filename, flags, and arguments:

./etch [options] <filename> -- [script args].

For example:

./etch hello-world.etch -data test.json.

This runs the hello-world.etch file and produces a json file containing info on the data required by the contract.

Etch playground

You can run all the examples in these docs in the etch playground here as well as on the command line.

Hello world!

Compile and run a single etch file

Let’s run our first etch program.

Create a new file in the etch directory and save it as hello-world.etch.

Add the following code:

function main()

    printLn("Hello world!");


Save the file.

Run ./etch hello-world.etch.

You should see the following output:

$ ./etch hello-world.etch
 F E      etch v0.1.0-23-gd7622f98
   T C     Copyright 2018-2019 (c) Fetch AI Ltd.

Hello world!

Compile and run two or more etch files

It is possible to compile and run two or more etch files in one go.

The files are not order dependent and the single main() function can be in any of the files.

For example, run ./etch file-1.etch file-2.etch file-n.etch.