This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage | |
// node slot_finder.mjs chiado | |
const genesisTimestamp = getGenesis(); | |
const interval = 8192 * 5; | |
const now = Math.floor(Date.now() / 1000); | |
const futureDate = new Date(); | |
futureDate.setMonth(futureDate.getMonth() + 2); | |
const futureTimestamp = Math.floor(futureDate.getTime() / 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ssz } from "@lodestar/types"; | |
import { createBeaconConfig } from "@lodestar/config"; | |
import { fromHexString, toHexString } from "@chainsafe/ssz"; | |
import bls from "@chainsafe/bls"; | |
// To run, first install dependencies: | |
// $ npm install @lodestar/types @lodestar/config @chainsafe/ssz @chainsafe/bls | |
// | |
// Then | |
// $ node signature_verify.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {randomBytes} from "node:crypto"; | |
import {compress} from "snappyjs"; | |
import {phase0, ssz} from "@lodestar/types"; | |
import {BitArray} from "@chainsafe/ssz"; | |
// To run: | |
// $ ../../node_modules/.bin/ts-node --esm test/unit/network/snappy.test.ts | |
/* eslint-disable no-console */ |
OlderNewer