  The mechanism accelerating cosmic rays in the Milky Way Galaxy and galaxy
clusters is identified and described. The acceleration of cosmic rays is a
purely electrostatic process which operates up to the maximum energies of
$10^{23}$ eV in galaxy clusters. Galactic cosmic rays are accelerated in a
pervasive electrostatic field active in the whole Galaxy except in restricted
regions shielded by interstellar and stellar plasmas as, for instance, the
region occupied by the solar system. It is proved that the energy spectrum of
the cosmic radiation in the Milky Way Galaxy, in the region where the solar
system resides, has a constant spectral index comprised between 2.64-2.68 and
the maximum energies of Galactic protons are $3.0 \times 10^{19}$ eV. The
agreement of these results with the experimental data is discussed in detail
and underlined. The various physical processes that maintain the stability of
the electrostatic structure in the Milky Way Galaxy are the same that generate
the Galactic magnetic field. Accordingly, the intensity, orientation and
direction of the Galactic magnetic field are evaluated. The results of the
calculation are compared with the observational data, optical and mostly radio
astronomy data. The accord of the intensity, orientation and direction of the
observed magnetic field with calculation is excellent.
