toncenter / ton-http-api

HTTP API for TON (The Open Network)
https://toncenter.com
GNU General Public License v3.0
219 stars 43 forks source link

problem with api v3 #131

Open kugimiya530 opened 1 month ago

kugimiya530 commented 1 month ago

Hi I was running my own fullnode

and http ton api

however

if my domain is ton.xxx.zzz

when i want to call v2 api /getAddressBalance it should be

curl -X 'GET' \
  'http://ton.xxx.zzz/api/v2/getAddressBalance?address=UQCalesZz9ifhdN7ol-XRSFrZkr5Uj8lWSSpCLRiEvjyJHBc' \
  -H 'accept: application/json'

but for me its only work when i take off api/v2

curl -X 'GET' \
  'http://ton.xxx.zzz/getAddressBalance?address=UQCalesZz9ifhdN7ol-XRSFrZkr5Uj8lWSSpCLRiEvjyJHBc' \
  -H 'accept: application/json'

what wrong with my node and api...

and V3 is totally not work for me

anyone have idea?

azerella commented 1 month ago

You need to configure the API root path env var like so:

export TON_API_ROOT_PATH=/api/v2
kugimiya530 commented 1 month ago

Hi Adam

Appreciate you help

how if i want to access v2 and v3

what value should i export

-------------additional-------------

Should I set it in the .env file and then run docker compose up, or should I use export for the TON_API_ROOT_PATH?

I just tried export TON_API_ROOT_PATH=/api/v2, but the situation remains the same as before.

curl -X 'GET' \
  'http://ton.xxx.zzz/api/v2/getAddressBalance?address=UQCalesZz9ifhdN7ol-XRSFrZkr5Uj8lWSSpCLRiEvjyJHBc' \
  -H 'accept: application/json'

{"ok":false,"error":"Not Found","code":404}

but for me its only work when i take off api/v2

curl -X 'GET' \
  'http://ton.xxx.zzz/getAddressBalance?address=UQCalesZz9ifhdN7ol-XRSFrZkr5Uj8lWSSpCLRiEvjyJHBc' \
  -H 'accept: application/json'

{"ok":true,"result":"6896292093"}

and ... didn't answer the v3 api problem

Thx again