Skip to content

alpstable/gidari

Repository files navigation

Gidari

PkgGoDev Build Status Go Report Card Discord

Gidari is a library for batch querying data and persisting the results to local storage.

Installation

go get github.com/alpstable/gidari@latest

For information on using the CLI, see here.

Usage

Gidari supports HTTP and network socket services. There are two ways to use an HTTP service:

  1. Iterate over http.Response data, for pre-defined http.Requests.
  2. Define a writer to concurrently "write" response data for pre-defined http.Requests.

See the Go Docs or Web-to-Storage Examples section for examples.

Network sockets involves subscribing to a socket (such a web socket) and continuously iterating over the data via ReadWriter interface. The results would then be sent to a user-defined ListWriter to be stored. See the Go Docs or Network Socket Examples section for examples.

Authenticating HTTP Requests

Protocol Parameters Description
Basic Requires a username/email and password The server will authorize the request only if it can validate the user-ID and password for the protection space of the Request-URI
Coinbase Requires a key, passphrase and secrete generated in the Coinbase Exchange GUI The Coinbase API requires a CB-ACCESS-SIGN header that is generated by creating a sha256 HMAC using the base64-decoded secret key on the prehash string from a timestamp + method + requestPath + body combination
Kraken Requires key and secret generated in the Kraken Pro GUI The Kraken spot API uses a custom authentication algorithm that is based on a combination of API key, nonce, and message signature. The signature is generated using a hash-based message authentication code (HMAC) with SHA-512 as the hash function.

Web-to-Storage Examples

Data Type Writer Example Description
CSV csvpb examples/csvp Use the HTTPService to write web API data to stdout as CSV
MongoDB Document mongopb exmaples/mongopb Use the HTTPService to write web API data to a MongoDB Collection

Network Socket Examples

Type Writer Example Description
WebSocket fmt.Println examples/websocket Subscribe to the Coinbase WebSocket and print the results

Contributing

Follow this guide for information on contributing.

Resources