Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional build instructions #491

Open
Sjors opened this issue Aug 6, 2024 · 1 comment
Open

Additional build instructions #491

Sjors opened this issue Aug 6, 2024 · 1 comment

Comments

@Sjors
Copy link

Sjors commented Aug 6, 2024

It's not very clear currently how to build this.

The instructions here only describe dependencies, but not the actual build process: https://github.com/Blockstream/greenlight/tree/main/libs/gl-client-py

After looking through some other issues and trial and error, I think you need to do (tried with PyEnv, and avoiding virtual env stuff):

cd libs/gl-client-py
maturin build
cd ../..
cd target/wheels
pip3 install target/wheels/*.whl
cd ../../tools/glcli
pip install .

For general sanity it would be nice if there was a way to just build the Rust application and avoid Python environment hell.

@arcadeJHS
Copy link

arcadeJHS commented Dec 10, 2024

Same here.
I was trying to install the library on a Mac M2, in a Docker instance, using the imagepython:3.10-slim, which (I am not sure) is not yet a supported platform.

So i built it from source.

In addition to the dependencies listed here https://github.com/Blockstream/greenlight/tree/main/libs/gl-client-py, I also had to install protobuf-compiler.

The following is the significant part of my Dockerfile:

FROM python:3.11-slim

# Install dependencies
RUN apt-get update && \
    apt-get install -y \
    curl \
    build-essential \
    git \
    pkg-config \
    libssl-dev \
    libgmp-dev \
    libsqlite3-dev \
    libtool \
    valgrind \
    protobuf-compiler

# Install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Install maturin
RUN pip install --no-cache-dir maturin
ENV PATH="/root/.local/bin:${PATH}"

# Manually build and install gl-client Python binding and glcli tool
RUN git clone https://github.com/Blockstream/greenlight.git && \
    cd greenlight/libs/gl-client-py && \
    maturin build && \
    cd greenlight/libs/gl-cli && \
    maturin build && \
    pip install /greenlight/target/wheels/gl*.whl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants