2021-11-23 16:55:16 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
2021-02-26 00:23:22 +00:00
|
|
|
version = "0.1.0"
|
|
|
|
author = "Dagger Team"
|
2021-10-29 19:30:52 +00:00
|
|
|
description = "p2p data durability engine"
|
2021-02-26 00:23:22 +00:00
|
|
|
license = "MIT"
|
|
|
|
|
2021-10-29 19:30:52 +00:00
|
|
|
requires "libp2p#unstable",
|
2021-02-26 00:23:22 +00:00
|
|
|
"nimcrypto >= 0.4.1",
|
|
|
|
"bearssl >= 0.1.4",
|
|
|
|
"chronicles >= 0.7.2",
|
|
|
|
"chronos >= 2.5.2",
|
|
|
|
"metrics",
|
|
|
|
"secp256k1",
|
|
|
|
"stew#head",
|
|
|
|
"protobufserialization >= 0.2.0 & < 0.3.0",
|
2021-04-15 09:23:49 +00:00
|
|
|
"https://github.com/status-im/nim-nitro >= 0.4.0 & < 0.5.0",
|
2021-05-10 07:42:38 +00:00
|
|
|
"questionable >= 0.9.1 & < 0.10.0",
|
2021-04-07 10:22:02 +00:00
|
|
|
"upraises >= 0.1.0 & < 0.2.0",
|
2021-10-29 19:30:52 +00:00
|
|
|
"asynctest >= 0.3.0 & < 0.4.0"
|
2021-11-23 16:55:16 +00:00
|
|
|
|
|
|
|
### Helper functions
|
|
|
|
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
# allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims"
|
|
|
|
var extra_params = params
|
|
|
|
for i in 2..<paramCount():
|
|
|
|
extra_params &= " " & paramStr(i)
|
|
|
|
exec "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
|
|
|
|
|
feat: integrate dagger contracts
Integrate dagger contracts from `nim-dagger-contracts` repo.
Add `dagger-contracts`, `nim-web3`, and all of `nim-web3`’s transitive deps as submodule deps to `nim-dagger`. Note: `nim-web3` and its transitive deps may no longer be needed when we switch to `nim-ethers`.
Add a `testContracts` nimble task to test all of the contracts functionality. Namely, this spins up an ethereum simulator, deploys the contracts (in `dagger-contracts`), runs the contract tests, and finally, regardless of success/error, kills the ethereum sim processes. The nimble task can be run with `./env.sh nimble testContracts`.
We also tested `nim-dagger-contracts` as a submodule dep of `nim-dagger`, and while the tests run as expected, the preference is to merge `nim-dagger-contracts` inside of `nim-dagger` for ease of parallel development. There’s also a high probability that `nim-dagger-contracts` is not being used as a dep by other projects. Are there any strong objections to this?
Co-authored-by: Michael Bradley <michaelsbradleyjr@gmail.com>
2022-01-25 00:22:58 +00:00
|
|
|
proc test(name: string, srcDir = "tests/", params = "-d:chronicles_log_level=DEBUG", lang = "c") =
|
|
|
|
buildBinary name, srcDir, params
|
2021-11-23 16:55:16 +00:00
|
|
|
exec "build/" & name
|
|
|
|
|
feat: integrate dagger contracts
Integrate dagger contracts from `nim-dagger-contracts` repo.
Add `dagger-contracts`, `nim-web3`, and all of `nim-web3`’s transitive deps as submodule deps to `nim-dagger`. Note: `nim-web3` and its transitive deps may no longer be needed when we switch to `nim-ethers`.
Add a `testContracts` nimble task to test all of the contracts functionality. Namely, this spins up an ethereum simulator, deploys the contracts (in `dagger-contracts`), runs the contract tests, and finally, regardless of success/error, kills the ethereum sim processes. The nimble task can be run with `./env.sh nimble testContracts`.
We also tested `nim-dagger-contracts` as a submodule dep of `nim-dagger`, and while the tests run as expected, the preference is to merge `nim-dagger-contracts` inside of `nim-dagger` for ease of parallel development. There’s also a high probability that `nim-dagger-contracts` is not being used as a dep by other projects. Are there any strong objections to this?
Co-authored-by: Michael Bradley <michaelsbradleyjr@gmail.com>
2022-01-25 00:22:58 +00:00
|
|
|
task testContracts, "Build, deploy and test contracts":
|
|
|
|
exec "cd vendor/dagger-contracts && npm install"
|
|
|
|
|
|
|
|
# start node
|
|
|
|
# Note: combining this command with the previous does not work
|
|
|
|
exec "cd vendor/dagger-contracts && npx hardhat node --no-deploy &"
|
|
|
|
|
|
|
|
# deploy contracts
|
|
|
|
exec "sleep 3 && " &
|
|
|
|
"cd vendor/dagger-contracts && npx hardhat deploy --network localhost --export '../../deployment-localhost.json'"
|
|
|
|
|
|
|
|
# run contract tests using deployed contracts
|
|
|
|
try:
|
|
|
|
test "testContracts", "tests/", "-d:chronicles_log_level=WARN"
|
|
|
|
finally:
|
|
|
|
# kill simulator processes
|
|
|
|
exec "ps -ef | grep hardhat | grep -v grep | awk '{ print $2 }' | xargs kill"
|
|
|
|
|
2022-01-12 22:19:37 +00:00
|
|
|
task testAll, "Build & run Dagger tests":
|
feat: integrate dagger contracts
Integrate dagger contracts from `nim-dagger-contracts` repo.
Add `dagger-contracts`, `nim-web3`, and all of `nim-web3`’s transitive deps as submodule deps to `nim-dagger`. Note: `nim-web3` and its transitive deps may no longer be needed when we switch to `nim-ethers`.
Add a `testContracts` nimble task to test all of the contracts functionality. Namely, this spins up an ethereum simulator, deploys the contracts (in `dagger-contracts`), runs the contract tests, and finally, regardless of success/error, kills the ethereum sim processes. The nimble task can be run with `./env.sh nimble testContracts`.
We also tested `nim-dagger-contracts` as a submodule dep of `nim-dagger`, and while the tests run as expected, the preference is to merge `nim-dagger-contracts` inside of `nim-dagger` for ease of parallel development. There’s also a high probability that `nim-dagger-contracts` is not being used as a dep by other projects. Are there any strong objections to this?
Co-authored-by: Michael Bradley <michaelsbradleyjr@gmail.com>
2022-01-25 00:22:58 +00:00
|
|
|
test "testAll", params = "-d:chronicles_log_level=WARN"
|