Guest User

Untitled

a guest
Feb 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. var subscription = web3.eth.subscribe('syncing', function(error, sync){
  2. if (!error)
  3. console.log(sync);
  4. })
  5. .on("data", function(sync){
  6. console.log(sync);
  7. })
  8. .on("changed", function(isSyncing){
  9. if(isSyncing) {
  10. console.log("changed");
  11. } else {
  12. console.log("changed to false");
  13. }
  14. });
  15.  
  16. geth --testnet --rpcapi "eth,web3, personal, accounts, miner, admin" --rpccorsdomain='*' --rpc --rpcaddr="0.0.0.0" --rpcport "8545" --ws --wsorigins="*" --wsaddr 0.0.0.0 --fast
  17.  
  18. let web3 = new Web3(new Web3.providers.HttpProvider("ws://geth:8546"));
  19.  
  20. "web3": "^1.0.0-beta.30"
Add Comment
Please, Sign In to add comment