Compile & Run Cardano SL Node


#1

Hi guys,
I am working on running Cardano SL from source.
I get to running this command:
$ nix-build -A cardano-sl-node-static --cores 0 --max-jobs 2 --no-build-output --out-link master
but it fails with this error:
error: attribute ‘cardano-sl-node’ in selection path ‘cardano-sl-node’ not found

anyone knows why cardano-sl-node attr is missing?

Thanks in advance
R


#2

Try building it with cardano-sl-static

$ nix-build -A cardano-sl-static --cores 0 --max-jobs 2 --no-build-output --out-link master

See this PR


#3

please update the document
https://github.com/input-output-hk/cardano-sl/blob/develop/docs/how-to/build-cardano-sl-and-daedalus-from-source-code.md


#4

for what it is worth I use -A cardano-sl-wallet to build the node see default.nix for targets.


#5

#6

Build on Ubuntu 16.04 with stack works fine.

Just add nix settings into stack configuration and follow Stack with Nix for system libraries (mixed mode) Instruction.


#7

@p-alik @h4ck3rm1k3 @liming_ihaomo @zmeel
thanks guys. perfect ! I managed to build it now. I have a new questions now. I get the following error after running the node:

ConfigurationParseFailure “node/configuration.yaml” (InvalidYaml (Just (YamlException “Yaml file not found: node/configuration.yaml”)))

Any ideas ? I found a list of all parameters as part of documentation but I can really get my head around using it properly.

What I am suppose to do next ? any help is appreciated.


#8

can you copy it from ./lib/configuration.yaml


#9

@Raha_Mohebbi,

judging from the error message, I would say you haven’t the file node/configuration.yaml.

Here original node/configuration.yaml.

@h4ck3rm1k3 wrote a very helpful installation instruction. Just follow it to avoid troubles.


#10

Thanks this ^^ worked for me too.

Now when I run master/bin/cardano-node-simple I get error:

cardano-node-simple: MissingSystemStartTime

So a little research shows me this Issue gives hints to the solution. I’ll post a new thread if I can’t solve it. I’ll try to make a tutorial covering all these issues once I’m done.


#11

@devcap: That’s my issue on Github :sunglasses:

The solution is quite simple. There is a script you need to build that starts your node and connect it to the mainnet. You build the script with this:

nix-build -A connectScripts.mainnetWallet -o connect-to-mainnet


#12

@Raha_Mohebbi idk if this will work for you, but if I run master/bin/cardano-node-simple then I DON’T get your yaml error, but if I cd into master and then run bin/cardano-node-simple then I get your exact yaml error. So maybe try running the node from project root


#13

@zmeel
Thanks I ran nix-build -A connectScripts.mainnetWallet -o connect-to-mainnet like you said and it completed after a few minutes. It created this script which I ran:

./connect-to-mainnet

How to connect to cluster


#14

@devcap And? Did your node work? Did it connect to the mainnet?


#15

yes, it did run successfully! Lots of cool activity going on in the log. I think next I’ll lookup the API and try to work with it from command-line.

Next:
I want to understand better how this differs from the stuff in cardano-sl/scripts/launch and cardano-sl/scripts/launch/connect-to-cluster as it sounds similar and is referenced in cardanodocs.com/technical/launcher. Any ideas? I’ll research and try to follow those instructions too.

I also want to understand how or why the wallet is a separate application. When I ran a full bitcoin node a while ago, the features were all part of the same Bitcoin Core program, I believe. You can also run a bitcoin ‘lite node’ which is like a limited full node, for wallet functionality only.


#16

I think the wallet is just a nice interface for the node. With the connect-to mainnet script you start a node-with-wallet. Most/all of the API’s are for wallet handling.


#17

what OS are you guys using ? Win/Linux/OSX ?


#18

Linux and OSX


#19

fyi everyone: The build process on OSX is surprisingly easy!


#20

where can i find the cert file for postman?