Hello community,

I am trying Solana JSON RPC to fetch data via http request and data configuration on Appgyver.

So far, I managed to get rid of all errors occurred by misconfiguration and only left with CORS issue.

At this point, I am confused whether if it is because Appgyver simply does not allow it or the set up is still wrong.

I have attached some screenshot below with explanation of why I did it this way.

Pic. 1
Using the Solana RPC API, I wanted to make an app where users can search transaction history by solana wallet address.
Since the document says the Solana node can accept HTTP requests, I thought it would work via data config or http request.

Pic. 2
It says use post method so I used post for http request and create record at data config.
For url, I think localhost is meant for those who actually have node installed, so I instead used solana mainnet-beta endpoint, Port number is fixed like this as pic.1 above says so.

Pic. 3

Pic. 4

So I set up flow function like this. Executing it will result in Page Variable(any value) store response message from http request.

Pic. 5

Pic. 6

Pic. 5 and Pic 6. are set up for http request.

Pic 7.
After executing the flow function, CORS issue occurred as debugger in screenshot shows it.

Same thing occurs at data config. I guess it wouldn’t be that strange since it is basically same as the http request logic node. But I attached the set up for it below as well just in case.

Pic. 8

Pic. 9

Pic 8 and Pic 9 are screenshots of configuration.

Pic 10.
Record Properties: {“jsonrpc”:“2.0”, “id”:1, “method”:“getTokenAccountBalance”, “params”: [“7fUAJdStEuGbc3sM84cKRL6yYaaSstyLSU4ve5oovLS7”]}

After running the test, the same CORS issue happened.

For this error, I have several guessing:

  1. Set up for Solana JSON RPC is still wrong
  2. Appgyver cannot execute the JSON RPC request yet for certain issue. ==> I am also guessing it is something to do with fetch action.

I am looking for the solution from many places as well and came here to seek help. So it would be appreciated if anyone can share knowledge from all aspects from fetch action to blockchain in general.
And thank you for reading this long post.

So after a long research, I was able to fix the issue.

The things I had to check from the above screenshots are port number and token account…

So for the port number, it was only required if I had a node installed on my pc. Since I was just requesting JSON RPC, I didn’t need to add port number at the end of the url.

And for token account, apparently there is a difference between solana wallet address and spl token address. These are two different address so that is why I was getting error.

Correcting two issues enabled successful attempt. I will leave this thread here in case someone is struggling with the same issue.