Ethereum Sandbox Client
The module is a client for Ethereum Sandbox.
Installation
$ npm install ethereum-sandbox-client
Example
var Sandbox = ;var sandbox = 'http://localhost:8555'; sandboxstart { if err return console; console; console; sandbox;};
Mocha-test with the client:
var fs = ;var assert = ;var solc = ;var Sandbox = ; ; { return StringfromCharCode;} { if strlength % 2 !== 0 console; var lastNonZeroByte = 0; for var i = strlength - 2; i >= 2; i -= 2 if str !== '0' || str !== '0' lastNonZeroByte = i; break; return str;} { if strlength % 2 !== 0 console; var arr = ; for var i = 0; i < strlength; i += 2 var code = ; // Ignore non-printable characters if code > 9 arr; return arr;} { var input = {}; files; return solc;}
Also, there're tests for the DAO.
API
new Sandbox(url)
Create a new object which is able to run a sandbox on Sandbox Container with the specified URL.
sandbox.start([config,] cb)
Start a new sandbox in Sandbox Container. The client checks if there is a running Sandbox Container on the specified in the constructor URL. If not and if the URL points to localhost it runs Sandbox Container.
If config is specified, it is used as a config for the new sandbox. Otherwise the client uses ethereum.json
in the project directory.
cb
is a callback function (function(err) {
) which is called when sendbox has been started.
sandbox.stop(cb)
Stop the started sandbox.
cb
is a callback function (function(err) {
) which is called when sandbox has been stopped.
sandbox.web3
Web3 object which is connected to the started sandbox.