various things

feature/default_network_editable
kumavis 8 years ago
parent b7aab95519
commit a3330568d9
  1. 2
      library/controller.js
  2. 4
      library/example.sh
  3. 18
      library/example/index.js
  4. 2
      library/index.js
  5. 5
      library/server.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({

@ -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 ] ]

@ -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')

@ -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')

@ -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, {

Loading…
Cancel
Save