I want to be able to do some tasks repeatedly - they involve creating a contract and, once it is created, transfer some ether into it from a previous contract and various other things.
But it requires the contract to be mined, so that you get its address, and use that address for the subsequent operations.
You can daisy chain that from the geth console by nesting subsequent operations in the callback of the previous operation. You can see what I mean here:https://github.com/glynnbird/lottereum/blob/master/weekly_deploy_template.js
(at the bottom)
But then we wanted to put this on a cron to run every week so we created a bash script that did
geth --exec loadScript("weekly_deploy.js") attach
..but the problem is that it executes the first bit, i.e. send the contract to the blockchain (where it gets mined and everything), but it does not wait for the callback, so the rest of the execution does not happen.
Is there any way of creating a script that can be executed in such a way that it will wait for the "contract mined" callback and carry on executing?
Hope this makes sense!