diff options
various things
Diffstat (limited to 'library')
-rw-r--r-- | library/controller.js | 2 | ||||
-rwxr-xr-x | library/example.sh | 4 | ||||
-rw-r--r-- | library/example/index.js | 18 | ||||
-rw-r--r-- | library/index.js | 2 | ||||
-rw-r--r-- | library/server.js | 5 |
5 files changed, 10 insertions, 21 deletions
diff --git a/library/controller.js b/library/controller.js index 90d849d20..24b841f5e 100644 --- a/library/controller.js +++ b/library/controller.js @@ -4,11 +4,9 @@ const handleRequestsFromStream = require('web3-stream-provider/handler') const Streams = require('mississippi') const ObjectMultiplex = require('../app/scripts/lib/obj-multiplex') -console.log('yes, this is iframe') initializeZeroClient() - function initializeZeroClient() { var provider = ZeroClientProvider({ diff --git a/library/example.sh b/library/example.sh deleted file mode 100755 index 09389d404..000000000 --- a/library/example.sh +++ /dev/null @@ -1,4 +0,0 @@ -# run 2 servers and make sure they close together - -beefy frame.js:bundle.js 9001 --live -- -t [ babelify --global --presets [ es2015 ] ] & -beefy example/index.js:bundle.js index.js:zero.js --cwd example/ 9002 --live --open -- -t [ babelify --global --presets [ es2015 ] ]
\ No newline at end of file diff --git a/library/example/index.js b/library/example/index.js index bdde2b47f..91d2237c2 100644 --- a/library/example/index.js +++ b/library/example/index.js @@ -5,24 +5,24 @@ function web3Detect() { if (global.web3) { document.body.innerHTML += 'web3 detected!' console.log('web3 detected!') + startApp() } else { document.body.innerHTML += 'no web3 detected!' console.log('no web3 detected!') } - startApp() } -var primaryAccount = null -web3.eth.getAccounts(function(err, addresses){ - if (err) throw err - console.log('set address') - primaryAccount = addresses[0] -}) - - function startApp(){ console.log('app started') + var primaryAccount = null + console.log('getting main account...') + web3.eth.getAccounts(function(err, addresses){ + if (err) throw err + console.log('set address') + primaryAccount = addresses[0] + }) + document.querySelector('.action-button-1').addEventListener('click', function(){ console.log('saw click') console.log('sending tx') diff --git a/library/index.js b/library/index.js index c98035106..6e43181c9 100644 --- a/library/index.js +++ b/library/index.js @@ -6,9 +6,7 @@ const setupProvider = require('./lib/setup-provider.js') // var provider = setupProvider() -console.log('debugger point A') hijackProvider(provider) -console.log('debugger point B') var web3 = new Web3(provider) web3.setProvider = function(){ console.log('MetaMask - overrode web3.setProvider') diff --git a/library/server.js b/library/server.js index c7fea085f..6da9b2e0b 100644 --- a/library/server.js +++ b/library/server.js @@ -12,8 +12,6 @@ const appBundle = createBundle('./example/index.js') // Iframe Server // -// beefy frame.js:bundle.js 9001 --live -- -t [ babelify --global --presets [ es2015 ] ] - const iframeServer = express() // serve controller bundle @@ -31,8 +29,6 @@ iframeServer.listen('9001') // Dapp Server // -// beefy example/index.js:bundle.js index.js:zero.js --cwd example/ 9002 --live --open -- -t [ babelify --global --presets [ es2015 ] ] - const dappServer = express() @@ -64,6 +60,7 @@ function createBundle(entryPoint){ plugin: [watchify], }) + // global transpile var bablePreset = path.resolve(__dirname, '../node_modules/babel-preset-es2015') bundler.transform(babelify, { |