ehazlett / stellar

Simplified Container System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I use the gRPC Gateway API?

unixfox opened this issue · comments

I found here #8 that it's possible to interact with the API using HTTP but I don't really know the endpoints of that API, is it possible to help me how to find them or maybe add swagger for an easy use of the API?

It was started as an experimental feature (https://github.com/ehazlett/stellar/blob/master/api/services/cluster/v1/cluster.proto#L17). I think we should add some more routes and investigate to see if this is the way we want to go or possibly pull the HTTP gateway out into a separate project and keep the core clean.

Thank you for your reply. I don't mind using the actual gRPC API instead of the gateway one do you have any tips for me to know the endpoints? I tried to use grpccurl but it requires building a protoset and it's quite complicated for me due to the fact that I don't really know golang.

If you are using Go you can just use the Stellar Client (https://github.com/ehazlett/stellar/blob/master/client/client.go#L47). That's what Stellar uses internally for all API operations.

I'm not familiar with Golang what if I want to interact with the gRPC API using NodeJS for example?

Typically you would generate using the protos for whatever language you want.