beignet icon indicating copy to clipboard operation
beignet copied to clipboard

Attempts to fix example app.

Open coreyphillips opened this issue 1 year ago • 2 comments

This PR:

  • Attempts to fix the example app. I still receive the following error when running npm run example. I expect it's from this PR @pwltr?:
Documents/testing/beignet ₿ npm run example   

> [email protected] example
> ts-node example

Syncing Wallet...
true
Unable to connect to Electrum server.
Error: Unable to connect to Electrum server.
    at err (/Users/coreyphillips/Documents/testing/beignet/src/utils/result.ts:76:18)
    at Wallet.connectToElectrum (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:659:14)
    at async Wallet.checkElectrumConnection (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:891:11)
    at async Wallet.updateAddressIndexes (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:1425:20)
    at async Wallet.refreshWallet (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:345:15)
    at async Function.create (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:272:4)
    at async runExample (/Users/coreyphillips/Documents/testing/beignet/example/index.ts:12:31)
Error: Unable to connect to Electrum server.
    at err (/Users/coreyphillips/Documents/testing/beignet/src/utils/result.ts:76:18)
    at Wallet.updateAddressIndexes (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:1426:35)
    at async Wallet.refreshWallet (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:345:15)
    at async Function.create (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:272:4)
    at async runExample (/Users/coreyphillips/Documents/testing/beignet/example/index.ts:12:31)
Error: Unable to connect to Electrum server.
    at err (/Users/coreyphillips/Documents/testing/beignet/src/utils/result.ts:76:18)
    at Wallet._handleRefreshError (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:379:45)
    at Wallet.refreshWallet (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:347:17)
    at async Function.create (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:272:4)
    at async runExample (/Users/coreyphillips/Documents/testing/beignet/example/index.ts:12:31)
Error: Unable to connect to Electrum server.
    at err (/Users/coreyphillips/Documents/testing/beignet/src/utils/result.ts:76:18)
    at Wallet._handleRefreshError (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:380:13)
    at Wallet.refreshWallet (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:347:17)
    at async Function.create (/Users/coreyphillips/Documents/testing/beignet/src/wallet/index.ts:272:4)
    at async runExample (/Users/coreyphillips/Documents/testing/beignet/example/index.ts:12:31)

Balance:  0

Address: bc1q5dlh3hys92e6rq92sqaz2qsrl98wmtvwc6expd
> Connection to Electrum Server lost, reconnecting...
  • Creates defaultGapLimitOptions & getDefaultGapLimitOptions.
  • Fixes linting errors.

coreyphillips avatar Jun 21 '24 19:06 coreyphillips

@coreyphillips The electrum peer for mainnet defined in example/helpers.ts is set to use EProtocol.ssl which is broken in nodejs enviroment after my last PR. I'm trying to fix it but not really sure how atm. Quick fix would be to connect to the peer via TCP instead.

pwltr avatar Jun 21 '24 23:06 pwltr

Gotcha. That's not a long-term viable solution though and probably shouldn't have been merged. We'll need to find a solution for it.

coreyphillips avatar Jun 22 '24 00:06 coreyphillips