The Tale of Genji, established at the end of the 10th century, was written by Murasaki Shikibu, a courtesan in the service of the Empress.
The Tale of Genji(『源氏物語』) is a long story with more than 500 characters. Most of them belong to the imperial family and the aristocratic upper classes. The names of those who belong to a higher class than themselves are not allowed to be mentioned, as it would be considered impolite. People in the stories are referred to by their official names or aliases.

source : The diary with illustration of Msurasaki Shikibu 『紫式部絵日記』 , Tokyo National Museum
The protagonist is called Hikaru Genji(光:hikaru, 源:gen or minamoto, 氏:ji or si) which is not his real name. Gen(源) or Minamoto(源) is a surname given to a prince or princess and his descendants who have descended from a vassal, and ji (氏) means clan.
The author of The Tale of Genji seems to have based some of the background of the story on the reign of Emperor Saga (嵯峨)(A.D. 786-842). Emperor Saga was the third emperor in the Heian period. The early Heian period was a time of political strife, and aristocrats competed to place their daughters in the imperial court, both as a sign of loyalty to the emperor and for the future power of the family. Emperor Kammu(桓武:The first Emperor of Heian period,) and Emperor Saga, had especially queens and many concubines of noble. Emperor Saga is said to have had 23 princes. Of these, 17 princes whose mothers were not of high status descended from their vassals and received the surname of Minamoto(源). They were given one-character names, for example, 源-明, 源-弘, and so on. (Usually they were given two-character names.)

Kyoto Imperial Palace:京都御所, 京都フリー写真素材
Therefore, both the people of the time and we associate the name ‘Hikaru Gen-ji(光源氏)’ with the prince of Emperor Saga. His real name may have been Minamoto Hikaru(源光), and so on.
The story goes on to say that the protagonist was called Hikaru Genji because of his luminous appearance. His real name is not revealed until the end.