Each service contains a Dockerfile in the service root directory.
-
Install rustup from [rustup.rs].
-
Make sure that openssl is installed:
-
macOS:
$ brew install openssl@1.1 -
Arch Linux
$ sudo pacman -S pkg-config openssl -
Debian and Ubuntu
$ sudo apt-get install pkg-config libssl-dev -
Fedora
$ sudo dnf install pkg-config openssl-devel
-
-
Make sure protobuf is installed and the version (
$ protoc --version) is at leastv3.15.0.If protobuf version is too old, you may see the following error:
Explicit 'optional' labels are disallowed in the Proto3 syntax. -
Install
protoc-gen-openapiv2. You may find useful the following Action we use in our Github pipeline.If not installed, you may see the following error:
Error: Custom { kind: Other, error: "protoc failed: Unknown flag: --openapiv2_opt\n" }
-
Clone the repository and enter the service directory
git clone git@github.com:blockscout/blockscout-rs.git cd blockscout-rs/{service-name} -
Build the release version:
cargo build --release --bin {service-name}-server -
You can find the built binary in
target/release/folder.
Another way to install the binary without cloning the repository is to use cargo straightway:
cargo install --git https://github.com/blockscout/blockscout-rs {service-name}-serverIn that case, you can run the binary using just {service-name}-server.
Most of the services contain justfiles inside root directories (https://github.com/casey/just).
Sometimes using that during development may make your a little easier.