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

Cannot query data directly from node #606

Open
Im-Kunal-13 opened this issue Jun 20, 2023 · 3 comments
Open

Cannot query data directly from node #606

Im-Kunal-13 opened this issue Jun 20, 2023 · 3 comments
Assignees

Comments

@Im-Kunal-13
Copy link

Bug description

I'm currently facing some difficulties while trying to query data from the node and test Hasura actions. I've been following the documentation provided at https://docs.bigdipper.live/cosmos-based/parser/hasura. However, I'm encountering a consistent 'connection refused' error when I use the curl command to make the request:
curl http://localhost:3000/account_balance \ --data '{ "input": { "address": "desmos16fc5kd5d4f5sjq5wz3v8gkyk4xd8f7hrax27xw" } }'

How can I diagnose and fix the 'connection refused' error that I'm experiencing when I attempt to query data using Hasura actions?

This is my config.yaml file

node:
    type: remote
    config:
      rpc:
        client_name: juno
        address: http://localhost:26657
        max_connections: 20
      grpc:
        address: localhost:9090
        insecure: true
parsing:
    workers: 100
    average_block_time: 5s
    listen_new_blocks: true
    parse_old_blocks: true
    parse_genesis: true
    genesis_file_path: ~/.sei/config
    start_height: 1
    fast_sync: true
database:
    url: postgresql://postgres:postgres123@localhost:5432/bdjuno?sslmode=disable&search_path=public
    max_open_connections: 10
    max_idle_connections: 10
    partition_size: 100000
    partition_batch: 1000
logging:
    level: debug
    format: text
telemetry:
    port: 5000
pruning:
    keep_recent: 100
    keep_every: 500
    interval: 10
actions:
    port: 3000
    host: 127.0.0.1

Steps to reproduce

Setting up a postgres database, bdjuno and hasura from here - https://docs.bigdipper.live/cosmos-based/parser/database. Hasura version - v2.27.0

@RiccardoM
Copy link
Contributor

@Im-Kunal-13 All GraphQL requests should be POST requests, not GET ones. Try adding -X POST to should cURL command

@rider-cantuaria-eng
Copy link

same here:
I did:
curl http://localhost:3000/account_balance -X POST -H "Content-Type: application/json" --data '{ "input": { "address": "desmos16fc5kd5d4f5sjq5wz3v8gkyk4xd8f7hrax27xw"} }'

and get this feedback:

curl: (7) Failed to connect to localhost port 3000 after 0 ms: Connection refused

@rider-cantuaria-eng
Copy link

rider-cantuaria-eng commented May 14, 2024

I fixed it by putting it in Docker and adding the ACTION_BASE_URL in the .env file.
image

call it on docker compose file
image

And after that, I implemented an 'IP fix' for the bdjuno service
image

and more important enable in config.yaml the actions module
image

and put the ip fix on action block
image

evidence 01
image

BUT if you wanna try to run bdjuno locally, please open a listener on port 3000 and put just localhost

see this #743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants