{"id":987,"date":"2017-05-04T00:09:05","date_gmt":"2017-05-04T00:09:05","guid":{"rendered":"http:\/\/www.talkcrypto.org\/blog\/?p=987"},"modified":"2018-03-07T04:15:52","modified_gmt":"2018-03-07T04:15:52","slug":"a-webpage-for-selling-energy-to-your-neighbour","status":"publish","type":"post","link":"https:\/\/www.talkcrypto.org\/blog\/2017\/05\/04\/a-webpage-for-selling-energy-to-your-neighbour\/","title":{"rendered":"A Webpage for Selling Energy to your Neighbour"},"content":{"rendered":"<p>It may seem like not a big deal but it&#8217;s the little things that count. I decided to build a simple webpage that displayed the same figures that could be seen on the command line but there was just something about the familiarity with seeing a webpage versus seeing a terminal screen.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-990 \" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.12.53-PM.png\" alt=\"\" width=\"616\" height=\"366\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.12.53-PM.png 901w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.12.53-PM-300x178.png 300w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.12.53-PM-768x456.png 768w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-991 size-full\" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.14.03-PM.png\" alt=\"\" width=\"506\" height=\"170\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.14.03-PM.png 506w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/Screen-Shot-2017-05-03-at-9.14.03-PM-300x101.png 300w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/p>\n<p>As you can see the values are the same but it added a bit more work. It was worthwhile though. The trick with getting a webpage to talk to the blockchain and display the information is to use javascript to create a connection to testrpc on port 8545 in this case and to contract address and update this each time you deploy the contract.<\/p>\n<p>The source code is available at https:\/\/github.com\/seandotau\/mpower where it should be self explanatory if you have some basic javascript skills.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It may seem like not a big deal but it&#8217;s<\/p>\n","protected":false},"author":1,"featured_media":988,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-987","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ethereum"],"featured_image_urls":{"full":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"thumbnail":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower-150x150.jpg",150,150,true],"medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower-300x177.jpg",300,177,true],"medium_large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"1536x1536":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"2048x2048":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"chromenews-featured":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"chromenews-large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false],"chromenews-medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2017\/05\/mpower.jpg",300,177,false]},"author_info":{"info":["seandotau"]},"category_info":"<a href=\"https:\/\/www.talkcrypto.org\/blog\/category\/ethereum\/\" rel=\"category tag\">Ethereum<\/a>","tag_info":"Ethereum","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/comments?post=987"}],"version-history":[{"count":1,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/987\/revisions"}],"predecessor-version":[{"id":992,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/987\/revisions\/992"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media\/988"}],"wp:attachment":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media?parent=987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/categories?post=987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/tags?post=987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}