Author

Topic: Smart Contract: WeatherForecastAtLocation (Read 372 times)

member
Activity: 95
Merit: 11
July 26, 2016, 01:16:25 PM
#5
Summary

  • Contract ( v0.5.9 ) is deployed, at address 0x0c5c4bc449808eee712b1d0858e2b12e71410c8e
  • Oracle eventlogloop is listening to its events, and uploads weather data whenever a location is "topped up"
  • and it updates the forecasts every 24 hours, as long as there is a positive locationBalance
  • Contract ABI is published as contract.js for easy import into console.
  • Contract tools.js help you to interact with it, on the JavaScript console  gsoil attach.
  • and most importantly:

    YOU CAN TRY OUT THE QUICKSTART MANUAL NOW.


Perhaps this is even your first interaction with a real, live, working, innovative SMART CONTRACT ever?  Exciting times ...

I have fully tested the preparations and the quickstart manual on a fresh droplet, but please report any issue.


you can tweet this image:
member
Activity: 95
Merit: 11

Manual03: HyperQuick-Start

Start gsoil & gsoil console. Load scripts:
Code:
gsoil
gsoil attach

loadScript('useful/addpeers.js')
loadScript("contract/contract.js")
loadScript("contract/tools.js")

TOP UP LOCATION --> wait your and oracle's TX --> ASK FORECAST

Code:
city =   "q=Nanjing,China"
getForecast_message(city)

PRICE
tx = topUpLocation(city, 3); txReceipt = waitForTxReceipt(tx)

admin.sleepBlocks(1); getForecast_message(city)

getForecast(city)
getForecast(city, timestamp_now_plus_hours(24))
getForecast(city, timestamp_now_plus_hours(24 * 3.5))

getForecast_message(city, timestamp_now_plus_hours(24 * 4.5))

Step-by-step explanations in the quickstart manual.

member
Activity: 95
Merit: 11

Manual02: Prepare your system

  • Windows vs Linux, VPS
  • Install Soil
  • Clone/download repo
  • Correct folder
  • Add peers
  • What is the JavaScript console, with examples
  • Languages: Solidity + JavaScript/Python
  • Python via RPC, with examples & gsoil-starterscripts (BAT / sh)

https://github.com/drandreaskrueger/weathercontract_user/blob/master/manual/manual02-preparations.md

Please tell me if you run into any problems.
member
Activity: 95
Merit: 11

Text01: Introduction

TOC:
        Why Weather?
        Ecologically oriented "smart contracts" - why weather?
        How to make blockchains aware of the real world, and: a warning!
        Oracles
        Oracle contract: "WeatherForecastAtLocation"
        Nowcasting
        Money talks
        You're next
        Components


Read it in HTML, or PDF: view or download.

Please give feedback. Thanks.
member
Activity: 95
Merit: 11
Smart Contract: WeatherForecastAtLocation

Code:

Novel smart contract solution for Ethereum based platforms, here: SOIL.  
On-chain delivery of weather forecasts, for any mapped location on Earth.

User-paid request selects location - an oracle answers to that event.
Then 1 nowcast, and 4 forecasts can be read by anyone, for 4 days.


In the following posts, I am going to present more about this project, step-by-step.
Reposts from the SOIL thread, to keep everything about this big project in one place.

Is this your first interaction with a real, live, non-financial SMART CONTRACT ever?
Let us together learn what we can about the "world computer". Exciting times ...

  • post 1: Introduction
  • post 2
  • post 3
  • post 4
Jump to: