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

Why I got this error when calling NewClientWithDefaultMainnet #326

Open
thachletopebox opened this issue Dec 11, 2024 · 7 comments
Open

Comments

@thachletopebox
Copy link

networks := map[string]*liteapi.Client{}
var err error
networks["-239"], err = liteapi.NewClientWithDefaultMainnet()
if err != nil {
t.logger.Errorf("Error creating TON mainnet client: %v", err)
}

the error response "Error creating TON mainnet client: invalid character '\u003c' looking for beginning of value","time":"2024-12-11T17:21:34+07:00"

@mn13
Copy link

mn13 commented Dec 11, 2024

+1 it's happened today

Update:
It happens in downloadConfig in calling GET on https://ton.org/global.config.json for some reason it returns 403 sometimes (suspiciously often when initializing client).

Possiblе solution may be using FromEnvsOrMainnet to set liteservers in env

@jus1d
Copy link

jus1d commented Jan 10, 2025

+1 it's happened today

Update: It happens in downloadConfig in calling GET on https://ton.org/global.config.json for some reason it returns 403 sometimes (suspiciously often when initializing client).

Possiblе solution may be using FromEnvsOrMainnet to set liteservers in env

Im currently facing the same problem. But in browser, i can easily visit this link without any errors.

Have you found the solution for this problem?

@mn13
Copy link

mn13 commented Jan 13, 2025

@jus1d I use liteapi.NewClient(liteapi.FromEnvsOrMainnet()) with servers from the global.config.json in env

LITE_SERVERS=5.9.10.47:19949:n4VDnSCUuSpjnCyUk9e3QOOd6o0ItSWYbTnW3Wnn8wk=,5.9.10.15:48014:3XO67K/qi+gu3T9v8G2hx1yNmWZhccL3O7SoosFo8G0=,135.181.177.59:53312:aF91CuUHuuOv9rm2W5+O/4h38M3sRm40DtSdRxQhmtQ=,135.181.140.212:13206:K0t3+IWLOXHYMvMcrGZDPs+pn58a17LFbnXoQkKc2xw=,135.181.140.221:46995:wQE0MVhXNWUXpWiW5Bk8cAirIh5NNG3cZM1/fSVKIts=,65.21.141.233:30131:wrQaeIFispPfHndEBc0s0fx7GSp8UFFvebnytQQfc6A=,65.21.141.198:47160:vOe1Xqt/1AQ2Z56Pr+1Rnw+f0NmAA7rNCZFIHeChB7o=,65.21.141.231:17728:BYSVpL7aPk0kU5CtlsIae/8mf2B/NrBi7DKmepcjX6Q=,65.21.141.197:13570:iVQH71cymoNgnrhOT35tl/Y7k86X5iVuu5Vf68KmifQ=,164.68.101.206:52995:QnGFe9kihW+TKacEvvxFWqVXeRxCB6ChjjhNTrL7+/k=,164.68.99.144:20334:gyLh12v4hBRtyBygvvbbO2HqEtgl+ojpeRJKt4gkMq0=,188.68.216.239:19925:ucho5bEkufbKN1JR1BGHpkObq602whJn3Q3UwhtgSo4=,51.195.189.59:19434:J5CwYXuCZWVPgiFPW+NY2roBwDWpRRtANHSTYTRSVtI=,51.195.189.140:23067:vX8d0i31zB0prVuZK8fBkt37WnEpuEHrb7PElk4FJ1o=,135.181.132.198:53560:NlYhh/xf4uQpE+7EzgorPHqIaqildznrpajJTRRH2HU=,135.181.132.253:46529:jLO6yoooqUQqg4/1QXflpv2qGCoXmzZCR+bOsYJ2hxw=,54.39.158.156:51565:TDg+ILLlRugRB4Kpg3wXjPcoc+d+Eeb7kuVe16CS9z8=,185.86.79.9:4701:G6cNAr6wXBBByWDzddEWP5xMFsAcp6y13fXA8Q7EJlM=

@jus1d
Copy link

jus1d commented Jan 13, 2025

@mn13 Thanks, I'll try this one

@jus1d
Copy link

jus1d commented Jan 13, 2025

is the list of servers updated frequently? do you know, @mn13 ? I mean, is it safe to do this that way

@mn13
Copy link

mn13 commented Jan 14, 2025

I don't know but I think not frequently. And it's in ENV it's easy to update without rebuild

@jus1d
Copy link

jus1d commented Jan 14, 2025

I don't know but I think not frequently. And it's in ENV it's easy to update without rebuild

is it fast in your case? cause i have to wait like 2 minutes until this command will done

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