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

Eror getting config #285

Open
ysomad opened this issue Dec 11, 2024 · 10 comments
Open

Eror getting config #285

ysomad opened this issue Dec 11, 2024 · 10 comments

Comments

@ysomad
Copy link

ysomad commented Dec 11, 2024

Hi! I'm getting error on parsing mainnet config, issue encountered between Dec. 10 and 11.

Code:

_, err := liteclient.GetConfigFromUrl(context.Background(), "https://ton.org/global.config.json")
if err != nil {
  return fmt.Errorf("get config: %w", err)
}

Returns:
get config: invalid character '<' looking for beginning of value

@iw4p
Copy link
Contributor

iw4p commented Dec 11, 2024

Hi, Yes I can confirm it!

@ysomad
Copy link
Author

ysomad commented Dec 11, 2024

It's caused because in response HTML is present, GetConfigFromUrl not handling status of response

@iw4p
Copy link
Contributor

iw4p commented Dec 11, 2024

It's caused because in response HTML is present, GetConfigFromUrl not handling status of response

any quick fix for it?

@ysomad
Copy link
Author

ysomad commented Dec 11, 2024

idk, vpn or proxy to bypass cloudflare

@iw4p
Copy link
Contributor

iw4p commented Dec 11, 2024

curl https://ton-blockchain.github.io/global.config.json and curl https://ton.org/global.config.json works fine on both VPS and my machine! Using VPN or proxy for what when I can get the result using curl but it does not work with tonutils-go?

@ysomad
Copy link
Author

ysomad commented Dec 11, 2024

curl https://ton-blockchain.github.io/global.config.json and curl https://ton.org/global.config.json works fine on both VPS and my machine! Using VPN or proxy for what when I can get the result using curl but it does not work with tonutils-go?

Yeah, you're right. I'm pretty sure the problem may caused by missing headers, User-Agent maybe, will check later

@xssnick
Copy link
Owner

xssnick commented Dec 11, 2024

Same for me, looks like some rules on the server blocks it, i will notify the team.

As an option for now you can download it and put locally, then load with liteclient.GetConfigFromFile("path to file.json")

@xssnick
Copy link
Owner

xssnick commented Dec 11, 2024

does it work for you? @ysomad I still get the same error. Any update when it can fixed? @xssnick

You getting error even when using file? URL https://ton-blockchain.github.io/global.config.json works fine for me, for ton.org I already notified them, hope will be fixed soon

@iw4p
Copy link
Contributor

iw4p commented Dec 11, 2024

does it work for you? @ysomad I still get the same error. Any update when it can fixed? @xssnick

You getting error even when using file? URL https://ton-blockchain.github.io/global.config.json works fine for me, for ton.org I already notified them, hope will be fixed soon

Thanks! I fixed it, problem was on my side! But it'd be good if it fixes soon from the URL!

One more question, how often the .json will change? can I keep it as a file for how long?

@xssnick
Copy link
Owner

xssnick commented Dec 11, 2024

It changes not so often and usually only some nodes are replaced, if you update it once a month I think it will be ok

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