Decentralized trading schemes involving energy prosumers have prevailed in recent years. Such schemes provide a pathway for increased energy efficiency and can be enhanced by the use of blockchain technology to address security concerns in decentralized trading. To improve transaction security and privacy protection while ensuring desirable social governance, this paper proposes a novel twostage blockchain-based operation and trading mechanism to enhance energy hubs connected with integrated energy systems (IESs). This mechanism includes multi-energy aggregators that use a consortium blockchain and its enabled proof-of-work to transfer and audit transaction records, with social governance principles for guiding prosumers' decision-making in the peer-to-peer (P2P) transaction management process. The uncertain nature of renewable generation and load demand are adequately modeled in the two-stage Wassersteinbased distributionally robust optimization. The practicality of the proposed mechanism is illustrated by several case studies that jointly show its ability to handle an increased renewable generation capacity, achieves a 16.7% saving in the audit cost, and facilitates 2.4% more P2P interactions. Overall, the proposed two-stage blockchain-based trading mechanism provides a practical trading scheme and can reduce redundant trading amounts by 6.5%, leading to a further reduction of the overall operation cost. Compared to the state-of-the-art benchmark methods, our mechanism exhibits significant operation cost reduction and ensure social governance and transaction security for an IES and energy hubs.