2021-09-26 22:26:48 +03:00
|
|
|
{ lib, stdenvNoCC, bc }:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
name = "sources";
|
|
|
|
src = lib.cleanSource ../../../pkg;
|
|
|
|
|
|
|
|
buildInputs = [ bc ];
|
|
|
|
|
2022-10-26 06:01:32 +03:00
|
|
|
outputs = [ "out" "goerli" ];
|
2021-09-26 22:26:48 +03:00
|
|
|
|
2022-10-26 06:01:32 +03:00
|
|
|
phases = [ "mainnetPhase" "goerliPhase" ];
|
2021-09-26 22:26:48 +03:00
|
|
|
|
|
|
|
mainnetPhase = ''
|
|
|
|
cp -r $src $out
|
|
|
|
chmod -R u+w $out
|
|
|
|
'';
|
|
|
|
|
2022-10-26 06:01:32 +03:00
|
|
|
goerliPhase = ''
|
2021-09-26 22:26:48 +03:00
|
|
|
cp -r $src tmp
|
|
|
|
chmod -R u+w tmp
|
|
|
|
|
|
|
|
ZUSE=tmp/arvo/sys/zuse.hoon
|
|
|
|
AMES=tmp/arvo/sys/vane/ames.hoon
|
|
|
|
ACME=tmp/arvo/app/acme.hoon
|
|
|
|
|
2022-10-26 06:01:32 +03:00
|
|
|
# Replace the mainnet azimuth contract with the goerli contract
|
2021-09-26 22:26:48 +03:00
|
|
|
sed --in-place \
|
2022-10-26 06:01:32 +03:00
|
|
|
's/\(\+\+ contracts \)mainnet\-contracts/\1goerli-contracts/' \
|
2021-09-26 22:26:48 +03:00
|
|
|
$ZUSE
|
|
|
|
|
|
|
|
# Increment the %ames protocol version
|
|
|
|
sed -r --in-place \
|
|
|
|
's_^(=/ protocol\-version=\?\(.*\) %)([0-7])_echo "\1$(echo "(\2+1) % 8" | bc)"_e' \
|
|
|
|
$AMES
|
|
|
|
|
|
|
|
# Use the staging API in :acme
|
|
|
|
sed --in-place \
|
|
|
|
's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \
|
|
|
|
$ACME
|
|
|
|
|
2022-10-26 06:01:32 +03:00
|
|
|
cp -r tmp $goerli
|
|
|
|
chmod -R u+w $goerli
|
2021-09-26 22:26:48 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
}
|