tdiesler / nessus-cardano

A Cardano playground that explores various build/runtime aspects of the project. Something like an incubation space, before we are propose changes upstream. The initial focus is on "container first" for the Cardano node.
91 stars 29 forks source link

Add support for cncli on arm64 #61

Closed tdiesler closed 3 years ago

DiazRock commented 3 years ago

One way is compiling from source. Which is not hard. And upload the binary. We can attatch a CI tool, in order to recompiling every new release of the source code. (I don't know how to do it, but sounds nice to me ). On the other hand, we have the dockerized environment, using a compatible [docker image of cardano for arm64](). We can create a Dockerfile and run the steps from guild operators tutorial.

tdiesler commented 3 years ago

One way is compiling from source

Ok, let's do that. If you have a bash script that works on arm64, I can do the integration with the Nix build. Ideally, your script would work on x86_64 as well.

DiazRock commented 3 years ago

I just follow the installation guide from the repo. So this is my script:

# Install Rust
mkdir -p $HOME/.cargo/bin
chown -R $USER\: $HOME/.cargo
touch $HOME/.profile
chown $USER\: $HOME/.profile
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup install stable
rustup default stable
rustup update
rustup component add clippy rustfmt

# Dependencies
sudo apt-get update -y && sudo apt-get install -y automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf

# Reload source
source $HOME/.cargo/env

# The cncli source code
git clone --recurse-submodules https://github.com/AndrewWestberg/cncli
cd cncli
cargo install --path . --force

After that, to check that you have compiled the binary, you can do:

cncli --version
tdiesler commented 3 years ago

Ok, thanks. Would you like to have a go at integrating this with the Nix build or shall I?

DiazRock commented 3 years ago

Go ahead commander.

DiazRock commented 3 years ago

Nevertheless, I'm using a k8s cluster. So my nodes are isolated pods, and the binaries of cardano-node's are inside containers that compose those pods. So, how do I connect systemd services that needs cncli in order to run correctly? For example, the systemd service cncli-sendtip.service needs to point to /usr/local/bin/cardano-node. But how can I do to point a binary of a container? One posible solution is "export" the binary from the container using a volume. Do you think is a good idea @tdiesler ?

tdiesler commented 3 years ago

Blocked by https://github.com/AndrewWestberg/cncli/issues/83