-
Notifications
You must be signed in to change notification settings - Fork 3
/
devenv.nix
101 lines (84 loc) · 2.88 KB
/
devenv.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{ pkgs, lib, config, inputs, ... }:
let
meta = {
version = "develop";
keystore-file = "./runtime/lagr-keystore.json";
keystore-password = "canihazsecurityplz";
gateway-url = "ws://localhost:4983";
params-url = "https://pub-2124403768df4a0285b77bcb8d224083.r2.dev";
};
avsWorkerConfig = {
worker = {
version = meta.version;
instance_type = "medium";
};
avs = {
gateway_url = meta.gateway-url;
issuer = "Some AVS partner";
worker_id = "worker_id";
lagr_keystore = meta.keystore-file;
lagr_pwd = meta.keystore-password;
};
prometheus.port = 9090;
public_params = {
dir = "./runtime/zkmr_params";
url = meta.params-url;
checksum_url = "${meta.params-url}/public_params.hash";
preprocessing_params = {
file = "preprocessing_params.bin";
};
query_params = {
file = "query_params.bin";
};
groth16_assets = {
circuit_file = "groth16_assets/circuit.bin";
r1cs_file = "groth16_assets/r1cs.bin";
pk_file = "groth16_assets/pk.bin";
};
};
};
lagrangeWorkerConfig = avsWorkerConfig //
{ avs = {
gateway_url = meta.gateway-url;
issuer = "Lagrange";
worker_id = "lagrange-medium";
lagr_private_key = config.env.LAGRANGE_PRIVATE_KEY;
}; };
workerConfigFile = ((pkgs.formats.toml {}).generate "worker-avs.toml" avsWorkerConfig);
lagrangeWorkerConfigFile = ((pkgs.formats.toml {}).generate "worker-lagrange.toml" lagrangeWorkerConfig);
in
{
cachix = {
enable = false;
pull = [];
};
packages = [ pkgs.git pkgs.openssl pkgs.pkg-config ]
++ lib.optionals pkgs.stdenv.targetPlatform.isDarwin [
pkgs.libiconv
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];
env = {
LAGRANGE_PRIVATE_KEY="779ff5fe168de6560e95dff8c91d3af4c45ad1b261d03d22e2e1558fb27ea450";
OPENSSL_DEV = pkgs.openssl.dev;
};
scripts = {
toml-worker-avs.exec = "echo ${workerConfigFile}";
toml-worker-lgn.exec = "echo ${lagrangeWorkerConfigFile}";
generate-key-store.exec = "AVS__LAGR_PWD=${meta.keystore-password} cargo run --bin lgn-avs -- new-key -l ${meta.keystore-file}";
worker-lgn.exec = "RUST_LOG=warn,worker=debug cargo run --release --bin lgn-worker -- --config ${workerConfigFile}";
worker-lgn-dummy.exec = "RUST_LOG=warn,worker=debug cargo run --release -F dummy-prover --bin lgn-worker -- --config ${workerConfigFile}";
};
enterShell = ''
echo "** ========== Devenv enabled ========== **"
echo "** Welcome to lagrange/lgn-coprocessir! **"
'';
enterTest = ''
'';
languages = {
go.enable = true;
rust = {
enable = true;
channel = "nightly";
};
};
}