dapphub / dapple

EVM contract system developer multitool
GNU General Public License v3.0
298 stars 59 forks source link

javascript deploy scripting #275

Open SilentCicero opened 8 years ago

SilentCicero commented 8 years ago

love dapplescript but... we should really have a simple deploy scripting module I can run that is just JS. Like so:

module.exports = function(deploy, contracts){
    deploy(contracts.SimpleStore, someParam, someOtherParam).then(function(instance){
         var getSomeStoredValue = instance.get();
         // do JS stuff
         deploy(contracts.SimpleStoreServiceThing, someParam, instance.address)... 
    });
};
mhhf commented 8 years ago

hmm, why do you think this is needed as a dapple feature? you can always load the build/classes.json file into a custom js file and write your own deployment with web3/pudding this is also part of my workflow

mhhf commented 8 years ago

This is an excerpt of a build/test.js test project:

var Web3 = require('web3');
var classes = require('./classes.json');
var Pudding = require("ether-pudding");
var web3 = new Web3();
Pudding.setWeb3(web3);

web3.setProvider(new Web3.providers.HttpProvider("http://localhost:8545"));
web3.eth.defaultAccount = web3.eth.coinbase;

// deploy library
var A = Pudding.whisk({
  abi: JSON.parse(classes.A.interface),
  binary: classes.A.bytecode
});

A.new({gas: 3141592}).then(function(a) {
...
SilentCicero commented 8 years ago

@mhhf right now I'm thinking this is the best way to go, but I would assume that what ever dapplescript can do, it can be done in a JS module that is lightly abstracted. And thus, why invent your own language when JS would work just fine. I'm just saying, let me use the dapplescript tech/abstraction, but let me do it in JS as an option

mhhf commented 8 years ago

The magic of dapplescript is happening here and is used here. I can come up with accessors for for those so writing js scripts will be easier. Also I abandoned dapplescript as a whole. There will be a huge replacement for it in the v0.8 version along with dapple-chain.

Lets move the talks about this feature after the v0.8 release, in case there still will be a need for js based deployment scripting

SilentCicero commented 8 years ago

@mhhf sounds great, super happy with the design approach here. Carry on =D