opengsn / workshop

About A sample project to how how to add GSN to a simple Web3 project. See the PRs to see the needed changes. NOTE: the video was created for a previous version
https://youtu.be/tb4hkbofmou
GNU General Public License v3.0
32 stars 24 forks source link

Unable to start GSN #6

Closed ivanmmurciaua closed 2 years ago

ivanmmurciaua commented 2 years ago

Hi,

I try to make npx gsn start and returns me this error:

...
Naive Paymaster successfully funded, balance: 1
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at hash160 (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:249:21)
    at HDKey.set (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:50:24)
    at Function.HDKey.fromMasterSeed (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:194:20)
    at Function.EthereumHDKey.fromMasterSeed (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/ethereumjs-wallet/hdkey.js:20:26)
    at new KeyManager (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/@opengsn/relay/src/KeyManager.ts:60:26)
    at GsnTestEnvironmentClass._runServer (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/@opengsn/cli/src/GsnTestEnvironment.ts:174:31)
    at GsnTestEnvironmentClass.startGsn (/home/ivanmmurcia/Desktop/workshop-GSN/node_modules/@opengsn/cli/src/GsnTestEnvironment.ts:86:16)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /home/ivanmmurcia/Desktop/workshop-GSN/node_modules/@opengsn/cli/src/commands/gsn-start.ts:18:17 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

Manjaro Linux; Build ID: rolling 64 bits Truffle v5.6.0 (core: 5.6.0) Ganache v7.4.3 Solidity - 0.8.17 (solc-js) Node v18.10.0 Web3.js v1.7.4

albatros-github commented 2 years ago

in my case this command in the terminal before run gsn start worked:

export NODE_OPTIONS=--openssl-legacy-provider

but then when I use then relayhub address for funding the relayhub I get this error:

Error: VM Exception while processing transaction: reverted with reason string 'target is not a valid IRelayHub'

at WhitelistPaymaster.setRelayHub (@opengsn/contracts/src/BasePaymaster.sol:99)
ivanmmurciaua commented 2 years ago

Hi @albatros-github . My issue dissapeared just using Node 16 instead 19 with nvm use 16. I think this issue could be closed.

albatros-github commented 2 years ago

Hi @albatros-github . My issue dissapeared just using Node 16 instead 19 with nvm use 16. I think this issue could be closed.

hi @ivanmmurciaua did you setRelayHub in the local paymaster using gsn start without any problem?

I get this error: Error: VM Exception while processing transaction: reverted with reason string 'target is not a valid IRelayHub'

//SPDX-License-Identifier: MIT pragma solidity ^0.8.7;

import "@opengsn/paymasters/contracts/WhitelistPaymaster.sol"; import "@opengsn/contracts/src/RelayHub.sol";

const whitelistPaymaster = await ethers.getContract("WhitelistPaymaster", deployer) await whitelistPaymaster.setRelayHub(RELAY_HUB_ADDRESS_FROM_GSNStart);