Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Secret Open Source Mist release :)

Pre-release
Pre-release
Compare
Choose a tag to compare
@frozeman frozeman released this 16 Nov 14:41
· 1797 commits to master since this release

This release is intended for DApp Developers only.

Run Mist, browse to your dapp and press the plus to add it to the sidebar.

Your have three options to use (or replace) the pre-loaded web3 object:

// 1. Simply use web3 from mist
web3

// 2. Use web3 from mist, OR load if outside of mist
if(typeof web3 === 'undefined')
  web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

// 3. Use your own web3, but the provider from mist ("Web3" won't be supplied by Mist)
if(typeof web3 !== 'undefined')
  web3 = new Web3(web3.currentProvider);
else
  web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

Note the mist object is currently not provided in browse mode. So press the + button in the upper right corner first, so it gets added to the sidebar. Then you can use mist.web3Provider!

Note2 Also checkout the Mist API: https://github.com/ethereum/mist/blob/master/MISTAPI.md

Note3 Use web3.eth.isSyncing to prevent your dapp from getting frozen on syncs (when a bunch of blocks are imported)