Ostracon is a shared-log system build on the persistence-first strategy introduced by Scalog.
Tested on Ubuntu 18.04 and macOS Big Sur.
Prerequisites:
- Go (version >= 1.15). If you're using Linux, you can use
./scripts/install_go.sh && source ~/.profile
. - Make
- Clone this repository and go in the root-folder.
git clone https://github.com/nathanieltornow/ostracon.git && \
cd ostracon
- Start a sample cluster.
make start-cluster
- In another terminal, build the client-library.
make
- Append and subscribe on the shared log. For example:
# Append the record "HelloWorld" to color 0
./ostracon -a -record HelloWorld -color 0
# Subscribe to all records on color 1, starting from sequence-number 8
./ostracon -s -gsn 8 -color 1
# Print usage
./ostracon --help
The cluster can be configured by modifying cluster.config.yaml
, where a list of
shards (sequencer-shards and record-shards) are defined, which will be started on
make start-cluster
.
Important: Don't modify the system at runtime of a cluster.
A shard is described using the following properties:
type: If it is a record- or a sequencer-shard (sequencer or record).
ip: The IP-address, where the shard should be served.
parent_ip: The IP-address of the overlying shard.
root: If the shard is the root of the system (only for sequencer-shards).
Exactly one shard has to be root!
color: Distinct color, that a shard represents (only for sequencer-shards).
interval: The intervall with which order-requests should be sent to parents.
E.g. 1ms, 10s, 900us, ...
disk: Path to where the log should be stored (only for record-shards).
Has to be distinct in order to prevent overriding!