> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monad.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Running the example program on live data, and next steps

If you're following this guide in order, you should have already built one
of the example programs (in [C](/execution-events/getting-started/c) or [Rust](/execution-events/getting-started/rust)), ran it with a
[snapshot file](/execution-events/getting-started/snapshot), and installed your own local
[Monad node](/execution-events/getting-started/setup-node).

Now we'll run the example program again, but this time it will print the
real-time events published by our local Monad node.

## Running with live data

### Step 1: preparing the Monad node

Before running, make sure the execution daemon is running and that
[execution events are enabled](/node-ops/events-and-websockets).
in particular, make sure you have passed the command line argument
`--exec-event-ring` to the execution daemon

### Step 2: run the example program

In the snapshot example, we passed the name of the snapshot file to the
program as a command line argument. In both the C and Rust example programs,
if we do not pass any filename at all, it will use default filename used by
the execution daemon, connecting us to the live event stream.

* For C, run `eventwatch` with no arguments

* For Rust, run the command `cargo run -- -d`

You will see similar data to the snapshot case, but as it is being published
by execution. If you stop the execution daemon, the example program will
detect that the source of data is gone, and exit.

## Next steps

This completes the getting started guide! If you're interested in developing
your own real-time data processing software with the SDK, where should
you go from here?

Here is a recommended list of resources, in roughly the order that will be
most helpful in developing real applications:

1. If you haven't already, read the [overview](/execution-events/overview) and the
   source code for the example program you just ran

2. Once you understand the basic ideas in the example,
   [the rest of the SDK documentation](/execution-events#execution-events-documentation)
   should be easy to follow

3. Before using the SDK, make sure you understand the
   [consensus events](/execution-events/consensus-events) and what they
   mean

4. Try out a more sophisticated program and look at the source code for it

   * For Rust, try the "Block Explorer" TUI example in the upstream
     [`monad`](https://github.com/category-labs/monad/tree/release/exec-events-sdk-v1.1/rust/crates/monad-exec-events/examples/explorer.rs)
     repository. You can run it with
     `cargo run -p monad-exec-events --example explorer` and then browse the
     source code in `explorer.rs`

   * For C, look at the code for the `monad-event-cli` program in the upstream
     [`monad`](https://github.com/category-labs/monad/tree/release/exec-events-sdk-v1.1/category/event/tools/event-cli)
     repository; this program is the "tcpdump" of the execution event system,
     and shows several different uses of the API. You may also want to read
     the next section about compiling this program

## Optional: build the `monad-event-cli` tool

`monad-event-cli` is a useful utility for working with the event system. Like
the Rust `eventwatch` example, it can decode execution event payloads into
human-readable form. It does several other tasks which are useful in the
developer workflow, e.g., recording captures of events and creating snapshot
event ring files for test cases.

<Warning>
  `monad-event-cli` requires gcc 15.2 or higher, and will not build with gcc
  15.1. Currently, the only Ubuntu release that ships with gcc 15.2 in its package
  repositories is Ubuntu 25.10, which was recently released at the time this
  guide was written.

  If your Linux distribution does not provide gcc 15.2 and you do not want to
  install it manually, you can instead use clang-19 (or more recent) but *using
  libc++ instead of libstdc++*. The default on Linux is for clang to use the gcc
  C++ standard library (libstdc++).

  If you specify `-stdlib=libc++` it will use the LLVM standard library instead,
  which has the needed `<format>` support. You may have to install it, since in
  some distributions it is not part of the clang package. In Ubuntu, the clang-19
  libc++ runtime and development packages will be added when you install
  `libc++-19-dev`.

  When using libc++-19, you must also specify the `-fexperimental-library`
  compiler flag to enable C++20 time zone support in `<chrono>`; the event CLI
  tool uses this for printing the event timestamp in local time. In some future
  version of libc++ this will no longer be needed.
</Warning>

To build `monad-event-cli`, you will also need the
[CLI11](https://github.com/CLIUtils/CLI11)
C++ command-line parser library and the OpenSSL development files. Although it
is optional, you should also install the development files for
[GNU multiple-precision library](https://gmplib.org/)
so that `uint256` values print in decimal form.

The instructions also use the
[ninja](https://ninja-build.org/)
build tool. You can install everything on Ubuntu with:

```
$ sudo apt install libcli11-dev libssl-dev libgmp-dev ninja-build
```

Now clone the
[execution repository](https://github.com/category-labs/monad.git) and
check out the branch `release/exec-events-sdk-v1.1`, then build the CMake
project rooted at `category/event`.

Using clang-19 with libc++ and the above options:

```shell theme={null}
$ git clone -b release/exec-events-sdk-v1.1 https://github.com/category-labs/monad.git \
  ~/src/monad-event-cli
$ CC=clang-19 CFLAGS="-march=x86-64-v4" \
  CXX=clang++-19 CXXFLAGS="-stdlib=libc++ -fexperimental-library -march=x86-64-v4" cmake \
  -S ~/src/monad-event-cli/category/event -B ~/build/monad-event-cli-v1.1-release -G Ninja \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMONAD_EVENT_BUILD_CLI=ON
$ cmake --build ~/build/monad-event-cli-v1.1-release
```

You should now be able to run:

```shell theme={null}
$ ~/build/monad-event-cli-v1.1-release/monad-event-cli --help
```

<Note>
  The `-march=x86-64-v4` is needed to enable certain atomic operations at the
  CPU instruction level, to avoid needing to link with libatomic.a; without this,
  a performance warning is emitted, which becomes a compilation error due to
  `-Werror`
</Note>

To simplify running cmake with all these settings, you might want to create a
CMake toolchain file instead of using environment variables. To do this, create
a file called `clang19-libcxx.cmake` with these contents:

```CMake theme={null}
set(CMAKE_C_COMPILER clang-19)
set(CMAKE_CXX_COMPILER clang++-19)
set(CMAKE_ASM_FLAGS_INIT -march=x86-64-v4)
set(CMAKE_C_FLAGS_INIT -march=x86-64-v4)
set(CMAKE_CXX_FLAGS_INIT "-march=x86-64-v4 -stdlib=libc++ -fexperimental-library")
```

Now can you run this slightly cleaner command:

```shell theme={null}
$ cmake --toolchain <path-to-toolchain-file> -S ~/src/monad-event-cli/category/event \
  -B ~/build/monad-event-cli-v1.1-release -G Ninja \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMONAD_EVENT_BUILD_CLI=ON
```
