Public fog nodes can be deployed in public places closer to the edge where many personal and commercial devices (e.g., a sensor, an application, or a device) can connect to. These public fog nodes can provide real-time and localized services for networking, computing, storage and content delivery to the connected devices. The monetization and payment of such services is typically manual, centralized, and lacks the necessary trust. The providers of the public fog nodes typically offer fixed pricing models for their services, and the customers manually select and pay for the used services, with little or no transparency and trust in the provided service in terms of the used time, network bandwidth, and quality of service (QoS). This paper presents a novel scheme to enable blockchain-based monetization and automated payment in cryptocurrency for services provided by public fog nodes. The proposed scheme is decentralized, trustworthy, automated, and with certain guarantees for QoS, customer satisfaction, and dispute resolutions through a reputation system. The proposed solution uses the Ethereum blockchain and its native smart contract features to govern the interactions between devices and fog nodes. The proposed solution is implemented, tested and evaluated to show correct behavior and functionality. We also provide cost and security analysis and show that our solution is resilient against major security attacks. Our smart contract is made publicly available on Github 1 .