2019-03-28 16:18:59 +01:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
2019-03-06 00:54:08 +02:00
|
|
|
import
|
2019-03-12 14:56:33 +02:00
|
|
|
beacon_chain/version as ver
|
2019-03-06 00:54:08 +02:00
|
|
|
|
2018-07-20 15:46:03 +02:00
|
|
|
packageName = "beacon_chain"
|
2019-03-06 00:54:08 +02:00
|
|
|
version = versionAsStr
|
2018-07-20 15:46:03 +02:00
|
|
|
author = "Status Research & Development GmbH"
|
2018-09-26 18:26:39 +02:00
|
|
|
description = "Eth2.0 research implementation of the beacon chain"
|
2018-07-20 15:46:03 +02:00
|
|
|
license = "MIT or Apache License 2.0"
|
2018-12-21 16:37:46 -06:00
|
|
|
installDirs = @["beacon_chain", "research"]
|
|
|
|
bin = @[
|
|
|
|
"beacon_chain/beacon_node",
|
2018-12-27 14:14:37 -06:00
|
|
|
"research/serialized_sizes",
|
|
|
|
"research/state_sim",
|
|
|
|
]
|
2018-07-20 15:46:03 +02:00
|
|
|
|
|
|
|
### Dependencies
|
2019-02-07 12:02:40 +01:00
|
|
|
requires "nim >= 0.19.0",
|
2019-02-20 22:42:17 -06:00
|
|
|
"blscurve",
|
2018-11-24 01:58:49 +02:00
|
|
|
"chronicles",
|
2019-09-07 13:48:05 -04:00
|
|
|
"chronos",
|
2018-11-24 01:58:49 +02:00
|
|
|
"confutils",
|
2019-09-07 13:48:05 -04:00
|
|
|
"eth",
|
2019-02-06 18:56:04 +01:00
|
|
|
"json_rpc",
|
2019-09-07 13:48:05 -04:00
|
|
|
"json_serialization",
|
2019-07-31 11:32:35 +03:00
|
|
|
"libp2p",
|
2019-09-07 13:48:05 -04:00
|
|
|
"metrics",
|
|
|
|
"nimcrypto",
|
|
|
|
"serialization",
|
|
|
|
"stew",
|
2019-10-02 15:38:14 +03:00
|
|
|
"prompt",
|
2019-09-07 13:48:05 -04:00
|
|
|
"web3",
|
|
|
|
"yaml"
|
2018-07-20 15:46:03 +02:00
|
|
|
|
|
|
|
### Helper functions
|
2019-07-13 15:58:01 +00:00
|
|
|
proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "", lang = "c") =
|
2018-07-20 15:46:03 +02:00
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
2019-03-28 16:18:59 +01:00
|
|
|
# allow something like "nim test --verbosity:0 --hints:off beacon_chain.nims"
|
|
|
|
var extra_params = params
|
|
|
|
for i in 2..<paramCount():
|
|
|
|
extra_params &= " " & paramStr(i)
|
2019-07-13 15:58:01 +00:00
|
|
|
exec "nim " & lang & " --out:./build/" & name & " " & extra_params & " " & srcDir & name & ".nim" & " " & cmdParams
|
2018-07-20 15:46:03 +02:00
|
|
|
|
|
|
|
### tasks
|
|
|
|
task test, "Run all tests":
|
2019-05-27 14:48:13 +02:00
|
|
|
# Mainnet config
|
2019-03-28 16:18:59 +01:00
|
|
|
buildBinary "all_tests", "tests/", "-r -d:release -d:chronicles_log_level=ERROR"
|
2019-05-27 14:48:13 +02:00
|
|
|
# Minimal config
|
|
|
|
buildBinary "all_tests", "tests/", "-r -d:release -d:chronicles_log_level=ERROR -d:const_preset=minimal"
|
2019-08-07 06:09:26 +03:00
|
|
|
|
2019-11-06 12:17:03 +01:00
|
|
|
# Generic SSZ test, doesn't use consensus objects minimal/mainnet presets
|
|
|
|
buildBinary "test_fixture_ssz_generic_types", "tests/official/", "-r -d:release -d:chronicles_log_level=DEBUG"
|
|
|
|
|
|
|
|
# Consensus object SSZ tests
|
2019-11-12 16:21:15 +01:00
|
|
|
buildBinary "test_fixture_ssz_consensus_objects", "tests/official/", "-r -d:release -d:chronicles_log_level=DEBUG -d:const_preset=minimal"
|
|
|
|
buildBinary "test_fixture_ssz_consensus_objects", "tests/official/", "-r -d:release -d:chronicles_log_level=DEBUG -d:const_preset=mainnet"
|
2019-08-07 06:09:26 +03:00
|
|
|
|
2019-11-11 09:11:46 +01:00
|
|
|
buildBinary "all_fixtures_require_ssz", "tests/official/", "-r -d:release -d:chronicles_log_level=DEBUG -d:const_preset=minimal"
|
|
|
|
buildBinary "all_fixtures_require_ssz", "tests/official/", "-r -d:release -d:chronicles_log_level=DEBUG -d:const_preset=mainnet"
|
2019-09-03 20:02:21 +02:00
|
|
|
|
2019-07-13 15:58:01 +00:00
|
|
|
# State sim; getting into 3rd epoch useful
|
2019-08-28 20:31:21 +02:00
|
|
|
buildBinary "state_sim", "research/", "-r -d:release", "--validators=128 --slots=24"
|
2019-08-16 14:55:48 +02:00
|
|
|
|
|
|
|
task sync_lfs_tests, "Sync LFS json tests":
|
|
|
|
# Syncs the json test files (but not the EF yaml tests)
|
2019-11-01 09:44:16 +01:00
|
|
|
exec "scripts/setup_official_tests.sh"
|