Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.
This repository was archived by the owner on May 24, 2022. It is now read-only.

Light.js not working with Infura #51

@mjdietzx

Description

@mjdietzx

Hey, been playing around with Light.js a bit, It's really awesome - really speeds up our DApp and simplifies the code! running into a problem with Infura though (MetaMask web3 provider is working well)

web3jsInfura = new Web3(new Web3.providers.WebsocketProvider('wss://mainnet.infura.io/ws'));
light.setProvider(web3jsInfura.currentProvider);

import { makeContract, withoutLoading } from "@parity/light.js"; the failures i'm seeing below are from reading state from a contract

ie

myContract.variable$()
          .pipe(
            withoutLoading()
          )
          .subscribe(r => {
            console.log('variable', r);
          });

screen shot 2018-11-22 at 10 46 39 am

if i setup provider as in docs:

light.setProvider( Api.Provider.Ws('wss://mainnet.infura.io/ws') );

screen shot 2018-11-22 at 10 57 13 am

Thanks,
Mike

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions