more flexible compile time resource path
This commit is contained in:
parent
d99caf1ad9
commit
a24f3cde7e
|
@ -1349,11 +1349,15 @@ proc engineApiUrls*(config: BeaconNodeConf): seq[EngineApiUrl] =
|
|||
(elUrls & config.web3Urls).toFinalEngineApiUrls(config.jwtSecret)
|
||||
|
||||
proc loadKzgTrustedSetup*(): Result[void, string] =
|
||||
const
|
||||
vendorDir = currentSourcePath.parentDir.replace('\\', '/') & "/../vendor"
|
||||
trustedSetupDir = vendorDir & "/nim-kzg4844/kzg4844/csources/src"
|
||||
|
||||
const trustedSetup =
|
||||
when const_preset == "mainnet":
|
||||
staticRead"../vendor/nim-kzg4844/kzg4844/csources/src/trusted_setup.txt"
|
||||
staticRead trustedSetupDir & "/trusted_setup.txt"
|
||||
elif const_preset == "minimal":
|
||||
staticRead"../vendor/nim-kzg4844/kzg4844/csources/src/trusted_setup_4.txt"
|
||||
staticRead trustedSetupDir & "/trusted_setup_4.txt"
|
||||
else:
|
||||
""
|
||||
if const_preset == "mainnet" or const_preset == "minimal":
|
||||
|
|
|
@ -220,6 +220,9 @@ when const_preset == "gnosis":
|
|||
let
|
||||
gnosisGenesis {.importc: "gnosis_mainnet_genesis".}: ptr UncheckedArray[byte]
|
||||
gnosisGenesisSize {.importc: "gnosis_mainnet_genesis_size".}: int
|
||||
|
||||
# let `.incbin` in assembly file find the binary file through search path
|
||||
{.passc: "-I" & vendorDir.}
|
||||
{.compile: "network_metadata_gnosis.S".}
|
||||
|
||||
const
|
||||
|
@ -248,6 +251,8 @@ elif const_preset == "mainnet":
|
|||
sepoliaGenesis {.importc: "eth2_sepolia_genesis".}: ptr UncheckedArray[byte]
|
||||
sepoliaGenesisSize {.importc: "eth2_sepolia_genesis_size".}: int
|
||||
|
||||
# let `.incbin` in assembly file find the binary file through search path
|
||||
{.passc: "-I" & vendorDir.}
|
||||
{.compile: "network_metadata_mainnet.S".}
|
||||
|
||||
const
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
# name_size = 64-bit length in bytes
|
||||
|
||||
gnosis_mainnet_genesis_data:
|
||||
.incbin "../../vendor/gnosis-chain-configs/mainnet/genesis.ssz"
|
||||
.incbin "gnosis-chain-configs/mainnet/genesis.ssz"
|
||||
gnosis_mainnet_genesis_end:
|
||||
.global cdecl(gnosis_mainnet_genesis_size)
|
||||
cdecl(gnosis_mainnet_genesis_size):
|
||||
|
|
|
@ -28,21 +28,21 @@
|
|||
# name_size = 64-bit length in bytes
|
||||
|
||||
eth2_mainnet_genesis_data:
|
||||
.incbin "../../vendor/eth2-networks/shared/mainnet/genesis.ssz"
|
||||
.incbin "eth2-networks/shared/mainnet/genesis.ssz"
|
||||
eth2_mainnet_genesis_end:
|
||||
.global cdecl(eth2_mainnet_genesis_size)
|
||||
cdecl(eth2_mainnet_genesis_size):
|
||||
.quad eth2_mainnet_genesis_end - eth2_mainnet_genesis_data
|
||||
|
||||
eth2_goerli_genesis_data:
|
||||
.incbin "../../vendor/eth2-networks/shared/prater/genesis.ssz"
|
||||
.incbin "eth2-networks/shared/prater/genesis.ssz"
|
||||
eth2_goerli_genesis_end:
|
||||
.global cdecl(eth2_goerli_genesis_size)
|
||||
cdecl(eth2_goerli_genesis_size):
|
||||
.quad eth2_goerli_genesis_end - eth2_goerli_genesis_data
|
||||
|
||||
eth2_sepolia_genesis_data:
|
||||
.incbin "../../vendor/sepolia/bepolia/genesis.ssz"
|
||||
.incbin "sepolia/bepolia/genesis.ssz"
|
||||
eth2_sepolia_genesis_end:
|
||||
.global cdecl(eth2_sepolia_genesis_size)
|
||||
cdecl(eth2_sepolia_genesis_size):
|
||||
|
|
Loading…
Reference in New Issue