\documentclass[14pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{minted} % needs \begin{frame}[fragile]{}
\usetheme{Goettingen}
\input{solidity-highlighting.tex}

\addtobeamertemplate{navigation symbols}{}{%
	\usebeamerfont{footline}%
	\usebeamercolor[fg]{footline}%
	\hspace{1em}%
	\insertframenumber/\inserttotalframenumber
}

\lstdefinestyle{sol}
{
	language=Solidity,basicstyle=\tiny,numbersep=2pt
}

\AtBeginSection[]
{
	\begin{frame}
		\frametitle{Table of Contents}
		\tableofcontents[currentsection]
	\end{frame}
}

\begin{document}	
\author{Fabrizio Lazzaretti and Linus Basig}
\title{RNGG}
\subtitle{Random Number Guess Game \\The blockchain based game on Ethereum with Solidity and Angular}
%\logo{}
\institute{DSA Attestation\\
	University of Applied Sciences Rapperswil (HSR) \\
	University of Applied Sciences of Eastern Switzerland (FHO) \\
	Department of Computer Science}
\date{11. December 2019}
%\setbeamercovered{transparent}
%\setbeamertemplate{navigation symbols}{}
\begin{frame}[plain]
	\maketitle
\end{frame}

\section*{Introduction}
\begin{frame}
	\frametitle{The RNGG}
	\begin{columns}
		\column{0.6\textwidth}
		\begin{itemize}
			\item ethereum
			\item solidity
			\item web interface
			\item one parity node per user
		\end{itemize}
		\column{0.4\textwidth}
		\centering
		\includegraphics[width=1.8cm]{img/ethereum-logo}\\
		\includegraphics[width=1.8cm]{img/solidity-logo}\\
		\vspace{0.4cm}
		\includegraphics[width=3.5cm]{img/parity-logo}
	\end{columns}
\end{frame}

\begin{frame}
	\frametitle{Table of Contents}
	\tableofcontents
\end{frame}

\section{RNGG Contract}
\begin{frame}
	\frametitle{The RNGG Process}
	\centering
	\includegraphics[height=0.8\textheight]{../process.png}
\end{frame}

\begin{frame}
	\frametitle{The RNGG Process}
	\centering
	\huge
	What is the problem?
	\note<1>{Sending the secrete}
\end{frame}

\begin{frame}
	\frametitle{The RNGG Process}
	\centering
	\includegraphics[height=0.8\textheight]{../process.png}
\end{frame}

\subsection{Contract}
\begin{frame}[allowframebreaks]
	\frametitle{The Discovery Contract}
	\lstinputlisting[style=sol]{../contracts/random-guess.sol}
\end{frame}



\section{Application}
\begin{frame}
\frametitle{The Webapp}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{itemize}
			\item Angular 8
			\item RxJS for State Management
		\end{itemize}
		\column{0.5\textwidth}
		\hfill\includegraphics[width=1.7cm]{img/angular-logo}\hfill
		\includegraphics[width=1.5cm]{img/rx-logo}
	\end{columns}
\end{frame}

\begin{frame}
	\frametitle{src}
	\centering
	\includegraphics[width=0.4\linewidth]{img/src}
\end{frame}

\section{P2P Chat}
\begin{frame}
	\frametitle{The P2P Chat}
	\begin{itemize}
		\item peerjs as a webRTC wrapper
		\item smart contract for discovery
	\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{The Discovery Contract}
	
	\lstinputlisting[style=sol]{../contracts/signaling.sol}
	%\inputminted[fontsize=\tiny]{python}{../contracts/signaling.sol}
\end{frame}

\section{Testing}
\begin{frame}
	\frametitle{Test Setup}
	\begin{itemize}
		\item docker-compose
		\item deployment script
	\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{CI Testing}
	\begin{columns}
		\column{0.4\textwidth}
		\begin{itemize}
			\item GitLab CI
		\end{itemize}
	
		\column{0.6\textwidth}
		\includegraphics[width=\linewidth]{img/ci}
	\end{columns}
\end{frame}

\section{Demo}
\begin{frame}
	\frametitle{Demo setup}
	\centering
	\includegraphics[width=\linewidth]{img/monitoring}	
\end{frame}
\begin{frame}
	\frametitle{Demo: RNGG}
	\centering
	\includegraphics[width=\linewidth]{img/game-finished}	
\end{frame}

\section{Discussion}
\begin{frame}
	\frametitle{Discussion}
	\centering
	\begin{itemize}
		\item good test setup
		\item web3.js and parity is not stable
		\item webRTC signaling server is also not perfect
		\item rust for WASM was not possible
	\end{itemize}	
\end{frame}

\section*{Sources}
\begin{frame}
	\frametitle{Sources}
	\begin{itemize}
		\item Repository: \url{https://gitlab.com/block-game/angular-web3-smartcontract}
	\end{itemize}
\end{frame}



\end{document}