Skip to content

Commit c050891

Browse files
authored
Merge pull request #403 from eth-pkg/upcoming/bookworm/amd64/eth-node-lodestar/1.26.0-1
upcoming/bookworm/amd64/eth-node-lodestar/1.26.0-1
2 parents 32ae1a5 + 7dead43 commit c050891

File tree

21 files changed

+712
-2
lines changed

21 files changed

+712
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
eth-node-lodestar (1.26.0-1) bookworm; urgency=medium
2+
3+
* Support for 1.26.0-1
4+
5+
-- Eniko Nagy <[email protected]> Wed, 05 Feb 2025 14:35:30 +0100
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name = "eth-node-lodestar"
2+
architecture = "any"
3+
summary = "TypeScript Implementation of Ethereum Consensus "
4+
conflicts = []
5+
recommends = []
6+
provides = ["eth-node-consensus-client (= 1)"]
7+
suggests = ["eth-node (= 1)"]
8+
# node-gyp, not entirely sure if needed, let's add it
9+
depends = ["python3"]
10+
add_files = [
11+
"debian/lodestar /usr/lib/eth-node-lodestar/bin",
12+
"packages /usr/lib/eth-node-lodestar",
13+
"node_modules /usr/lib/eth-node-lodestar"
14+
]
15+
add_links = ["/usr/lib/eth-node-lodestar/bin/lodestar /usr/bin/lodestar"]
16+
add_manpages = []
17+
long_doc = """
18+
Lodestar is a TypeScript implementation of the
19+
Ethereum Consensus specification developed by ChainSafe Systems.
20+
"""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name = "eth-node-lodestar"
2+
maintainer = "Eniko Nagy <[email protected]>"
3+
section = "net"
4+
variants = []
5+
build_depends = [
6+
#"build-essential",
7+
"libssl-dev",
8+
"libjpeg-dev",
9+
"libgif-dev",
10+
"libpixman-1-dev",
11+
"libpango1.0-dev",
12+
"libffi-dev",
13+
"git",
14+
#"docker-ce",
15+
#"docker-ce-cli",
16+
#"containerd.io",
17+
#"docker-buildx-plugin",
18+
#"docker-compose-plugin"
19+
]
20+
packages = ["eth-node-lodestar"]
21+
skip_debug_symbols = true
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[verify]
2+
package_hash=[
3+
{ hash="bc80d03e06295d4365305e800eeb61465a41cbd0", name= "eth-node-lodestar_1.26.0-1.dsc"},
4+
{ hash="2cb5b6b9725127aeb566fab783bc23a9b0c83768", name= "eth-node-lodestar_1.26.0.orig.tar.gz"},
5+
{ hash="3e383c87fbde7b18baf784fe5d40d9fb5de475e1", name= "eth-node-lodestar_1.26.0-1.debian.tar.xz"},
6+
{ hash="5a3524c43c089374832fa54e2a91fcd2f5663df1", name= "eth-node-lodestar_1.26.0-1_amd64.deb"},
7+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package_fields]
2+
spec_file = "eth-node-lodestar.sss"
3+
package_name = "eth-node-lodestar"
4+
version_number = "1.26.0"
5+
revision_number = "1"
6+
homepage="https://github.com/ChainSafe/lodestar"
7+
8+
[package_type]
9+
# virtual | git | default
10+
package_type="default"
11+
tarball_url = "https://github.com/ChainSafe/lodestar/archive/refs/tags/v1.26.0.tar.gz"
12+
## Provided by debian package maintainer not by team developing the software
13+
tarball_hash = "0b0cef80ae46655a9400c3c7053b4ae772056b459bedacf478238e25e93054eb"
14+
15+
[package_type.language_env]
16+
language_env = "javascript"
17+
node_version = "20.12.2"
18+
# https://nodejs.org/download/release/v20.12.2
19+
node_binary_url = "https://nodejs.org/download/release/v20.12.2/node-v20.12.2-linux-x64.tar.gz"
20+
node_binary_checksum = "f8f9b6877778ed2d5f920a5bd853f0f8a8be1c42f6d448c763a95625cbbb4b0d"
21+
yarn_version = "1.22.19"
22+
23+
[build_env]
24+
codename="bookworm"
25+
arch = "amd64"
26+
pkg_builder_version = "0.2.9"
27+
debcrafter_version = "2711b53"
28+
run_lintian=true
29+
run_piuparts=true
30+
run_autopkgtest=true
31+
lintian_version="2.116.3"
32+
piuparts_version="1.1.7"
33+
autopkgtest_version="5.28"
34+
sbuild_version="0.85.6"
35+
# package directory
36+
workdir="~/.pkg-builder/packages/bookworm"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Must not use `* as yargs`, see https://github.com/yargs/yargs/issues/1131
2+
import yargs from "yargs";
3+
import {hideBin} from "yargs/helpers";
4+
import {registerCommandToYargs} from "@lodestar/utils";
5+
import {cmds} from "./cmds/index.js";
6+
import {globalOptions, rcConfigOption} from "./options/index.js";
7+
import {getVersionData} from "./util/version.js";
8+
9+
const {version} = getVersionData();
10+
const topBanner = `🌟 Lodestar: TypeScript Implementation of the Ethereum Consensus Beacon Chain.
11+
* Version: ${version}
12+
* by ChainSafe Systems, 2018-${new Date().getFullYear()}`;
13+
const bottomBanner = `📖 For more information, check the CLI reference:
14+
* https://chainsafe.github.io/lodestar/reference/cli
15+
16+
✍️ Give feedback and report issues on GitHub:
17+
* https://github.com/ChainSafe/lodestar`;
18+
19+
export const yarg = yargs((hideBin as (args: string[]) => string[])(process.argv));
20+
21+
/**
22+
* Common factory for running the CLI and running integration tests
23+
* The CLI must actually be executed in a different script
24+
*/
25+
export function getLodestarCli(): yargs.Argv {
26+
const lodestar = yarg
27+
.env("LODESTAR")
28+
.parserConfiguration({
29+
// As of yargs v16.1.0 dot-notation breaks strictOptions()
30+
// Manually processing options is typesafe tho more verbose
31+
"dot-notation": false,
32+
})
33+
.options(globalOptions)
34+
// blank scriptName so that help text doesn't display the cli name before each command
35+
.scriptName("")
36+
.demandCommand(1)
37+
// Control show help behaviour below on .fail()
38+
.showHelpOnFail(false)
39+
.usage(topBanner)
40+
.epilogue(bottomBanner)
41+
.version(topBanner)
42+
.alias("h", "help")
43+
.alias("v", "version")
44+
.recommendCommands();
45+
46+
// yargs.command and all ./cmds
47+
for (const cmd of cmds) {
48+
registerCommandToYargs(lodestar, cmd);
49+
}
50+
51+
// throw an error if we see an unrecognized cmd
52+
lodestar.recommendCommands().strict();
53+
lodestar.config(...rcConfigOption);
54+
55+
return lodestar;
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import fs from "node:fs";
2+
import path from "node:path";
3+
import {fileURLToPath} from "node:url";
4+
import {findUpSync} from "find-up";
5+
import {readAndGetGitData} from "./gitData/index.js";
6+
7+
// Global variable __dirname no longer available in ES6 modules.
8+
// Solutions: https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules
9+
// eslint-disable-next-line @typescript-eslint/naming-convention
10+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
11+
12+
type VersionJson = {
13+
/** "0.28.2" */
14+
version: string;
15+
};
16+
17+
const BRANCH_IGNORE = /^(HEAD|master|unstable|main)$/;
18+
19+
/**
20+
* Gathers all information on package version including Git data.
21+
* @returns a version string, e.g.
22+
* - Stable release: `v0.36.0/80c248bb`
23+
* - Dev release: `v0.36.0-dev.80c248bb/80c248bb`
24+
* - Test branch: `v0.36.0/developer-feature/80c248bb`
25+
*/
26+
export function getVersionData(): {
27+
version: string;
28+
commit: string;
29+
} {
30+
const parts: string[] = [];
31+
32+
/** Returns local version from `lerna.json` or `package.json` as `"0.28.2"` */
33+
const localVersion = readCliPackageJson() || readVersionFromLernaJson();
34+
if (localVersion) {
35+
parts.push(`v${localVersion}`);
36+
}
37+
38+
const {branch, commit} = readAndGetGitData();
39+
40+
// Add branch only if not present and not an ignore value
41+
if (branch && !BRANCH_IGNORE.test(branch)) parts.push(branch);
42+
43+
// Add commit only if present. 7 characters to be consistent with Github
44+
if (commit) {
45+
const commitShort = commit.slice(0, 7);
46+
// Don't add commit if it's already in the version string (dev versions)
47+
if (!localVersion || !localVersion.includes(commitShort)) {
48+
parts.push(commitShort);
49+
}
50+
}
51+
52+
return {
53+
// Guard against empty parts array
54+
version: parts.length > 0 ? parts.join("/") : "unknown",
55+
commit,
56+
};
57+
}
58+
59+
/** Read version information from lerna.json */
60+
function readVersionFromLernaJson(): string | undefined {
61+
const filePath = findUpSync("lerna.json", {cwd: __dirname});
62+
if (!filePath) return undefined;
63+
64+
const lernaJson = JSON.parse(fs.readFileSync(filePath, "utf8")) as VersionJson;
65+
return lernaJson.version;
66+
}
67+
68+
/** Read version information from package.json */
69+
function readCliPackageJson(): string | undefined {
70+
const filePath = findUpSync("package.json", {cwd: __dirname});
71+
if (!filePath) return undefined;
72+
73+
const packageJson = JSON.parse(fs.readFileSync(filePath, "utf8")) as VersionJson;
74+
return packageJson.version;
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Must not use `* as yargs`, see https://github.com/yargs/yargs/issues/1131
2+
import yargs from "yargs";
3+
import {hideBin} from "yargs/helpers";
4+
import {registerCommandToYargs} from "@lodestar/utils";
5+
import {cmds} from "./cmds/index.js";
6+
7+
const topBanner = `Beacon chain multi-purpose and debugging tool.
8+
9+
Flare is a sudden brief burst of bright flame or light.
10+
In the wrong hands, can lead people astray.
11+
Use with care.
12+
13+
* by ChainSafe Systems, 2018-${new Date().getFullYear()}`;
14+
const bottomBanner = `
15+
✍️ Give feedback and report issues on GitHub:
16+
* https://github.com/ChainSafe/lodestar`;
17+
18+
export const yarg = yargs((hideBin as (args: string[]) => string[])(process.argv));
19+
20+
/**
21+
* Common factory for running the CLI and running integration tests
22+
* The CLI must actually be executed in a different script
23+
*/
24+
export function getCli(): yargs.Argv {
25+
const lodestar = yarg
26+
.env("FLARE")
27+
.parserConfiguration({
28+
// As of yargs v16.1.0 dot-notation breaks strictOptions()
29+
// Manually processing options is typesafe tho more verbose
30+
"dot-notation": false,
31+
})
32+
// blank scriptName so that help text doesn't display the cli name before each command
33+
.scriptName("")
34+
.demandCommand(1)
35+
// Control show help behaviour below on .fail()
36+
.showHelpOnFail(false)
37+
.usage(topBanner)
38+
.epilogue(bottomBanner)
39+
.version(topBanner)
40+
.alias("h", "help")
41+
.alias("v", "version")
42+
.recommendCommands();
43+
44+
// yargs.command and all ./cmds
45+
for (const cmd of cmds) {
46+
registerCommandToYargs(lodestar, cmd);
47+
}
48+
49+
// throw an error if we see an unrecognized cmd
50+
lodestar.recommendCommands().strict();
51+
52+
return lodestar;
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Must not use `* as yargs`, see https://github.com/yargs/yargs/issues/1131
2+
import yargs from "yargs";
3+
import {hideBin} from "yargs/helpers";
4+
import {registerCommandToYargs} from "@lodestar/utils";
5+
import {getVersionData} from "../utils/version.js";
6+
import {cmds, proverProxyStartCommand} from "./cmds/index.js";
7+
import {globalOptions} from "./options.js";
8+
9+
const {version} = getVersionData();
10+
const topBanner = `🌟 Lodestar Prover Proxy: Ethereum RPC proxy for RPC responses, verified against the trusted block hashes.
11+
* Version: ${version}
12+
* by ChainSafe Systems, 2018-${new Date().getFullYear()}`;
13+
const bottomBanner = `📖 For more information, check the CLI reference:
14+
* https://chainsafe.github.io/lodestar/reference/cli
15+
16+
✍️ Give feedback and report issues on GitHub:
17+
* https://github.com/ChainSafe/lodestar`;
18+
19+
export const yarg = yargs((hideBin as (args: string[]) => string[])(process.argv));
20+
21+
/**
22+
* Common factory for running the CLI and running integration tests
23+
* The CLI must actually be executed in a different script
24+
*/
25+
export function getLodestarProverCli(): yargs.Argv {
26+
const prover = yarg
27+
.env("LODESTAR")
28+
.parserConfiguration({
29+
// As of yargs v16.1.0 dot-notation breaks strictOptions()
30+
// Manually processing options is typesafe tho more verbose
31+
"dot-notation": false,
32+
})
33+
.options(globalOptions)
34+
// blank scriptName so that help text doesn't display the cli name before each command
35+
.scriptName("")
36+
.demandCommand(1)
37+
// Control show help behaviour below on .fail()
38+
.showHelpOnFail(false)
39+
.usage(topBanner)
40+
.epilogue(bottomBanner)
41+
.version(topBanner)
42+
.alias("h", "help")
43+
.alias("v", "version")
44+
.recommendCommands();
45+
46+
// yargs.command and all ./cmds
47+
for (const cmd of cmds) {
48+
registerCommandToYargs(prover, cmd);
49+
}
50+
51+
// Register the proxy command as the default one
52+
registerCommandToYargs(prover, {...proverProxyStartCommand, command: "*"});
53+
54+
// throw an error if we see an unrecognized cmd
55+
prover.recommendCommands().strict();
56+
57+
return prover;
58+
}

0 commit comments

Comments
 (0)