Let $\hat{\mathfrak{g}} = L\mathfrak{g}\oplus \mathbb{C}K$ be the affine Lie algebra corresponding to a simple, finite-dimensional Lie algebra $\mathfrak{g}$. Many texts note that one can define the Serre relations
$$(ad E_i)^{1-{a}_{ij}}E_j=\sum_{n=0}^{1-{a}_{ij}}(-1^n)\binom{1-{a}_{ij}}{n}(E_i)^{1-{a}_{ij}-n}E_j (E_i)^n=0$$
and similarly for the generators $F_i$, where ${a}_{ij}$ denote the entries of the Cartan matrix. However, I have not yet found a reference that goes through with the actual computation of these relations. Does anyone know where I could find such a reference?