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

Portable versions of explorer? #29

Open
username1565 opened this issue Sep 28, 2019 · 16 comments
Open

Portable versions of explorer? #29

username1565 opened this issue Sep 28, 2019 · 16 comments

Comments

@username1565
Copy link

username1565 commented Sep 28, 2019

I try to install your explorer https://github.com/wavesplatform/WavesExplorerLite
but I see some error after trying to start command

yarn install

after this try to run

node-sass

Here is the partial log:

yarn install v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check.
Excluding it from installation.
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check.
Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠄ node-sass
...

then I see this errors.

This need Python27 in folder C:\\Python27\\python.EXE.
I just try the command

npm install --global windows-build-tools

And I see Python27 folder then,
but yarn install cann't compile and stop with errors after node-sass - step.

UPD: Trying this again with administrative privelegies - stop after python27 found...
Then, try:

npm rebuild node-sass

And got fail... Errors...

I see some files was been added in /node_modules/ folder.
And I see too many errors, while i try to do compilation of this.


Also, I tried to install this old block-explorer: https://github.com/wavesplatform/WavesExplorerLite/tree/old-explorer
But this don't working too. Some variable is undefined there, inside fs.js.

Do you have portable versions of this explorers, in zip-archive, without need to any installation?
Maybe you can add node.js portable and python portable, there, inside zip, no?

@beregovoy68
Copy link
Contributor

Hi

I've never tried to build Explorer on Windows. I don't see any error messages in console logs that you provided. Could you specify what errors do you see?

To be able to help, I need to understand what you're going to do. Please describe your use case in more detail.

If you just need to run Explorer locally, you can use this docker image https://hub.docker.com/r/wavesplatform/explorer

Cheers

@username1565
Copy link
Author

username1565 commented Sep 30, 2019

Hi, @beregovoy68!

There is some errors with node.js, and module node-sass...
This is the problem on my side because the command

npm install --global windows-build-tools

cann't be finished,
and the command

npm rebuild node-sass

cann't be finished too.
This node-sass is runned after run yarn start, and I see this commands in your docker image.
So I don't think this image can help me, really.

But, I see this required python27.EXE,
and maybe you didn't write
some additional dependencies in the guide for building.

Also, i think, will be better to you just make a full package, including python and node.js,
without any dependencies, and make this explorer - portable.
Or just sharing the already compiled and builded cross-platform version.

@tsigel
Copy link

tsigel commented Oct 1, 2019

Hi, @username1565! What the version of node u use?
Check support of your version nodejs here.

@username1565
Copy link
Author

username1565 commented Oct 1, 2019

Hi, @tsigel. Thanks for your info!

I see, my node version is:

>node -v
v12.3.1

There, by your link, I see:

NodeJS Node 12 | node-sass 4.12+

So I just did update node-sass:

>WavesExplorerLite-master>npm install -global node-sass
...
Testing binary
Binary is fine
+ node-sass@4.12.0
updated 1 package in 7.196s

Then, just

>yarn install
yarn install v1.17.3
...

And after slow process of linking 40966 dependendies...
this sucessfully finished:

yarn install v1.17.3
warning package-lock.json found. Your project contains lock files generated by t
ools other than Yarn. It is advised not to mix package managers in order to avoi
d resolution inconsistencies caused by unsynchronized lock files. To clear this
warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check.
Excluding it from installation.
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check.
Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 683.23s.

Then

>yarn start
...
success!
And I see the working block-explorer by http://localhost:8080

Then...
Ctrl+C, and exit...


Try to build old wavesblockexplorer from this branch, in another folder...

>cd folder_path_for_unpacked old wavesblockexplorer...
>npm install -g gulp-cli
+ gulp-cli@2.2.0
updated 1 package in 14.29s

Try to install block-explorer:

>npm install
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core
.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wavesplatform-core-js@git://github.com/wavesplatform/wave
splatform.core.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall scrip
t.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MyUser\AppData\Roaming\npm-cache\_logs\2019-10-01T09_31_54
_972Z-debug.log

in log...

...
7 info using npm@6.0.1
8 info using node@v12.3.1
...

And... I saw this warnings earlier:

npm WARN npm npm does not support Node.js v12.3.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10
, 11.

Then I did try to install gulp-cli in old wavesblockexplorer folder:

>npm install gulp-cli
...
the same errors...

I see from this logs, npm version is deprecated, so I did try update npm

>npm update
...
the same errors...

Because updating try in the wavesblockexplorer folder.

Try update npm - globaly:

>npm update -global
...
+ npm@6.11.3
added 305 packages from 154 contributors, removed 557 packages and updated 56 pa
ckages in 381.582s

Then, try upgrade global:

>npm upgrade -global
Just empty string...

Then...

>npm install
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core
.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wavesplatform-core-js@git://github.com/wavesplatform/wave
splatform.core.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall scrip
t.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MyUser\AppData\Roaming\npm-cache\_logs\2019-10-01T09_49_07
_617Z-debug.log

What there is in that 2019-10-01T09_49_07_617Z-debug.log??

...
2 info using npm@6.11.3
3 info using node@v12.3.1
...
708 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
709 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
710 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
710 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
710 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
710 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
711 verbose stack Error: wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall: `bower install`
711 verbose stack Exit status 1
711 verbose stack     at EventEmitter. (C:\Users\MyUser\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
711 verbose stack     at EventEmitter.emit (events.js:200:13)
711 verbose stack     at ChildProcess. (C:\Users\MyUser\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
711 verbose stack     at ChildProcess.emit (events.js:200:13)
711 verbose stack     at maybeClose (internal/child_process.js:1021:16)
711 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
712 verbose pkgid wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070
713 verbose cwd G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer
714 verbose Windows_NT 6.3.9600
715 verbose argv "G:\\nodeJS\\nodejs\\node.exe" "C:\\Users\\MyUser\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
716 verbose node v12.3.1
717 verbose npm  v6.11.3
718 error code ELIFECYCLE
719 error errno 1
720 error wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall: `bower install`
720 error Exit status 1
721 error Failed at the wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core.js.git#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall script.
721 error This is probably not a problem with npm. There is likely additional logging output above.
722 verbose exit [ 1, true ]

All pathways, seems like correct, but error after try to take something from git.
That means, maybe something need to change on your side.
And maybe this info for current wavesexplorer - not for THIS OLD http://wavesblockexplorer.com/

@beregovoy68
Copy link
Contributor

Hi @username1565,

If you want to build an old Explorer, you also need to install bower.
npm install -g bower - to install bower globally
npm install - to install Explorer dependencies
gulp build - to build testnet version of old explorer

Please give it a try and let me know if it worked or not.

@username1565
Copy link
Author

Hi, @beregovoy68!

Try to install bower:

>npm install -g bower
npm WARN deprecated bower@1.8.8: We don't recommend using Bower for new projects
. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy
 project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
C:\Users\MyUser\AppData\Roaming\npm\bower -> C:\Users\MyUser\AppData\Roaming\npm
\node_modules\bower\bin\bower
+ bower@1.8.8
added 1 package from 1 contributor in 31.577s

Success!

Then, try to install old wavesblockexplorer:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm install

> wavesplatform-core-js@git://github.com/wavesplatform/wavesplatform.core.js.git
#a9ffce1804de6965bd8789f814ffd722e2a99070 postinstall G:\coins\WAVES_FULL_NODE\N
EW_NODE\WavesExplorerLite-old-explorer\node_modules\wavesplatform-core-js
> bower install

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

added 1 package and audited 2310 packages in 50.887s
found 33 vulnerabilities (3 low, 2 moderate, 28 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Then, try npm audit:

>npm audit
See long list...

Try to fix vulnerabilities:

>npm audit fix
found 9 vulnerabilities (3 low, 6 high) in 2330 scanned packages
  8 vulnerabilities require semver-major dependency updates.
  1 vulnerability requires manual review. See the full report for details.

Now, I don't see moderated vulnerabilities, and this seems, like installed.

After this all, I did try to build old wavesblockexplorer:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>gulp build

But i see the following error:

fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
←[90m    at fs.js:27:26←[39m
    at req_ (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer\no
de_modules\←[4mnatives←[24m\index.js:143:24)
    at Object.req [as require] (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerL
ite-old-explorer\node_modules\←[4mnatives←[24m\index.js:55:10)
    at Object. (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-o
ld-explorer\node_modules\←[4mgraceful-fs←[24m\fs.js:1:37)
←[90m    at Module._compile (internal/modules/cjs/loader.js:774:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10
)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:641:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:681:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:16:16)←[39m

Building process was been failed.

Then, I did try to install gulp locally, in the wavesblockexplorer folder:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm install gul
p
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher
 to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher
 to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compa
tibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and
 will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably ha
rmless): EPERM: operation not permitted, rmdir 'G:\coins\WAVES_FULL_NODE\NEW_NOD
E\WavesExplorerLite-old-explorer\node_modules\fsevents'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

+ gulp@3.9.1
updated 1 package and audited 2330 packages in 11.699s
found 9 vulnerabilities (3 low, 6 high)
  run `npm audit fix` to fix them, or `npm audit` for details

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>

After this I did try to install gulp-cli locally, in the wavesblockexplorer folder:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm install gulp-cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

+ gulp-cli@2.2.0
added 47 packages from 33 contributors and audited 5322 packages in 21.101s
found 9 vulnerabilities (3 low, 6 high)
  run `npm audit fix` to fix them, or `npm audit` for details

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>

And then, i just try to build again - the same error:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>gulp build
fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
←[90m    at fs.js:27:26←[39m
    at req_ (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer\no
de_modules\←[4mnatives←[24m\index.js:143:24)
    at Object.req [as require] (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerL
ite-old-explorer\node_modules\←[4mnatives←[24m\index.js:55:10)
    at Object. (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-o
ld-explorer\node_modules\←[4mgraceful-fs←[24m\fs.js:1:37)
←[90m    at Module._compile (internal/modules/cjs/loader.js:774:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10
)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:641:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:681:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:16:16)←[39m

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>

All this says about there is some problem, inside scripts.

@username1565
Copy link
Author

username1565 commented Oct 1, 2019

I just did try to find in google this error:

fs.js:27
const { Math, Object } = primordials;

And I see here, this is error in gulp.

And for node v12 need to install gulp 4+
When I did install gulp-cli, gulp 2.2.0 was been installed:

>npm -g install gulp-cli
...
+ gulp-cli@2.2.0
updated 1 package in 6.013s

So I did update gulp on the node:

>npm -g install gulp
...
+ gulp@4.0.2
added 314 packages from 217 contributors in 61.535s

After this, I just did try to install old block explorer, and this seems, like installed:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm install
...
added 595 packages from 349 contributors and audited 2310 packages in 139.201s
found 33 vulnerabilities (3 low, 2 moderate, 28 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Also, there is used already installed bower too, so you can add bower to requirements...

After this, I did try to fix vulnerabilities:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm audit fix
npm WARN rollback Rolling back node-pre-gyp@0.12.0 failed (this is probably harm
less): EPERM: operation not permitted, rmdir 'G:\coins\WAVES_FULL_NODE\NEW_NODE\
WavesExplorerLite-old-explorer\node_modules\fsevents\node_modules'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

+ morgan@1.9.1
+ bootstrap@3.4.1
+ gulp-order@1.2.0
added 2 packages from 6 contributors, removed 5 packages and updated 10 packages
 in 26.2s
fixed 24 of 33 vulnerabilities in 2310 scanned packages
  1 vulnerability required manual review and could not be updated
  2 package updates for 8 vulnerabilities involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm aud
it` for steps to fix these manually)

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm audit fix -
-force
npm WARN using --force I sure hope you know what you are doing.

> fsevents@1.2.9 install G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old
-explorer\node_modules\fsevents
> node install

+ gulp@4.0.2
+ gulp-watch@5.0.1
added 181 packages from 112 contributors, removed 34 packages, updated 34 packag
es and moved 12 packages in 55.28s
fixed 8 of 9 vulnerabilities in 2330 scanned packages
  1 vulnerability required manual review and could not be updated
  2 package updates for 8 vulnerabilities involved breaking changes
  (installed due to `--force` option)

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>

Then, I just show the info about manually fixing 1 vulnerabilitie:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm audit
                       === npm audit security report ===
                                 Manual Review
             Some vulnerabilities require your attention to resolve
          Visit https://go.npm.me/audit-guide for additional guidance
  Low             Regular Expression Denial of Service
  Package         braces
  Patched in      >=2.3.1
  Dependency of   gulp-watch [dev]
  Path            gulp-watch > anymatch > micromatch > braces
  More info       https://npmjs.com/advisories/786
found 1 low severity vulnerability in 9625 scanned packages
  1 vulnerability requires manual review. See the full report for details.
G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>

Then, I did try to build, and see another error:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>gulp build
assert.js:362
    throw err;
    ^

AssertionError [ERR_ASSERTION]: Task function must be specified
    at Gulp.set [as _setTask] (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLi
te-old-explorer\node_modules\←[4mundertaker←[24m\lib\set-task.js:10:3)
    at Gulp.task (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explor
er\node_modules\←[4mundertaker←[24m\lib\task.js:13:8)
    at Object. (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-o
ld-explorer\gulpfile.js:126:6)
←[90m    at Module._compile (internal/modules/cjs/loader.js:774:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10
)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:641:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:681:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:16:16)←[39m
    at execute (C:\Users\MyUser\AppData\Roaming\npm\node_modules\←[4mgulp←[24m\n
ode_modules\←[4mgulp-cli←[24m\lib\versioned\^4.0.0\index.js:36:18) {
  generatedMessage: ←[33mfalse←[39m,
  code: ←[32m'ERR_ASSERTION'←[39m,
  actual: ←[33mfalse←[39m,
  expected: ←[33mtrue←[39m,
  operator: ←[32m'=='←[39m
}

But, here, in your guide, I see old block-explorer can be runned locally, without building:

Run locally
npm install
node server.js
Open http://localhost:3000 in browser. You'll see testnet version of explorer.

Then I did try to do it:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>npm install
audited 9625 packages in 4.174s
found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>

And after this, i just did try to start it, but see an error:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>node server.js
internal/fs/utils.js:461
    throw err;
    ^

Error: ENOENT: no such file or directory, stat 'G:\coins\WAVES_FULL_NODE\NEW_NOD
E\WavesExplorerLite-old-explorer\build\favicon.ico'
←[90m    at Object.statSync (fs.js:840:3)←[39m
    at resolveSync (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-expl
orer\node_modules\←[4mserve-favicon←[24m\index.js:187:17)
    at favicon (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer
\node_modules\←[4mserve-favicon←[24m\index.js:61:12)
    at Object. (G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-o
ld-explorer\server.js:19:9)
←[90m    at Module._compile (internal/modules/cjs/loader.js:774:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10
)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:641:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m
←[90m    at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)←[39m

←[90m    at internal/main/run_main_module.js:17:11←[39m {
  errno: ←[33m-4058←[39m,
  syscall: ←[32m'stat'←[39m,
  code: ←[32m'ENOENT'←[39m,
  path: ←[32m'G:\\coins\\WAVES_FULL_NODE\\NEW_NODE\\WavesExplorerLite-old-explor
er\\build\\favicon.ico'←[39m
}

After read this error carefully, I see some files does not exists in /build folder,
so I just did rename /src-folder to /build-folder, and try to start it again.
I see server is listening the port 3000:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>node server.js
Server listening on port 3000

Go to http://localhost:3000/ and see this:
old_explorer 1

...
Ctrl+C
...
Exit...

Don't know what to do now...


Maybe, you need to change the folder name from src to build, in your repositary,
or just pathway to this folder in some file, no?
Also, maybe, you need to fix something to correct working this explorer, like here: https://wavesblockexplorer.com/
not like on my screen.
And also, maybe, there is possible to install this, using already installed yarn?

@username1565
Copy link
Author

username1565 commented Oct 1, 2019

I just did try to build this, using pre-installed yarn, using yarn install:

yarn install v1.17.3
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by t
ools other than Yarn. It is advised not to mix package managers in order to avoi
d resolution inconsistencies caused by unsynchronized lock files. To clear this
warning, remove package-lock.json.
[1/4] Resolving packages...

... many ... packages ... + resolving over 8000 dependendies...

warning gulp-inject-version > gulp-util@3.0.8: gulp-util is deprecated - replace
 it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac
5
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check.
Excluding it from installation.
[3/4] Linking dependencies...
[-----------------------------------------------------------------------] 0/8087
...

warning gulp-inject-version > gulp-util@3.0.8: gulp-util is deprecated - replace
 it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac
5
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check.
Excluding it from installation.
[3/4] Linking dependencies...
...

[4/4] Building fresh packages...
success Saved lockfile.
Done in 309.74s.

Then I see yarn.lock file there, and after this, I did try to yarn start:

G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>yarn start
yarn run v1.17.3
$ node server.js
Server listening on port 3000

by localhost:3000 the same error, invalid page.

Server log seems like server is working good:

GET / 304 4.454 ms - -
GET /icons/logo.png 304 1.460 ms - -
GET /icons/github.png 304 1.679 ms - -
GET /icons/twitter.png 304 0.546 ms - -
GET /icons/fb.png 304 1.484 ms - -
GET /icons/waves.png 304 0.967 ms - -
GET /?q= 304 0.957 ms - -
GET /icons/logo.png 304 0.632 ms - -
GET /icons/github.png 304 1.028 ms - -
GET /icons/twitter.png 304 0.686 ms - -
GET /icons/fb.png 304 0.953 ms - -
GET /icons/waves.png 304 1.279 ms - -
Завершить выполнение пакетного файла [Y(да)/N(нет)]?
^C
G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer>exit
exit

When I tried to open http://localhost:3000/ I saw previous posted screen,
and I don't see working old block-explorer like this: https://wavesblockexplorer.com/
But sometimes, I saw this picture when I did try to visit https://wavesblockexplorer.com/,
and this picture was been showed only short time, then redirect to working block-explorer, or updating this info by loading html-elements...
But in my case, I don't see working block-explorer... Maybe because I did rename /src folder to /build-folder... WTF? What should I do? ЧЯДНТ?

@username1565
Copy link
Author

username1565 commented Oct 5, 2019

I just got success for compile current and old waves-explorers.

Earlier, I did already try to do npm rebuild node-sass,
and before this I did npm install node-sass
and node-sass (plus node-gyp together with this) was been installed, locally, in the folder node_modules.
But after that success compilation, and after removing that folder, new compilation was been failed, and global installed node-sass run the PowerShell, with some errors from the module gyp.
So I did compile new wavesexplorer again,
with the following consecutive actions:

Win+R -> cmd.exe
>G:
>cd G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-master\WavesExplorerLite-master
>yarn add node-sass
...(linking 42245 dependencies)
>yarn install
...very fast done.
>yarn start
...see working wavesexplorer.

As you can see, node-sass was been added not globally, and here is not using gulp.
Moreover, before this, I did remove gulp and node-sass globally:

G:\coins\WAVES_FULL_NODE\NEW_NODE>yarn global remove gulp-cli
yarn global v1.17.3
[1/2] Removing module gulp-cli...
[2/2] Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.
Done in 9.26s.

G:\coins\WAVES_FULL_NODE\NEW_NODE>yarn global remove node-sass
yarn global v1.17.3
[1/2] Removing module node-sass...
[2/2] Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.
Done in 1.40s.

And then, I didn't saw switching cmd to PowerShell, after yarn install starting this locally-installed node-sass.
Also, the command yarn add node-sass working before (sic!) yarn add gulp-cli (not global),
and you can add this command - in Readme.md.

I still cann't using gulp for test your published commands, because there is some errors, and I don't know correct version to install. What version did you use, can you tell?


The old wavesblockexplorer was been compiled after some edits and modifications...
Earlier, I saw on http://localhost:3000/ the result, as there is on the picure, here.
So I just did go to https://wavesblockexplorer.com/ and see source code of this page.
I see in src/index.html there is some empty injections in two different places.
After fill this correctly, and add the scrypts and styles, this block-explorer may be working and opening good.

One more fix was been at line 11 I just did change the directory:
change from '/build' to '/src' in server.js

var basedir = __dirname + '/src';

Then...

Win+R -> cmd.exe
G:
cd G:\coins\WAVES_FULL_NODE\NEW_NODE\WavesExplorerLite-old-explorer\WavesExplorerLite-old-explorer
yarn install
...many links...
...done
yarn start
...done. listening port and opening...

I'm not sure, my compiled old block-explorer is working with node directly, because through that scripts, it can loading some info from wavesblockexplorer.com.
But this is working.
So you can test, and fix this code yourself.
Maybe, you can make another repositary (not archive-branch),
and then, perhaps this block-explorer, which normally WORKING IN OLD BROWSERS, it will be developed by community, in the future.

Anyway, right now, you can add the missing files and correct pathways, for correct compilation and working of this.

Best Regards.


UPD:
Yes, I see in this config, there is specified another node: https://waves.guarda.co
and this is specified in two places.
I see Swagger there, and there is hosted the Node REST API.
So this links can be changed to http://127.0.0.1:6869, where the Node REST API is hoste locally, and then old wavesblockexplorer is working, even in LAN, when the Internet is disconnected. I see GET requests in the console of the runned node.

Also, I did try to connect compiled wavesexplorer to my local node, but I have no success. Failed to load blockchain data.
Hm... Maybe need to change something else,
but I saw GET requests in the console of runned node too.

@username1565
Copy link
Author

username1565 commented Oct 19, 2019

Bump! Need to add some files in the source code to make old blockexplorer working, after installation.

@username1565
Copy link
Author

How to disable CORS for wavesexploerlite? After building, this not working, and there is some errors in console, about CORS not allowed on the server.

@beregovoy68
Copy link
Contributor

Could you specify which headers you see in responses from a Waves public node? In particular, what values you get in header access-control-allow-origin?

@username1565
Copy link
Author

username1565 commented Nov 6, 2019

When I try to open https://wavesexplorer.com/ I just see

Failed to load blockchain data.

I see on the network-tab an XHR-queries to the following URL of yandes:

https://mc.yandex.ru/webvisor/53131930?wmode=0&rn=725905599&page-url=https%3A%2F%2Fwavesexplorer.com%2F&wv-type=3&wv-hit=72077252&wv-part=23&browser-info=ti%3A8%3Aet%3A1573047723%3Aw%3A1349x150%3Av%3A1731%3Az%3A120%3Ai%3A20191106153854%3Ast%3A1573047725%3Au%3A1569664403854019259%3App%3A3629563401

and this is the headers of this requests:

General:
Request URL: https://mc.yandex.ru/webvisor/53131930?wmode=0&rn=1063212086&page-url=https%3A%2F%2Fwavesexplorer.com%2F&wv-type=0&wv-hit=72077252&wv-part=5&wv-check=62065&force-urlencoded=1&browser-info=ti%3A1%3Av%3A1731%3Az%3A120%3Ai%3A20191106153854%3Arqnl%3A1%3Ast%3A1573047674%3Au%3A1569664403854019259%3App%3A3629563401
Request Method: POST
Status Code: 200 OK
Remote Address: 87.250.250.119:443
Referrer Policy: no-referrer-when-downgrade

Response headers:
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: https://wavesexplorer.com
Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
Connection: keep-alive
Content-Length: 43
Content-Type: image/gif
Date: Wed, 06 Nov 2019 13:40:49 GMT
Expires: Wed, 06-Nov-2019 13:40:49 GMT
Last-Modified: Wed, 06-Nov-2019 13:40:49 GMT
Pragma: no-cache
Server: nginx/1.14.2
Strict-Transport-Security: max-age=31536000
X-XSS-Protection: 1; mode=block

Request headers:
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Connection: keep-alive
Content-Length: 108
Content-Type: text/plain;charset=UTF-8
Cookie: yandexuid=9724682881569664422; i=mFvVSmFU+qTsnNKAX/JDItNzG0GvtnpsdNm0Nj7rAG0ThZl7q87+sAkFBltZsuIPtMTK0E0HKfXYGXsCB5UYvptu7R4=; yp=1885024422.yrts.1569664422#1885024422.yrtsi.1569664422; _ym_uid=157227276939536973; _ym_d=1572272769; mda=0; bltsr=1; yabs-sid=962657401573034373
Host: mc.yandex.ru
Origin: https://wavesexplorer.com
Referer: https://wavesexplorer.com/
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Query String Parameters:
wmode: 0
rn: 1063212086
page-url: https://wavesexplorer.com/
wv-type: 0
wv-hit: 72077252
wv-part: 5
wv-check: 62065
force-urlencoded: 1
browser-info: ti:1:v:1731:z:120:i:20191106153854:rqnl:1:st:1573047674:u:1569664403854019259:pp:3629563401
wv-data=AQlFBBoSJLAFWAAAAhM3AQpBCRoBElCwBSwAAALv4QELRQovKlGYBSsAAALXFxG3FQsgtxUL*wEjASbPFQB7EAsBD9gVEtgVCw__

The following error I see in console.log:

Failed to load https://nodes.wavesnodes.com/transactions/unconfirmed: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'https://wavesexplorer.com' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

vendor.6613e363a22491392386.js:46 Error: Network Error
    at LYNF.e.exports (vendor.6613e363a22491392386.js:14)
    at XMLHttpRequest.h.onerror (vendor.6613e363a22491392386.js:75)
    at XMLHttpRequest.n (vendor.6613e363a22491392386.js:46)

openapi.js:1 Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

This is 360 Extreme Explorer browser.

Mozilla Firefox ESR. Console.log:

Запрос из постороннего источника заблокирован: Политика одного источника запрещает чтение удаленного ресурса на «https://nodes.wavesnodes.com/blocks/height». (Причина: Учётные данные не поддерживаются, если заголовок CORS «Access-Control-Allow-Origin» установлен в «*»). (неизвестен)

Запрос из постороннего источника заблокирован: Политика одного источника запрещает чтение удаленного ресурса на «https://nodes.wavesnodes.com/transactions/unconfirmed». (Причина: Учётные данные не поддерживаются, если заголовок CORS «Access-Control-Allow-Origin» установлен в «*»). (неизвестен)

Error: Network Error
Стек-трейс:
.LYNF/e.exports@https://wavesexplorer.com/vendor.6613e363a22491392386.js:14:80055
.tQ2B/e.exports/</h.onerror@https://wavesexplorer.com/vendor.6613e363a22491392386.js:75:23789
Le/n@https://wavesexplorer.com/vendor.6613e363a22491392386.js:46:17160
  vendor.6613e363a22491392386.js:46:22598
POST 
https://sentry.io/api/1401739/store/ [HTTP/1.1 200 OK 781мс]
Запрос из постороннего источника заблокирован: Политика одного источника запрещает чтение удаленного ресурса на «https://nodes.wavesnodes.com/node/version». (Причина: Учётные данные не поддерживаются, если заголовок CORS «Access-Control-Allow-Origin» установлен в «*»).  (неизвестен)
GET 
https://wavesexplorer.com/images/erroring-88.905d816e1748ea540e287c909dc82195.svg [HTTP/2.0 200 OK 46мс]
OPTIONS 
XHR 
https://nodes.wavesnodes.com/transactions/unconfirmed [HTTP/2.0 204 No Content 156мс]
Error: Network Error
Стек-трейс:
.LYNF/e.exports@https://wavesexplorer.com/vendor.6613e363a22491392386.js:14:80055
.tQ2B/e.exports/</h.onerror@https://wavesexplorer.com/vendor.6613e363a22491392386.js:75:23789
Le/n@https://wavesexplorer.com/vendor.6613e363a22491392386.js:46:17160

The same problem, on localhost, after installation of wavesexplorer.

But! This wavesblockexplorer working good: http://wavesblockexplorer.com/
and opening without any problems in both browsers.

All that means need to fix something in the source code, to install this and working without any bugs, like old-wavesexplorer working good, after installation.

@beregovoy68
Copy link
Contributor

I can't see headers for any requests your browser makes to nodes.wavesnodes.com, that's why I can't say what the issue is.

Could you post here your Firefox ESR version?

Anyway, I've reported that back to node support team, they are looking into it. If you still see these errors please contact support@wavesplatform.com.

@beregovoy68
Copy link
Contributor

The old explorer makes requests differently and may show inconsistent results as subsequent requests might be processed by different nodes.

@username1565
Copy link
Author

username1565 commented Nov 7, 2019

Hi, @beregovoy68.

I can't see headers for any requests your browser makes to nodes.wavesnodes.com, that's why I can't say what the issue is.
I see some requests which the browser try to make directly to nodes.wavesnodes.com.
Look at this headers.

Links:

https://nodes.wavesnodes.com/blocks/height
https://nodes.wavesnodes.com/consensus/basetarget
https://nodes.wavesnodes.com/transactions/unconfirmed
https://nodes.wavesnodes.com/node/version

Headers from "Network"-tab:

General:
Request URL: https://nodes.wavesnodes.com/blocks/height
Request Method: OPTIONS
Status Code: 204 
Remote Address: 104.20.31.160:443
Referrer Policy: no-referrer-when-downgrade

Response Headers:
access-control-allow-credentials: true
access-control-allow-headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,signature,timestamp
access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
access-control-allow-origin: *
backend: fr-1
cf-cache-status: DYNAMIC
cf-ray: 532096582f5b8ad8-KBP
content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' online.swagger.io
date: Thu, 07 Nov 2019 16:12:11 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
referrer-policy: unsafe-url
server: cloudflare
set-cookie: __cfduid=d61261a2dbd579e2c61a9423e4c0d80c71573143130; expires=Fri, 06-Nov-20 16:12:10 GMT; path=/; domain=.wavesnodes.com; HttpOnly
set-cookie: AWSALB=rLibT5gKXcyjqk13CUezTBmJNhoHHEXBBLvgaK63R04rnxYSTNqFFV8wdprJOzyHsBuQTibR8VyBM2IaS/qyrmLWpBydLMoivfvB1qFgtemk9eJ2NBuuCC4/JsrX; Expires=Thu, 14 Nov 2019 16:12:11 GMT; Path=/
set-cookie: __cflb=2297726047; path=/; expires=Fri, 08-Nov-19 15:12:11 GMT; HttpOnly
status: 204
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 0

Request Headers:
:authority: nodes.wavesnodes.com
:method: OPTIONS
:path: /blocks/height
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
access-control-request-headers: cache-control
access-control-request-method: GET
origin: https://wavesexplorer.com
user-agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

And, as you can see, nodes.wavesnodes.com responding with status-code 204.

But, for working https://wavesblockexplorer.com
I see the following headers.
Links:

https://waves-node.guarda.co/node/version
https://waves-node.guarda.co/consensus/basetarget
https://waves-node.guarda.co/blocks/height
https://waves-node.guarda.co/transactions/unconfirmed

Headers:

General:
Request URL: https://waves-node.guarda.co/transactions/unconfirmed
Request Method: GET
Status Code: 200 
Remote Address: 104.26.13.229:443
Referrer Policy: no-referrer-when-downgrade

Response Headers:
access-control-allow-credentials: true
access-control-allow-headers: Origin,Content-Type,Accept, User-Agent, Access-Control-Allow-Headers, Authorization, X-Requested-With, Cache-Control
access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE, HEAD
access-control-allow-origin: https://wavesblockexplorer.com
cf-cache-status: DYNAMIC
cf-ray: 5320a000cc71822f-KBP
content-encoding: br
content-type: application/json
date: Thu, 07 Nov 2019 16:18:46 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
status: 200
vary: Accept-Encoding

Request Headers:
:authority: waves-node.guarda.co
:method: GET
:path: /transactions/unconfirmed
:scheme: https
accept: application/json, text/plain, */*
accept-encoding: gzip, deflate, br
accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
cache-control: no-cache
cookie: __cfduid=d77cebdb847d815b86c0729b50a3724881570773493
origin: https://wavesblockexplorer.com
referer: https://wavesblockexplorer.com/
user-agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

And, as you can see, waves-node.guarda.co responding with status-code 200 (OK).

Could you post here your Firefox ESR version?
Firefox ESR 52.9.0 (32-бит). But this does not matter, because in many browsers https://wavesexplorer.com/ is not working.

But this is not the main problem of this issue.
The main issue was been about local installed wavesexplorer.
And this not working too, after install, because need to enable CORS somewhere.

The old waves-block-explorer, after my modifications, is working without any problems, after install this.
Also, can you show me, where is the code to autogenerate that files, which you did exclude in my pull request, and where is the code to modify index.html to include this files in the process of build old wavesexplorer, from the source codes?

Anyway, I've reported that back to node support team, they are looking into it.
If you still see these errors please contact support@wavesplatform.com.

I want to know what to write for them, to solve and fix, this trouble with CORS, faster and elegantly?
And, maybe, you are more tech-savvy than someone PR-managers from the support service who receive millions of emails every day, from the many peoples around the world, on various topics, mainly related with unconfirmed payments.

The old explorer makes requests differently and may show inconsistent results
as subsequent requests might be processed by different nodes.

Hm... I just see on "Network"-tab the requests, only for the node address,
which specified in src/js/config-1.1.8.js, and not for another nodes.

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

3 participants