🦆
BlockDuck
  • BlockDuck
    • Introduce
    • Why BlockDuck
  • Getting Started
    • Quickstart
    • How to build
    • Try your first query
    • Supported Blockchains
  • Functionality
    • Basic EVM structure table function
      • Blocks
      • Transactions
      • Logs
      • Traces
      • Traces v2
      • Latest Block Number
    • Customized EVM contact table function
      • Contract Events
      • Contract view function
    • Bitcoin table function
      • Blocks
      • Transactions
      • Outputs
      • Inputs
    • Parameter Setting
      • Verbose logging
      • Configs setting
  • Types
    • Types Mapping between DuckDB and EVM
  • Examples
    • Python examples
      • Hourly ERC20 transfer volumn monitor page
Powered by GitBook
On this page
  • Clone repo
  • Managing dependencies
  • Compile
  • Tests
  1. Getting Started

How to build

PreviousQuickstartNextTry your first query

Last updated 3 months ago

Clone repo

git clone --recurse-submodules git@github.com:luohaha/BlockDuck.git

--recurse-submodules is need because BlockDuck has two submodules.

Managing dependencies

Currently, BlockDuck have only one dependency which is openssl. And we use to manage this dependency. You can run the following cmds to install and enable VCPKG.

cd <your-working-dir-not-the-plugin-repo>
git clone https://github.com/Microsoft/vcpkg.git
sh ./vcpkg/scripts/bootstrap.sh -disableMetrics
export VCPKG_TOOLCHAIN_PATH=`pwd`/vcpkg/scripts/buildsystems/vcpkg.cmake

Compile

Then we can use make to build the extension:

make

The BlockDuck extension binary will be:

./build/release/extension/blockduck/blockduck.duckdb_extension

Tests

In BlockDuck, there are three types of test cases:

Sqllogictest

run sqllogictest:

make test

UnitTest

build and run unittest:

cd unittest/
cmake .
make
./BlockDuckTests

CorrectnessTest

  • Run all tests

cd correctness_test/
python run_tests.py
  • Run tests by filter

cd correctness_test/
python -m unittest discover -s tests -p "test_eth_transactions.py"
python -m unittest discover -s tests -p "test_*.py"
VCPKG