2017-01-14 23:11:43 +00:00
|
|
|
EmbarkJS
|
|
|
|
========
|
|
|
|
|
|
|
|
EmbarkJS is a javascript library meant to abstract and facilitate the
|
|
|
|
development of DApps.
|
|
|
|
|
|
|
|
**promises**
|
|
|
|
|
|
|
|
methods in EmbarkJS contracts will be converted to promises.
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
var myContract = new EmbarkJS.Contract({abi: abiObject, address: "0x123"});
|
2017-07-13 21:54:28 +00:00
|
|
|
myContract.get().then(function(value) { console.log("value is " + value.toNumber()) });
|
2017-01-14 23:11:43 +00:00
|
|
|
|
|
|
|
**deployment**
|
|
|
|
|
|
|
|
Client side deployment will be automatically available in Embark for
|
|
|
|
existing contracts:
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
2017-03-11 09:07:34 +00:00
|
|
|
SimpleStorage.deploy([args], {options}).then(function(anotherSimpleStorage) {});
|
2017-01-14 23:11:43 +00:00
|
|
|
|
|
|
|
or it can be manually definied as
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
var myContract = new EmbarkJS.Contract({abi: abiObject, code: code});
|
2017-03-11 09:07:34 +00:00
|
|
|
myContract.deploy([args], {options}).then(function(anotherMyContractObject) {});
|
|
|
|
|
|
|
|
so you can define your gas as
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
myContract.deploy([100, "seconde argument"], {gas: 800000}).then(function(anotherMyContractObject) {});
|