Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



qubic/api-sidecar

REST service that makes it easy to interact with Qubic network nodes.

The sidecar api is used to interact with the Qubic network and it currently supports fetching information related to identity balances, with ongoing development to add additional functionalities exposed by Qubic nodes.

It's using the go-qubic sdk to interact with the Qubic network



Building the app binary:

$ go build -o "server" "./app/server"

Running the server:

$ ./server --qubic-node-ip="65.21.10.217"
2023/11/20 20:05:05 main: Config :
--web-host=0.0.0.0:8080
--web-read-timeout=5s
--web-write-timeout=5s
--web-shutdown-timeout=5s
--qubic-node-ip=65.21.10.217
--qubic-node-port=21841
2023/11/20 20:05:05 main: API listening on 0.0.0.0:8080

Sending requests to the server:

$ curl "localhost:8080/identities/PKXGRCNOEEDLEGTLAZOSXMEYZIEDLGMSPNTJJJBHIBJISHFFYBBFDVGHRJQF"
{"Entity":{"PublicKey":[79,39,220,27,106,26,118,212,121,131,62,95,27,237,13,109,119,199,5,160,41,10,99,45,233,71,148,219,238,103,13,250],"IncomingAmount":10000,"OutgoingAmount":0,"NumberOfIncomingTransfers":125980,"NumberOfOutgoingTransfers":1047,"LatestIncomingTransferTick":10703131,"LatestOutgoingTransferTick":10701088},"Tick":10871666,"SpectrumIndex":14427983,"Siblings":[]}

Docker usage:

$ docker build -t qubic-api-sidecar .
$ docker run -p 8080:8080 -e -e QUBIC_API_SIDECAR_QUBIC_NODE_IP=65.21.10.217 qubic-api-sidecar
$ curl "localhost:8080/identities/PKXGRCNOEEDLEGTLAZOSXMEYZIEDLGMSPNTJJJBHIBJISHFFYBBFDVGHRJQF"
{"Entity":{"PublicKey":[79,39,220,27,106,26,118,212,121,131,62,95,27,237,13,109,119,199,5,160,41,10,99,45,233,71,148,219,238,103,13,250],"IncomingAmount":10000,"OutgoingAmount":0,"NumberOfIncomingTransfers":125980,"NumberOfOutgoingTransfers":1047,"LatestIncomingTransferTick":10703131,"LatestOutgoingTransferTick":10701088},"Tick":10871666,"SpectrumIndex":14427983,"Siblings":[]}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages