Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 807ecbe

Browse files
authored
chore: [sc-1850] Release Relay v1.16 (#8)
1 parent 59811ed commit 807ecbe

File tree

8 files changed

+64
-19
lines changed

8 files changed

+64
-19
lines changed

keeman/default.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{ pkgs }: with pkgs;
2+
stdenv.mkDerivation rec {
3+
pname = "keeman";
4+
version = "0.1.0";
5+
src = ./.;
6+
7+
nativeBuildInputs = with pkgs; [
8+
makeWrapper
9+
autoPatchelfHook
10+
];
11+
installPhase = ''
12+
set -e
13+
mkdir -p $out/bin
14+
cp $src/keeman $out/bin/
15+
chmod +x $out/bin/*
16+
find $out/bin -type f | while read -r x; do
17+
wrapProgram "$x"
18+
done
19+
'';
20+
21+
doInstallCheck = true;
22+
installCheckPhase = ''
23+
$out/bin/keeman --version
24+
'';
25+
}

keeman/keeman

12.7 MB
Binary file not shown.

nix/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ in rec {
3434
setzer = pkgs.callPackage sources.setzer { };
3535
ethsign = pkgs.callPackage (import ../ethsign) { };
3636
foundry = pkgs.callPackage (import ../foundry) { inherit (nixpkgs2) pkgs; };
37+
keeman = pkgs.callPackage (import ../keeman) { inherit (nixpkgs2) pkgs; };
3738

3839
omnia = pkgs.callPackage (import ../omnia) {
3940
inherit ssb-server oracle-suite setzer ethsign foundry;
4041
};
4142

42-
install-relay = pkgs.callPackage ../systemd { inherit omnia ssb-server oracle-suite; };
43+
install-relay = pkgs.callPackage ../systemd { inherit omnia ssb-server oracle-suite keeman; };
4344
}

nix/sources.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@
7272
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
7373
},
7474
"oracle-suite": {
75-
"branch": "v0.9.0",
75+
"branch": "v0.9.1",
7676
"description": null,
7777
"homepage": null,
7878
"owner": "chronicleprotocol",
7979
"repo": "oracle-suite",
80-
"rev": "afa937668f81e2b583294d24e116c2e448e5f988",
81-
"sha256": "15k8knsqjalhzy9mdmmi8ppq776gqr05dh15b495vy3bbxzzrrbw",
80+
"rev": "948262fc6a377472c2b3157a7f18520c74dc3265",
81+
"sha256": "1q37928h1d44j0mv19jks56glx155bg292h8wrpfdqq6wbmfrdwy",
8282
"type": "tarball",
83-
"url": "https://github.com/chronicleprotocol/oracle-suite/archive/afa937668f81e2b583294d24e116c2e448e5f988.tar.gz",
83+
"url": "https://github.com/chronicleprotocol/oracle-suite/archive/948262fc6a377472c2b3157a7f18520c74dc3265.tar.gz",
8484
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
8585
},
8686
"setzer": {

omnia/config/relay-ethereum-goerli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"msgExpiration": 1800,
6262
"oracle": "0x0Aca91081B180Ad76a848788FC76A089fB5ADA72",
6363
"oracleExpiration": 14400,
64-
"oracleSpread": 3
64+
"oracleSpread": 10
6565
},
6666
"LINK/USD": {
6767
"msgExpiration": 1800,

omnia/config/relay-ethereum-mainnet.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"IBTA/USD": {
7676
"msgExpiration": 1800,
7777
"oracle": "0xa5d4a331125D7Ece7252699e2d3CB1711950fBc8",
78-
"oracleExpiration": 14400,
79-
"oracleSpread": 3
78+
"oracleExpiration": 86400,
79+
"oracleSpread": 10
8080
},
8181
"LINK/USD": {
8282
"msgExpiration": 1800,
@@ -99,7 +99,7 @@
9999
"MKR/USD": {
100100
"msgExpiration": 1800,
101101
"oracle": "0xdbbe5e9b1daa91430cf0772fcebe53f6c6f137df",
102-
"oracleExpiration": 14400,
102+
"oracleExpiration": 86400,
103103
"oracleSpread": 3
104104
},
105105
"RETH/USD": {

systemd/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{ stdenv, lib, makeWrapper, shellcheck, glibcLocales, coreutils, gettext, jq, omnia, ssb-server, oracle-suite, tor }:
1+
{ stdenv, lib, makeWrapper, shellcheck, glibcLocales, coreutils, gettext, jq, omnia, ssb-server, oracle-suite, tor, keeman }:
22
stdenv.mkDerivation rec {
33
name = "install-relay-${version}";
44
version = lib.fileContents ../version;
55
src = ./.;
66

7-
passthru.runtimeDeps = [ coreutils gettext jq ];
7+
passthru.runtimeDeps = [ coreutils gettext jq keeman ];
88
nativeBuildInputs = [ makeWrapper shellcheck ];
99

1010
buildPhase = "true";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
1414
in ''
1515
mkdir -p $out/{bin,share}
1616
cp -t $out/bin install-relay
17-
cp -t $out/share *.service *.json *.ini ${omnia}/*.json
17+
cp -t $out/share *.service *.json *.ini ${omnia}/config/*.json
1818
1919
wrapProgram "$out/bin/install-relay" \
2020
--prefix PATH : "${path}" \

systemd/install-relay

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,37 @@ copyTorConfig() {
206206
sudo chmod u+w "${TORPROXY_CONFIG}" >&2
207207

208208
# shellcheck disable=SC2174
209-
mkdir -m 0700 -p "$HOME"/.tor/{run,data} > /dev/null
210-
211-
sudo tee -a "${TORPROXY_CONFIG}" <<< "HiddenServiceDir ${HOME}/.tor"
212-
sudo tee -a "${TORPROXY_CONFIG}" <<< "HiddenServicePort 8888 127.0.0.1:8800"
213-
sudo tee -a "${TORPROXY_CONFIG}" <<< "HiddenServiceVersion 3"
209+
mkdir -m 0700 -p "$HOME"/.tor/{run,data,srv} > /dev/null
210+
211+
if ! [[ -f "${HOME}/.tor/srv/hostname" ]]; then
212+
local _HD_SEED
213+
_HD_SEED="$(keeman gen -k 8)"
214+
local _TOR_JSON
215+
_TOR_JSON="$(keeman der -f onion <<<"$_HD_SEED")"
216+
jq '.hostname' -r <<<"$_TOR_JSON" > "${HOME}/.tor/srv/hostname"
217+
jq '.public_key' -r <<<"$_TOR_JSON" > "${HOME}/.tor/srv/$(jq '.prefix' -r <<<"$_TOR_JSON")_public_key"
218+
jq '.secret_key' -r <<<"$_TOR_JSON" > "${HOME}/.tor/srv/$(jq '.prefix' -r <<<"$_TOR_JSON")_secret_key"
219+
220+
chmod 0600 "${HOME}/.tor/srv/"*
221+
222+
echo >&2
223+
echo >&2
224+
echo >&2 "----------------------------------------------------------------------------------------------------"
225+
echo >&2 "Your key generation seed phrase is:"
226+
echo >&2 "${_HD_SEED}"
227+
echo >&2 "----------------------------------------------------------------------------------------------------"
228+
echo >&2
229+
echo >&2
230+
fi
214231

215232
sudo tee -a "${TORPROXY_CONFIG}" <<< "ControlSocket ${HOME}/.tor/run/control"
216233
sudo tee -a "${TORPROXY_CONFIG}" <<< "CookieAuthFile ${HOME}/.tor/run/control.authcookie"
217234
sudo tee -a "${TORPROXY_CONFIG}" <<< "DataDirectory ${HOME}/.tor/data"
218235

236+
sudo tee -a "${TORPROXY_CONFIG}" <<< "HiddenServiceDir ${HOME}/.tor/srv"
237+
sudo tee -a "${TORPROXY_CONFIG}" <<< "HiddenServicePort 8888 127.0.0.1:8800"
238+
sudo tee -a "${TORPROXY_CONFIG}" <<< "HiddenServiceVersion 3"
239+
219240
echo >&2 "TORPROXY_CONFIG: DONE"
220241
}
221242

@@ -379,8 +400,6 @@ done
379400
installConfigs
380401
installServices
381402

382-
"$OMNIA_PATH" info
383-
384403
echo >&2 "To (re)start Omnia now (and auto-start on reboot) run:"
385404
echo "systemctl daemon-reload # Reload systemd services"
386405
echo -n "$systemdCmd"

0 commit comments

Comments
 (0)