  We consider a microscopic model of spacetime, where spacetime is assumed to
be a specific graph with Planck size quantum black holes on its vertices. As a
thermodynamical system under consideration we take a certain uniformly
accelerating, spacelike two-surface of spacetime which we call, for the sake of
brevity and simplicity, as {\it acceleration surface}. Using our model we
manage to obtain an explicit and surprisingly simple expression for the
partition function of an acceleration surface. Our partition function implies,
among other things, the Unruh and the Hawking effects. It turns out that the
Unruh and the Hawking effects are consequences of a specific phase transition,
which takes place in spacetime, when the temperature of spacetime equals, from
the point of view of an observer at rest with respect to an acceleration
surface, to the Unruh temperature measured by that observer. When constructing
the partition function of an acceleration surface we are forced to introduce a
quantity which plays the role of thermal energy of the surface. An
interpretation of that quantity as energy in a normal manner yields Einstein's
field equation with a vanishing cosmological constant for general matter
fields.
