@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
20 lines • 656 B
JavaScript
import { bytesToInt, intToBytes } from "@lodestar/utils";
import { ClientCode } from "../execution/index.js";
export function getLodestarClientVersion(info) {
return {
code: ClientCode.LS,
name: "Lodestar",
version: info?.version ?? "",
commit: info?.commit?.slice(0, 8) ?? "",
};
}
/**
* Serializes a custody group count value into a Uint8Array suitable for the the ENR field `cgc`.
*/
export function serializeCgc(cgc) {
return intToBytes(cgc, Math.ceil(Math.log2(cgc + 1) / 8), "be");
}
export function deserializeCgc(cgcBytes) {
return bytesToInt(cgcBytes, "be");
}
//# sourceMappingURL=metadata.js.map