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

wip: add lodestar support #210

Closed

Conversation

tupakkatapa
Copy link
Contributor

@tupakkatapa tupakkatapa commented Apr 11, 2023

This is our attempt to add the Lodestar package to this repository. I've worked on this for a couple of weeks, but I'm sorry to say that I was not able to complete it since I don't have a time for it. We would like to see the Lodestar node to be implemented in the future so I present you this draft.

The main reason why this was difficult task to complete is the way the Lodestar is packaged. It uses Yarn workspaces to make up the worktree consisting of the subpackages. In Nix, packages using Yarn are usually packaged with the mkYarnPackage module. Unfortunately there is no documentation, but here is the default.nix for it.

I've found that the correct way might be to use workspaceDependencies argument since it's the only way I can get the subpackages to start building. However, it ends up with the following error:

yarn install v1.22.19
[1/4] Resolving packages...
error Couldn't find any versions for "@lodestar/config" that matches "^1.7.2" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
...

This is the current state, as you can see if you try to build it (default_2nd.nix). Without the workspaceDependencies, the main package.json will build "successfully" but the binaries are not found (default_1st.nix). We hope that somebody will have the time and knowledge to look into this.

Links

Using stdenv.mkDerivation:

Using mkYarnPackage:

Using mkYarnPackage with workspaceDependencies:

@tupakkatapa
Copy link
Contributor Author

The error may be caused by subpackages sharing the same yarn.lock file. One solution could be to create separate lock files for each subpackage. However, I don't have enough knowledge in the TypeScript field to be sure.

@aldoborrero
Copy link
Collaborator

aldoborrero commented Apr 12, 2023

@tupakkatapa many thanks for attempting to package Loderstar! It's, by no means, an easy task!!!

As a third alternative, would you mind trying dream2nix?

It supports NodejJS out of the box and maybe, I think can be the definitive way. We can also ask @DavHau for assistance or even improve dream2nix if necessary with the discoveries we might find with Lodestar.

I'll try to assist, coordinate and help on this as much as I can (but will depend on how much spare time I have).

@tupakkatapa
Copy link
Contributor Author

@aldoborrero Yes, it's definitely not as straight forward as it first seemed. I haven't come across dream2nix, might give it a try at some point.

I will be in touch if I do decide to give it a try and come across any major issues. I don't have the time at the moment, so if someone has the interest to take a catch from this, it would be much appreciated. Thanks for the response Aldo.

@aldoborrero
Copy link
Collaborator

aldoborrero commented Feb 12, 2024

@tupakkatapa I'm going to close this PR in favor of #444 (which is still a WIP).

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

Successfully merging this pull request may close these issues.

2 participants