EpicCash / epic

Blockchain Node Server with integrated Stratum Mining Server
https://epiccash.com
Apache License 2.0
24 stars 36 forks source link

[BUG]The file `.\foundation.json` was not found! #131

Open ahma09 opened 2 months ago

ahma09 commented 2 months ago

Describe the bug The file .\foundation.json was not found! To Reproduce first start c:\epic>epic The file .\foundation.json was not found! Will try to use the alternative file c:\debian\foundation.json!

Couldn't open the foundation file! Check if the file "c:\debian\foundation.json" was not changed!

c:\epic>pause Для продолжения нажмите любую клавишу . . .

if put blank file i got error Invalid foundation file!

Expected behavior server log 20240422 12:43:45.783 INFO epic_util::logger - log4rs is initialized, file level: Info, stdout level: Warn, min. level: Info 20240422 12:43:45.784 INFO epic - Using configuration file at C:\Users\roy.epic\main\epic-server.toml 20240422 12:43:45.784 INFO epic - This is Epic version 3.6.0 (git v3.6.0), built for x86_64-pc-windows-msvc by rustc 1.76.0 (07dca489a 2024-02-04). 20240422 12:43:45.784 INFO epic::cmd::server - Starting EPIC in UI mode... 20240422 12:43:45.784 WARN epic_core::global - The file .\foundation.json was not found! 20240422 12:43:45.785 WARN epic_core::global - Will try to use the alternative file c:\debian\foundation.json! ... 20240422 12:43:45.785 INFO epic_servers::epic::server - The foundation.json is being read from "c:\debian\foundation.json" 20240422 12:43:45.793 ERROR epic_util::logger - thread 'main' panicked at 'Error trying to read the foundation.json. Couldn't find/open the file c:\debian\foundation.json!: Os { code: 3, kind: NotFound, message: "Системе не удается найти указанный путь." }': core\src\global.rs:658

Required data

Additional context Add any other context about the problem here.

whileunless commented 2 months ago

I face the same on Linux:

The file `/usr/share/epic/foundation.json` was not found!
Will try to use the alternative file `/home/admin_u/debian/foundation.json`!

Couldn't open the foundation file!
Check if the file "/home/admin_u/debian/foundation.json" was not changed!

after trying to launch epic. I have the same version of epic as the original poster, my cargo is 1.77.2 version. The binary was built with cargo install --git https://github.com/epiccash/epic.git epic .

But when I build epic with these instructions it lauches TUI but it syncs orders of magnitude slower than grin. And it outputs the following to the terminal:

The file `/usr/share/epic/foundation.json` was not found!
Will try to use the alternative file `/home/admin_u/epic/debian/foundation.json`!
KanoczTomas commented 1 month ago

I had the same error, I have created my custom docker build file that just copies it over from the sources to the /usr/share/epic folder: COPY --from=builder /usr/src/epic/debian/foundation.json /usr/share/epic/foundation.json

So copy the file from this git repo (debian/foundation.json) to wherever your OS is looking for it and it should work.

Please do not close the issue, if it works, as it is still a bug and needs to be imho fixed!

whileunless commented 1 month ago

So copy the file from this git repo (debian/foundation.json) to wherever your OS is looking for it and it should work.

I would love to do it but cannot find such file in the repo. If you can please provide me with the link or path to it.

KanoczTomas commented 1 month ago

https://github.com/EpicCash/epic/tree/master/debian see the file there

who-biz commented 2 weeks ago

We now have a couple reports of this. While I do believe 1.) the user-side fix is simple, and 2.) logs clearly state what file it is looking for (and where) - we should probably change the default location of this, to something that doesn't need installed with admin permissions (root file system).