cardano-private-testnet-setup icon indicating copy to clipboard operation
cardano-private-testnet-setup copied to clipboard

query private testnet

Open hududed opened this issue 2 years ago • 6 comments

I am wondering if there's an alternative way to query the private testnet e.g. with blockfrost?

hududed avatar Mar 18 '22 18:03 hududed

I am wondering if there's an alternative way to query the private testnet e.g. with blockfrost?

Blockfrost is a third party service. It can't access your testnet. That is why it specifically says private testnet, because it is your own.

Now imagine you create your own banking system. You can use it for example with your friend. But you won't be able to call Visa or Mastercard and say, hey please integrate my banking system. Same thing with blockfrost.

taada-finance avatar Mar 19 '22 09:03 taada-finance

I understand, so the only way is through postgresql / some database? I guess I should rephrase the question to what's the most convenient way to query a private testnet

hududed avatar Mar 20 '22 13:03 hududed

To support querying the data, you need a process like cardano-db-sync to attach to one of the running nodes of the private testnet, so the data gets collected and written to a database. Then, you can query things using SQL.

Blockfrost is aggregating data with db-sync as well. But, they added an API to allow users to make HTTP requests to get at the data.

woofpool avatar Mar 20 '22 16:03 woofpool

I see, so adding an API to cardano-db-sync connected to the private testnet is the best way - are there tools available to make this easier?

hududed avatar Mar 21 '22 13:03 hududed

you essentially need a thin REST wrapper on top of the db, ie.

https://postgrest.org/en/stable/

might just do the trick.

Otherwise I'd code something super simple with Flask.

grzegorznowak avatar Mar 21 '22 13:03 grzegorznowak

you essentially need a thin REST wrapper on top of the db, ie.

https://postgrest.org/en/stable/

Oh, I never knew that existed! Another fun thing to try out.

woofpool avatar Mar 21 '22 18:03 woofpool