Function Programmable Optical Network has been recently proposed to enhance flexibility on optical transport based on Architectureon-Demand (AoD). The flexible synthesis of optical node architectures provided by AoD enables an open and disaggregated optical layer thanks to the available deep programmability. However, previous studies focus on how to synthesize a single node out of switching function blocks neglecting the optical signal-to-noise ratio (OSNR) impact, power imbalance effects due to diverse set of devices traversed per input-output configuration and network-wide implications. In this work, we present Optical Network-wide Function Synthesis (ONetFuS), an algorithm to compose AoD nodes that considers placement and configuration of both switches and amplifiers. ONeFuS minimizes OSNR degradation and deviation across channels and offers enhanced power balance performance. Moreover, ONetFuS addresses multiple-node scenarios to investigate cascading, transmission distance, and networking effects. We compare the number of optical crossconnections computed by our proposal against solutions in the literature. Results in network scenarios including number of components, power balance, OSNR variations and OSNR penalty reductions, prove the suitability of our proposed ONetFuS for Open and Function Programmable Optical Networks.