Skip to content
/ tycho Public

Reference implementation of Tycho protocol.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

broxus/tycho

Repository files navigation

tycho

Pre-requisites

Testing

To run tests from ci:

just ci

To interactivly choose what to run:

just

To format code:

just fmt

Local Network

# Generate zerostate config stub (with optional --force flag):
just init_zerostate_config
# Generate node config sub (with optional --force flag):
just init_node_config
# Generate a local network of 3 nodes (with optional --force flag):
just gen_network 3

# Start nodes in separate terminals or spawn them with `&`:
just node 1
just node 2
just node 3

Note

By default the dev profile is used. Use this env to specify a different profile:

export TYCHO_BUILD_PROFILE=release

Prebuilt RocksDB

By default, we compile RocksDB (a C++ project) from source during the build. By linking to a prebuilt copy of RocksDB this work can be avoided entirely. This is a huge win, especially if you clean the ./target directory frequently.

To use a prebuilt RocksDB, set the ROCKSDB_LIB_DIR environment variable to a location containing librocksdb.a:

export ROCKSDB_LIB_DIR=/usr/lib/
cargo build -p tycho-cli

Note, that the system must provide a recent version of the library which, depending on which operating system you're using, may require installing packages from a testing branch. Or you could build the RocksDB from source manually:

cd /path/to
git clone https://github.com/facebook/rocksdb.git
cd rocksdb
git checkout v8.10.0
mkdir -p build && cd ./build
cmake -DWITH_LZ4=ON -DWITH_ZSTD=ON -DWITH_JEMALLOC=ON -DCMAKE_BUILD_TYPE=Release ..
make -j16 rocksdb
export ROCKSDB_LIB_DIR=/path/to/rocksdb/build