Can't compile cardano-node from source

So I am really confused on how to run a stake pool. The documentation just is not making sense to me.

I am following instructions to compile cardano-node from source using both nix and cabal (Why two different ways to build?). More specifically I am following, step by step:

cabal
https://docs.cardano.org/projects/cardano-node/en/latest/getting-started/install.html

nix
https://docs.cardano.org/projects/cardano-node/en/latest/getting-started/building-the-node-using-nix.html

The first method (cabal) fails with:
cabal: Could not resolve dependencies:
[__0] trying: Win32-network-0.1.0.0 (user goal)
[__1] trying: base-4.12.0.0/installed-4.12.0.0 (dependency of Win32-network)
[__2] next goal: cardano-api (user goal)
[__2] rejecting: cardano-api-1.27.0 (conflict:
base==4.12.0.0/installed-4.12.0.0, cardano-api => base>=4.14 && <4.15)
[__2] fail (backjumping, conflict set: base, cardano-api)
After searching the rest of the dependency tree exhaustively, these were the
goals Iā€™ve had most trouble fulfilling: base, Win32-network, cardano-api

When building with nix process ends normally, but I donā€™t understand whan coomes out of it. I expect to find executables like cardano-cli but the only thing I see is a sybolic link called ā€œmainnet-node-localā€. The tutorial explicitly says to call ./mainnet-node-local but of course that makes no sense, mainnet-node-local is a folder that contains bin/cardano-node-mainnet. Is this the same as cardano-cli?

I am sorry if these are basic questions, but I am extremely frustrated. Why are the commands in the documentation not working? What exactly am I expecting as output, one executable, 2 3?

I am trying to install on ubuntu 20.04, 16GB Ram, 8 cpuā€™s, all dependencies installed as per documentation.

1 Like

Ok, why donā€™t u try my topic?

You will thank you later :slight_smile:

But if u decided to follow the guide, perform a new fresh installation of server

Hi Alex, I was checking your gists earlier. To be honest, all of this is coming like a steamroller. I might be biting too much of a bullet here.

Even though I am a new to crypto, I consider myself quite knowledgeable in *nix stuff.

I am trying to approach this step by step and naturally my first thought was: ā€œLetā€™s build this thing firstā€. Boy oh boy was I wrong. Iā€™ll go through your topic, thanks for the help.

1 Like

When u will build the node just replace 1.25.1 version with 1.27.0

Quick question, I have enables ssh login only via public key authentication. This has the effect that the 2fa authentication step is skipped. Is this expected or did I configure something wrongly?

It is ok, u did it well

might you try to use ghc version 8.6.5

or just skip the compilation and download the binaries from github:

Same ol mistake man, everything was going great.

Warning: Requested index-state 2021-03-15T00:00:00Z is newer than
ā€˜hackage.haskell.orgā€™! Falling back to older state (2021-03-14T23:47:09Z).
Resolving dependenciesā€¦
cabal: Could not resolve dependencies:
[__0] trying: Win32-network-0.1.0.0 (user goal)
[__1] trying: base-4.12.0.0/installed-4.12.0.0 (dependency of Win32-network)
[__2] next goal: cardano-api (user goal)
[__2] rejecting: cardano-api-1.27.0 (conflict:
base==4.12.0.0/installed-4.12.0.0, cardano-api => base>=4.14 && <4.15)
[__2] fail (backjumping, conflict set: base, cardano-api)
After searching the rest of the dependency tree exhaustively, these were the
goals Iā€™ve had most trouble fulfilling: base, Win32-network, cardano-api

Yeah, I was using a newer version and switched to 8.6.5 but I am still getting complains about ā€œbase, Win32-network, cardano-apiā€ 7 straight hours trying to make it work at no avail :frowning:

I might have to do that, but I would really like to be able to complete the build process. Donā€™t wanna trust no binary.

I have an Ubuntu 20.04 - will try to go through on this install againā€¦

you mean nobody? those binaries are official build from IOHK.

Yeah, precompiled seems to be my only option. Canā€™t shake the feeling of defeat though. Weird that itā€™s so hard to simply build a program from source.

Thousands have built it, itā€™s not so hard - but youā€™d want to ensure ghc --version says (8.10.2 - 8.10.4) and cabal --version is 3.4.0, and youā€™re on latest node release tag

Support for 8.6.5 is completely dropped as of 1.27

1 Like

Thousands have built it, itā€™s not so hard - but youā€™d want to ensure ghc --version says (8.10.2 - 8.10.4) and cabal --version is 3.4.0, and youā€™re on latest node release tag

Thatā€™s what is frustrating me the most, I know it shouldnā€™t be that complicated.

Really confused about dependencies, tried and failed with ghc-10.2 and got the aforementioned errors. In the forum I saw using 8.6.5 should do the trick, but it didnā€™t.

I am just really confused because I have been following the documentation step by step.

Iā€™ll keep grinding.

You need to be precise, the session that youā€™re running in should list accurate ghc as well as cabal version at command line (to avoid any errors like multiple versions being available, and one in your sessionā€™s $PATH being incorrect) as per my previous message, and then run the buuld commands from the same session

Yeah sorry about that. Post can not be edited anymore.

Running
ghc 8.10.4
cabal 3.4.0

Got it to build!! Thanks for the help.

I am now running into the same error as: CNTools and gLiveView error failed to load common env file

Itā€™s a bit different though
Guild LiveView version checkā€¦
Failed to query protocol-parameters from node, not yet fully started?
ERROR: CNTools failed to load common env file
Please verify set values in ā€˜User Variablesā€™ section in env file or log an issue on GitHub

Doing some reading to see how to solve it.
sudo systemctl status cnode, shows the node is running at high CPU load

Having just started node, you might want to wait for the node to sync through to shelley fork (on mainnet thatā€™s epoch 208) , as until then some of the CLI queries will not resolve - also, it wouldnā€™t create the socket file for communication right after launching the node :slight_smile:

PS: Since youā€™re using CNTools, as documented on guild doco home page, it is strongly recommended that youā€™d go through the setup on testnet first.

Gotcha,

guild doco home page

Is that, this: Guild Operators

Thanks for the replies, I am still quite overwhelmed by all the resources. For example I havenā€™t found exactly the differences between testnet and mainnet, excluding the obvious fact that one is for testing.