The adoption of blockchain in various industries is gaining more popularity, especially in the energy industry. With the increase of distributed energy resources (DER), energy users can generate, store, and trade their resources with others. Utility companies or energy users are influenced by blockchain-based peer-To-peer (P2P) energy trading markets. Blockchain adds transparency and immutability to the involved transactions. Smart contracts in blockchain automatically execute when the conditions are met without any third-party intervention. Motivated by these benefits, in this paper an energy trading framework is developed using Ethereum smart contracts. Energy users can trade their excess energy or buy energy using the smart contract functions. Smart contract written in solidity is compiled and deployed using remix with injected metamask provider. Ganache is used to create accounts and these accounts are imported to metamask for signing transactions. We also discuss alternative methods for smart contract deployment. Computational cost analysis is performed by evaluating the gas consumption analysis for the smart contract functions.