https://github.com/stockmq/stockmq-server
High-Performance message broker for the market data
https://github.com/stockmq/stockmq-server
binance market-data nats stocks
Last synced: 5 months ago
JSON representation
High-Performance message broker for the market data
- Host: GitHub
- URL: https://github.com/stockmq/stockmq-server
- Owner: stockmq
- License: gpl-3.0
- Created: 2022-12-15T08:57:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-28T20:16:48.000Z (over 2 years ago)
- Last Synced: 2024-01-28T21:24:31.960Z (over 2 years ago)
- Topics: binance, market-data, nats, stocks
- Language: Go
- Homepage:
- Size: 171 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StockMQ Server


High-Performance message broker for the market data.
This repository provides core functionality including WebSocket connector for Binance.
# Requirements
NATS Server
```
go install github.com/nats-io/nats-server/v2@latest
$(GOPATH)/bin/nats-server
```
# Example configuration
```xml
Binance-BTCUSD
true
wss://stream.binance.com:9443/ws
Binance
4
3
60
655350
{"id": 0, "method": "SUBSCRIBE", "params": ["btcusdt@kline_1s", "btcusdt@depth"]}
```
# Persistence
It's possible to persist messages to MongoDB and InfluxDB. See stockmq-config.xml for details.
For MongoDB database and collections will be created automatically.
```xml
true
mongodb://localhost:27017
5
stockmq
candles
quotes
```
InfluxDB requires organization and access token with write access.
```xml
false
http://127.0.0.1:8086
stockmq
stockmq-data
```
# Start the server
Configure all required feeds in stockmq-server.xml
```
go build
./stockmq-server -c stockmq-server.xml
```
# Listen for updates
```
cd cmd/stockmq-nats
go build
./stockmq-nats -debug
```