\documentclass[c]{beamer}

%\usepackage{helvet}
\usepackage{calc}
\usepackage[utf8]{inputenc} % set your input encoding differently, if you want
\usepackage[english]{babel}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage{fancyvrb}
\usepackage{enumitem}
\usepackage{eurosym}
\usepackage{tikz}
\usepackage{pgfgantt}
\usepackage{amsmath,amssymb}
\usetikzlibrary{shapes,arrows,fit}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usepackage[absolute,overlay]{textpos}

%\setbeameroption{show notes}

\setlist[itemize]{label=$\bullet$}


\def\checkmark{\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}

\setbeamertemplate{navigation symbols}{}
%\setbeamercovered{transparent=10}
\setbeamertemplate{navigation symbols}{\url{taler.net}}
%\setbeamertemplate{section in toc}[sections numbered]

% Adapt title information
% =======================
\title{GNU Twister \\ Easy C instrumentation and programmable proxy}
\institute{Taler Systems SA}
\author{Christian Grothoff ({\tt christian@grothoff.org}) \\
  Marcello Stanisci ({\tt stanisci.m@gmail.com})}

\date{10.9.2018}

% Some common packages
% ====================
\usepackage{units}
\usepackage{amsbsy}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphics}
\usepackage{epsf}
\usepackage{epsfig}
\usepackage{fixmath}
\usepackage{wrapfig}


\usetikzlibrary{snakes}


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\begin{frame}
  \frametitle{Overall architecture}

  % Overall architecture where Twister applies:
  % HTTP client, HTTP server, REST API,
  % focus on JSON as interchange format

  \begin{center}
    \includegraphics[width=0.66\textwidth]{Whole.png}
  \end{center}

\end{frame}

\begin{frame}[fragile]
  \frametitle{HTTP proxy}

  % Twister HTTP proxy (between client and server)

  \begin{center}
    \includegraphics[width=0.66\textwidth]{Whole-NoDriver.png}
  \end{center}

  \begin{Verbatim}[fontsize=\tiny]
  # twister.conf

  [twister]
  # listens here
  HTTP_PORT = 8888
  # forwards there
  DESTINATION_BASE_URL = http://localhost:8080
  ..
  \end{Verbatim}

\end{frame}

\begin{frame}[fragile]
  \frametitle{Driving it}

  % Test driver (below) controlling client,
  % twister and server to drive test execution

  \begin{center}
    \includegraphics[width=0.66\textwidth]{Whole-NoClientServer.png}
  \end{center}

  \begin{columns}[T,onlytextwidth]
    \begin{column}{.5\textwidth}
      \begin{minipage}{\textwidth}
        \begin{Verbatim}[fontsize=\tiny]
        # twister.conf

        [twister]
        # Control channel.
        UNIXPATH = /tmp/taler-service-twister.sock
        ..
        \end{Verbatim}
      \end{minipage}
    \end{column}
    \begin{column}{.5\textwidth}
      \begin{minipage}{\textwidth}
        \begin{Verbatim}[fontsize=\tiny]
          # CLI

          $ taler-twister -c twister.conf \
                          --flip-ul=child.one
        \end{Verbatim}
      \end{minipage}
    \end{column}
  \end{columns}

\end{frame}

\begin{frame}[fragile]
  \frametitle{Driving it (Libtalertwister)}

  % libtalertwister: control API examples (giving Twister commands
  % to twist next request/response)

  \begin{textblock*}{2cm}(7cm,1cm)
    \includegraphics[scale=0.09]{Whole-NoClientServer.png}
  \end{textblock*}

{\tiny
\begin{lstlisting}[language=C,basicstyle=\footnotesize,keywordstyle=\color{blue}]
#include <taler/taler_twister_service.h>

handle = TALER_TWISTER_connect (CONFIG);

/* Issue char-flipping command */
TALER_TWISTER_flip_upload (handle,
                          "child.one",
                          &callback,
                          NULL);
// ...
TALER_TWISTER_disconnect (handle);
\end{lstlisting}
}
\end{frame}

\end{document}
