Hopefully is an adverb in your excerpt, but it modifies the entire sentence rather than any individual word within it. It is an example of a disjunct, about which Brinton & Brinton (via LinguisticsGirl) say
Disjunct adverbials denote the attitude of the speaker toward or judgment of the proposition such as truthfulness of manner of speaking. …
The grammatical forms that can function as the disjunct adverbial in English grammar are the adverb phrase, prepositional phrase, and adverb clause.
More specifically, it is a sentence adverb, a common if sometimes disliked usage:
Unfortunately, the show ended late.
Thankfully, the kitchen is still open.
Obviously, we will order both desserts.
Oxford reports general suspicion of sentence adverbs in some quarters; some prefer to reword them— it is lucky that in place of luckily— and reject those which refer to the speaker's attitude, which cannot be reworded in this way (one cannot say it is frank that in place of frankly). That seems quite arbitrary, however. Clearly, such usage is widely accepted, and hopefully, you will not get caught up by misguided purists.