Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 at https://relay.get-scatter.com/app/connect/nodejs_env #181

Open
batrudinych opened this issue Oct 12, 2020 · 0 comments
Open

404 at https://relay.get-scatter.com/app/connect/nodejs_env #181

batrudinych opened this issue Oct 12, 2020 · 0 comments

Comments

@batrudinych
Copy link

batrudinych commented Oct 12, 2020

I'm trying to get scatter working in node.js. I was working with scatterjs-core and scatterjs-plugin-eosjs2 packages before and now moved to @scatterjs/core and @scatterjs/eosjs2

I've modified the example under [email protected] to work in node.js and simplified it a bit. There are a few things I have to add to have it working: introduce globally accessible window object, introduce window.fetch.

However, the request to https://relay.get-scatter.com/app/connect/nodejs_env fails with 404 now and I'm wondering if there is a way I could get scatterjs working in node.js at all. The latest code version swallows the error and reports with false on connect.

const fetch = require('node-fetch')

window = global
global.fetch = fetch

let ScatterJS = require('@scatterjs/core')
if (ScatterJS.default) {
  ScatterJS = ScatterJS.default
}

let ScatterEOS = require('@scatterjs/eosjs2')
if (ScatterEOS.default) {
  ScatterEOS = ScatterEOS.default
}
ScatterJS.plugins(new ScatterEOS())

async function main () {
  console.log('connecting')
  const connected = await ScatterJS.connect('AppName')
  if (!connected) throw new Error('not connected')
}

main().catch(console.error).finally(() => process.exit())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant