Consensys / web3js-quorum

29 stars 21 forks source link

Failing url dependency in the browser #35

Open gomezgoiri opened 2 years ago

gomezgoiri commented 2 years ago

When I pass a privateUrl to the Web3Quorum constructor in the browser, the url dependency fails here.

I checked the dependencies of web3js-quorum and there is no "url" defined.

After checking my project's dependencies, I see that it react-scripts transitively adds url@0.11.0. This is probably not the dependency Web3Quorum should be using because it does not have any constructor (you should use Url.parse() instead).

I see different solutions:

peterkruty commented 2 years ago

Sorry unrelated request, but did you solved this? @gomezgoiri ? Also could you please post a short guide, how to build web3js-quorum for browser? Can't make it work.

gomezgoiri commented 2 years ago

Sorry, I was just testing web3js-quorum at that time and I ended up not using privateEndpoint (and therefore the ptm module).

Priv is enough for our solution, so I simply specify the endpoint of the Besu node (not GoQuorum) which talks to Tessera and use it like this:

const EEAClient = require("web3js-quorum")
...
const web3 = new EEAClient(new Web3(endpoint), chainId)
web3.priv.whatever()
peterkruty commented 2 years ago

Thanks!