Quick Start Guide
Step 1: Start TimeBase
Run TimeBase in a Docker container.
tip
You can also make this step using TimeBase Installer.
# make sure the timebase-network was created
docker network ls
docker run --rm --detach \
--name timebase-server \
--network timebase-network
-p 8011:8011 \
registry.deltixhub.com/quantserver.docker/timebase/server:5.5.99
Step 2: Generate Sample Data
Run the following command to generate a sample data into a new stream called "bars".
docker exec -it timebase-server /timebase-server/bin/tickdb.sh
set db dxtick://localhost:8011
open
generate bars
exit
tip
You can also make this step using TimeBase Installer.
Step 3: Dependencies
info
Refer to Client Libraries to get artifacts repositories for clients.
# Gradle for Java
dependencies {
implementation "deltix.qsrv.timebase:deltix-timebase-client:5.5.99"
implementation "deltix.qsrv:deltix-timebase-api-messages:5.4.100"
implementation "deltix.qsrv:deltix-commons-util:5.4.32"
implementation 'deltix:deltix-gflog-core:2.0.40'
}
Step 4: Read Data
Create a TimeBase Cursor to read data from a sample stream.
- Java
- .NET
- Python
package deltix;
import deltix.qsrv.hf.tickdb.pub.*;
public class ReadStream {
public static void main(String[] args) {
DXTickDB db = TickDBFactory.createFromUrl ("dxtick://localhost:8011");
db.open (false);
DXTickStream stream = db.getStream("bars");
try (TickCursor cursor = stream.select(Long.MIN_VALUE, new SelectionOptions(true, false))) {
while (cursor.next()) {
System.out.println(cursor.getMessage());
}
}
}
}
public void ReadStream()
{
String connection = "dxtick://localhost:8011";
using (ITickDb db = TickDbFactory.CreateFromUrl(connection))
{
db.Open(false);
String streamName = "bars";
ITickStream stream = db.GetStream(streamName);
using (ITickCursor cursor = stream.Select(DateTime.MinValue, new SelectionOptions(), types, ids))
{
while (cursor.Next())
{
MyBarMessage message = (MyBarMessage) cursor.GetMessage();
Console.WriteLine("Read message: " + message.ToString());
}
}
}
}
import dxapi
timebase = 'dxtick://localhost:8011'
try:
db = dxapi.TickDb.createFromUrl(timebase)
db.open(True)
streamKey = 'bars'
stream = db.getStream(streamKey)
cursor = stream.select(0, options, None, None)
try:
while cursor.next():
message = cursor.getMessage()
finally:
# cursor should be closed anyway
cursor.close()
cursor = None
finally:
# database connection should be closed anyway
if (db.isOpen()):
db.close()
print("Connection " + timebase + " closed.")
info
Refer to Client Libraries to view more samples.
Step 5: Manage TimeBase in Admin Application
TimeBase Web Admin is a Web client you can use to manage TimeBase.
tip
You can also make this step using TimeBase Installer.
- Launch TimeBase Admin in a Docker container. Refer to Docker Compose to launch TimeBase Server together with Web Admin.
- Login to registry.deltixhub.com.
- Open TimeBase Admin to view sample streams.
tip
TimeBase Web Admin default credentials: admin/admin.
docker run --rm --detach \
--name timebase-admin \
-p 8099:8099 \
registry.deltixhub.com/quantserver.docker/timebase/ws-server:0.5.93
info
Refer to TimeBase Admin Deployment for more information.
Samples
info
Refer to Client Libraries for more information.
Solution Generator
Use TimeBase Solution Generator (Solgen) to generate ready-to-go code samples in several supported languages.
TimeBase Deployment Options
In the Deployment section you may find various TimeBase deployment options.