Dear Diary Example "Blog Contract"
In this post, i will be creating a Blogging Contract meant for Diary Entries and posts of articles or News. Notice the use of "block.number" in this post as a way to see new blocks as they come in or get changed contract BlogAresh { address public owner; blog[] blogLogs; struct blog { string title; string headline; string content; string url; address owner; uint blocknumber; } uint counter; function BlogAresh() public { owner = msg.sender; counter = 1; blogLogs.push(blog("BlogAresh:", "My New Blog", "1.0","ethereumacademy.blogspot.com", owner, block.number)); } //anyone can add a post to the blog (multiple writers) function addPost(string title, string headline, string content, string link) public { blogLogs.push(blog(title, headline, content, link,msg.sender, block.number)); counter += 1; } ...