Quick Start Guide
info
You can also find a detailed quick start guide and a video demo in TimeBase Crypto Connectors GitHub repository.
Step 1: Start TimeBase
Run TimeBase in a Docker container.
tip
You can also make this step using TimeBase Installer.
# create a user-defined network
docker network create --driver bridge timebase-network
# make sure the network was created
docker network ls
# run the timebase server container
docker run --rm -d \
--network timebase-network
-p 8011:8011 \
--name=timebase-server \
--ulimit nofile=65536:65536 \
finos/timebase-ce-server:6.1.9
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.
info
Please refer to TimeBase Tutorial for more information.
Step 3: Dependencies
info
Refer to Client Libraries to get artifacts repositories for clients.
//Gradle for Java
dependencies {
implementation "org.finos.timebase-ce:timebase-client:6.1.14"
implementation "com.epam.deltix:gflog-core:3.0.3"
}
info
Please refer to TimeBase Tutorial for more information.
Step 4: Read Data
Create a TimeBase Cursor to read data from a sample stream.
- Java
- 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());
}
}
}
}
import tbapi
timebase = 'dxtick://localhost:8011'
try:
db = tbapi.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.
info
Please refer to TimeBase Tutorial for more information.
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.
- Get an official Docker image.
- Open TimeBase Admin to view sample streams.
tip
TimeBase Web Admin default credentials: admin/admin.
# make sure the timebase-network was created
docker network ls
# run the timebase web admin container
docker run --rm -d \
--name timebase-admin \
--network timebase-network
-p 8099:8099 \
-e "JAVA_OPTS=-Dtimebase.url=dxtick://timebase-server:8011" \
--ulimit nofile=65536:65536 \
epam/timebase-ws-server:1.0
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.