net-p2p/cardano-node: Remove port

Niche use case, not aligned with broad server application needs
This commit is contained in:
2025-04-28 00:03:00 +02:00
parent b8a41f19e0
commit cd19d85efb
7 changed files with 1 additions and 2181 deletions
+1
View File
@@ -4604,6 +4604,7 @@ net-p2p/bitcoin-utils
net-p2p/btcheck
net-p2p/c-lightning
net-p2p/cardano-db-sync
net-p2p/cardano-node
net-p2p/clboss
net-p2p/deluge
net-p2p/deluge-cli
-1
View File
@@ -7,7 +7,6 @@
SUBDIR += bitmark-cli
SUBDIR += bitmark-daemon
SUBDIR += bitmark-recorder
SUBDIR += cardano-node
SUBDIR += cncli
SUBDIR += cpuminer
SUBDIR += createtorrent
-528
View File
@@ -1,528 +0,0 @@
PORTNAME= cardano-node
PORTVERSION= 10.1.4
CATEGORIES= net-p2p
MASTER_SITES= https://chap.intersectmbo.org/package/:chap
MAINTAINER= arrowd@FreeBSD.org
COMMENT= Core component of the Cardano decentralized blockchain
WWW= https://cardano.org/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN_aarch64= text-2.0.2 is broken on AArch64 when using GHC 8.10
NOT_FOR_ARCHS= i386
BUILD_DEPENDS= ghc-8.10.7:lang/ghc810
LIB_DEPENDS= libsecp256k1.so:math/secp256k1 \
libblst.so:security/blst
RUN_DEPENDS= ${LOCALBASE}/share/rc-subr-jail/rc.subr.jail:ports-mgmt/rc-subr-jail
USES= autoreconf:build cabal gmake libtool pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= IntersectMBO
GH_TUPLE= IntersectMBO:libsodium:${LIBSODIUM_HASH}:sodium
CARDANO_NODE_HASH= 1f63dbf2ab39e0b32bf6901dc203866d3e37de08
# taken from https://github.com/IntersectMBO/cardano-node/blob/307fdd248603f1af2457e63e443403f072a4a864/flake.lock#L1431
LIBSODIUM_HASH= dbb48cce5429cb6585c9034f002568964f1ce567
USE_RC_SUBR= cardano_node
LIBS_PREFIX= ${WRKDIR}/libs_install
BINARY_ALIAS= git=true
USERS= cardano
GROUPS= cardano
USE_CABAL= Cabal-3.12.1.0 \
Cabal-syntax-3.12.1.0 \
Diff-0.5_1 \
FailT-0.1.2.0 \
Glob-0.10.2_3 \
HUnit-1.6.2.0 \
Histogram-0.1.0.2 \
MemoTrie-0.6.11 \
MonadRandom-0.6_4 \
OneTuple-0.4.2_1 \
Only-0.1_2 \
QuickCheck-2.15.0.1 \
StateVar-1.2.2 \
Stream-0.4.7.2 \
Unique-0.4.7.9_1 \
Win32-network-0.2.0.0:chap \
adjunctions-4.4.2_2 \
aeson-2.2.3.0_2 \
aeson-pretty-0.8.10 \
alex-3.5.1.0 \
algebraic-graphs-0.7_3 \
ansi-terminal-1.1.1 \
ansi-terminal-types-1.1 \
ansi-wl-pprint-1.0.2 \
ap-normalize-0.1.0.1 \
appar-0.1.8 \
asn1-encoding-0.9.6_2 \
asn1-parse-0.9.5 \
asn1-types-0.3.4 \
assoc-1.1.1_1 \
async-2.2.5_3 \
async-timer-0.1.4.1 \
atomic-primops-0.8.8 \
attoparsec-0.14.4_6 \
attoparsec-aeson-2.2.2.0 \
attoparsec-iso8601-1.1.1.0_1 \
auto-update-0.2.1 \
barbies-2.1.1.0 \
base-compat-0.13.1 \
base-compat-batteries-0.13.1 \
base-deriving-via-0.1.0.2:chap \
base-orphans-0.9.2 \
base16-bytestring-1.0.2.0_1 \
base58-bytestring-0.1.0 \
base64-bytestring-1.2.1.0_1 \
base64-bytestring-type-1.0.1_21 \
basement-0.0.16 \
bech32-1.1.7 \
bifunctors-5.6.2_1 \
bimap-0.5.0 \
bin-0.1.4_1 \
binary-orphans-1.0.5_1 \
bitvec-1.1.5.0_3 \
blaze-builder-0.4.2.3 \
blaze-html-0.9.2.0_1 \
blaze-markup-0.8.3.0_2 \
boring-0.2.2_1 \
bsb-http-chunked-0.0.0.4_4 \
byron-spec-chain-1.0.1.0:chap \
byron-spec-ledger-1.0.1.0:chap \
byteorder-1.0.4 \
bytestring-builder-0.10.8.2.0 \
bytestring-strict-builder-0.4.5.7 \
cabal-doctest-1.0.10 \
call-stack-0.4.0 \
canonical-json-0.6.0.1_1 \
capability-0.5.0.1_4 \
cardano-api-10.1.0.0:chap \
cardano-binary-1.7.1.0:chap \
cardano-cli-10.1.1.0:chap \
cardano-crypto-1.1.2:chap \
cardano-crypto-class-2.1.5.0:chap \
cardano-crypto-praos-2.2.0.0:chap \
cardano-crypto-test-1.5.0.2:chap \
cardano-crypto-tests-2.1.2.0_2:chap \
cardano-crypto-wrapper-1.5.1.3:chap \
cardano-data-1.2.3.1:chap \
cardano-git-rev-0.2.2.0:chap \
cardano-ledger-allegra-1.6.0.1:chap \
cardano-ledger-alonzo-1.11.0.0:chap \
cardano-ledger-alonzo-test-1.3.0.0:chap \
cardano-ledger-api-1.9.4.0:chap \
cardano-ledger-babbage-1.10.0.0:chap \
cardano-ledger-babbage-test-1.3.0.0:chap \
cardano-ledger-binary-1.4.0.0:chap \
cardano-ledger-byron-1.0.1.0:chap \
cardano-ledger-byron-test-1.5.2.0:chap \
cardano-ledger-conway-1.17.4.0:chap \
cardano-ledger-conway-test-1.3.0.0:chap \
cardano-ledger-core-1.15.0.0:chap \
cardano-ledger-mary-1.7.0.1:chap \
cardano-ledger-shelley-1.14.1.0:chap \
cardano-ledger-shelley-ma-test-1.2.2.4:chap \
cardano-ledger-shelley-test-1.5.0.0:chap \
cardano-ping-0.5.0.0:chap \
cardano-prelude-0.2.0.0:chap \
cardano-prelude-test-0.1.0.5:chap \
cardano-protocol-tpraos-1.2.0.1:chap \
cardano-slotting-0.2.0.0:chap \
cardano-strict-containers-0.1.3.0:chap \
case-insensitive-1.2.1.0 \
cassava-0.5.3.2 \
cborg-0.2.10.0_1 \
cereal-0.5.8.3 \
character-ps-0.1 \
charset-0.3.10_1 \
clock-0.8.4 \
cmdargs-0.10.22 \
code-page-0.2.1 \
colour-2.3.6 \
comonad-5.0.8_2 \
compact-0.2.0.0_3 \
composition-prelude-3.0.1.0 \
concurrent-output-1.10.21 \
conduit-1.3.6 \
conduit-extra-1.3.6 \
constraints-0.14.2_1 \
constraints-extras-0.4.0.1 \
contra-tracer-0.1.0.2:chap \
contravariant-1.5.5 \
cookie-0.5.0 \
criterion-1.6.3.0_1 \
criterion-measurement-0.2.2.0 \
crypton-1.0.0 \
crypton-connection-0.4.1 \
crypton-x509-1.7.7 \
crypton-x509-store-1.6.9 \
crypton-x509-system-1.6.7 \
crypton-x509-validation-1.6.12 \
cryptonite-0.30 \
cuddle-0.3.2.1:chap \
data-accessor-0.2.3.1_1 \
data-accessor-transformers-0.2.1.8 \
data-array-byte-0.1.0.1_4 \
data-default-0.7.1.1 \
data-default-class-0.1.2.0 \
data-default-instances-containers-0.0.1 \
data-default-instances-dlist-0.0.1 \
data-default-instances-old-locale-0.0.1 \
data-fix-0.3.4_1 \
dec-0.0.6_1 \
deferred-folds-0.9.18.6 \
dense-linear-algebra-0.1.0.0 \
dependent-map-0.4.0.0_2 \
dependent-sum-0.7.2.0_2 \
deque-0.4.4.1 \
deriving-aeson-0.2.9_1 \
deriving-compat-0.6.6 \
dictionary-sharing-0.1.0.0_4 \
digest-0.0.2.1 \
distributive-0.6.2.1_1 \
dlist-1.0_2 \
dns-4.2.0 \
dom-lt-0.2.3_1 \
double-conversion-2.0.5.0 \
easy-file-0.2.5 \
ede-0.3.3.0 \
either-5.0.2_2 \
ekg-0.4.1.0_1 \
ekg-core-0.1.1.7.0.0.0.0.1:chap \
ekg-forward-0.6:chap \
ekg-json-0.1.1.0_1 \
ekg-wai-0.1.1.0 \
erf-2.0.0.0 \
errors-2.3.0_5 \
extra-1.7.16_1 \
fast-logger-3.2.3 \
fgl-5.8.3.0 \
file-embed-0.0.16.0 \
filelock-0.1.1.7 \
fin-0.3.1_1 \
fingertree-0.1.5.0 \
flat-0.6 \
foldable1-classes-compat-0.1_6 \
foldl-1.4.17 \
formatting-7.2.0 \
foundation-0.0.30 \
free-5.2_6 \
fs-api-0.3.0.0 \
fs-sim-0.3.0.0 \
generic-data-1.1.0.0_3 \
generic-lens-2.2.2.0_1 \
generic-lens-core-2.2.1.0_2 \
generic-monoid-0.1.0.1_4 \
generic-optics-2.2.1.0_2 \
generic-random-1.5.0.1 \
generically-0.1.1_4 \
generics-sop-0.5.1.4_2 \
genvalidity-1.1.1.0 \
githash-0.1.7.0 \
gnuplot-0.5.7_2 \
graphviz-2999.20.2.0 \
groups-0.5.3 \
half-0.3.1_2 \
happy-2.0.2 \
happy-lib-2.0.2 \
hashable-1.4.7.0 \
haskell-lexer-1.1.1 \
haskell-src-exts-1.23.1 \
haskell-src-meta-0.8.14 \
heapwords-0.1.0.2:chap \
hedgehog-1.5_1 \
hedgehog-extras-0.6.5.0 \
hedgehog-quickcheck-0.1.1_8 \
here-1.2.14 \
hostname-1.0 \
hourglass-0.2.12_1 \
hsc2hs-0.68.10_3 \
hspec-2.11.9 \
hspec-core-2.11.9 \
hspec-discover-2.11.9 \
hspec-expectations-0.8.4_2 \
http-api-data-0.6.1_1 \
http-client-0.7.17 \
http-client-tls-0.3.6.3 \
http-conduit-2.3.9 \
http-date-0.0.11 \
http-media-0.8.1.1_2 \
http-semantics-0.2.1 \
http-types-0.12.4 \
http2-5.3.4 \
indexed-profunctors-0.1.1.1 \
indexed-traversable-0.1.4_1 \
indexed-traversable-instances-0.1.2_1 \
infinite-list-0.1.1 \
integer-conversion-0.1.1_1 \
integer-logarithms-1.0.3.1_6 \
invariant-0.6.3 \
io-classes-1.5.0.0_1 \
io-classes-mtl-0.1.2.0_1 \
io-sim-1.5.0.0 \
io-streams-1.5.2.2_6 \
io-streams-haproxy-1.0.1.0_9 \
iohk-monitoring-0.1.11.5:chap \
iproute-1.7.14 \
isomorphism-class-0.1.1 \
js-chart-2.9.4.1 \
kan-extensions-5.2.6 \
katip-0.8.8.2 \
lazy-search-0.1.3.0 \
lazysmallcheck-0.6 \
lens-5.3.2_2 \
lens-aeson-1.2.3_2 \
libyaml-0.1.4 \
libyaml-clib-0.2.5 \
lifted-async-0.10.2.6_1 \
lifted-base-0.2.3.12 \
list-t-1.0.5.7 \
lobemo-backend-aggregation-0.1.0.0:chap \
lobemo-backend-ekg-0.1.1.0:chap \
lobemo-backend-monitoring-0.1.0.0:chap \
lobemo-backend-trace-forwarder-0.1.0.0:chap \
logict-0.8.1.0_1 \
math-functions-0.3.4.4 \
measures-0.1.0.2:chap \
megaparsec-9.2.1_1 \
memory-0.18.0 \
microlens-0.4.13.1_1 \
microlens-aeson-2.5.2 \
microlens-mtl-0.2.0.3_1 \
microlens-th-0.4.3.15 \
microstache-1.0.3 \
mime-mail-0.5.1 \
mime-types-0.1.2.0 \
mmorph-1.2.0_3 \
monad-control-1.0.3.1 \
mono-traversable-1.0.20.0 \
monoidal-containers-0.6.5.0 \
monoidal-synchronisation-0.1.0.6:chap \
mtl-compat-0.2.2 \
multiset-0.3.4.3_1 \
mutable-containers-0.3.4.1 \
mwc-random-0.15.1.0_1 \
network-3.1.4.0_1 \
network-bsd-2.8.1.0_6 \
network-byte-order-0.1.7 \
network-control-0.1.3 \
network-mux-0.4.5.3:chap \
network-uri-2.6.4.2_1 \
newtype-0.2.2.0_3 \
newtype-generics-0.6.2_4 \
non-integral-1.0.0.0_2:chap \
nonempty-vector-0.2.3_2 \
nothunks-0.2.1.1 \
old-locale-1.0.0.7_2 \
old-time-1.1.0.4 \
optics-core-0.4.1.1_1 \
optparse-applicative-0.18.1.0 \
optparse-applicative-fork-0.18.1.0:chap \
optparse-generic-1.5.2_1 \
ouroboros-consensus-0.21.0.0:chap \
ouroboros-consensus-cardano-0.20.0.0:chap \
ouroboros-consensus-diffusion-0.18.0.0:chap \
ouroboros-consensus-protocol-0.9.0.2:chap \
ouroboros-network-0.17.1.2:chap \
ouroboros-network-api-0.10.0.0:chap \
ouroboros-network-framework-0.13.2.5:chap \
ouroboros-network-mock-0.1.1.2:chap \
ouroboros-network-protocols-0.11.0.0:chap \
ouroboros-network-testing-0.7.0.0:chap \
parallel-3.2.2.0_9 \
parsec-3.1.17.0_1 \
parser-combinators-1.3.0_1 \
parsers-0.12.11_3 \
partial-order-0.2.0.0 \
pem-0.2.4 \
pipes-4.3.16_6 \
plutus-core-1.36.0.0:chap \
plutus-ledger-api-1.36.0.0:chap \
plutus-tx-1.36.0.0:chap \
polyparse-1.13_9 \
pretty-show-1.10 \
pretty-simple-4.1.2.0 \
prettyprinter-1.7.1 \
prettyprinter-ansi-terminal-1.1.3 \
prettyprinter-compat-ansi-wl-pprint-1.0.2 \
prettyprinter-configurable-1.36.0.0:chap \
primitive-0.9.0.0_2 \
profunctors-5.6.2_3 \
prometheus-2.3.0 \
psqueues-0.2.8.0_1 \
quickcheck-instances-0.3.31_2 \
quickcheck-io-0.2.0 \
quickcheck-monoids-0.1.0.1:chap \
quickcheck-state-machine-0.10.1 \
quickcheck-transformer-0.3.1.2_1 \
quiet-0.2 \
ral-0.2.2_1 \
random-1.2.1.2 \
random-shuffle-0.0.4 \
readable-0.3.1_2 \
recursion-schemes-5.2.3_1 \
recv-0.1.0 \
reducers-3.12.4_7 \
reflection-2.1.8 \
regex-base-0.94.0.2_4 \
regex-posix-0.96.0.1_3 \
resourcet-1.3.0 \
retry-0.9.3.1 \
safe-0.3.21_1 \
safe-exceptions-0.1.7.4_1 \
safe-wild-cards-1.0.0.2_2 \
scientific-0.3.8.0_2 \
selective-0.6_1 \
semialign-1.3.1_2 \
semigroupoids-6.0.1_1 \
semigroups-0.20 \
serialise-0.2.6.1_3 \
servant-0.20.2 \
servant-server-0.20.2 \
set-algebra-1.1.0.3:chap \
show-combinators-0.2.0.0_2 \
si-timers-1.5.0.0 \
signal-0.1.0.4 \
simple-sendfile-0.2.32 \
singleton-bool-0.1.8_1 \
singletons-3.0.3 \
size-based-0.1.3.3_1 \
slugify-0.1.0.2 \
small-steps-1.1.0.1:chap \
smtp-mail-0.5.0.0_1 \
snap-core-1.0.5.1_6 \
snap-server-1.1.2.1_5 \
socks-0.6.1 \
some-1.0.6_2 \
sop-core-0.5.0.2_5 \
sop-extras-0.2.1.0:chap \
split-0.2.5 \
splitmix-0.1.0.5_1 \
statistics-0.16.2.1 \
statistics-linreg-0.3 \
streaming-0.2.4.0 \
streaming-binary-0.3.0.1 \
streaming-bytestring-0.3.3 \
streaming-commons-0.2.2.6_1 \
strict-0.5.1_1 \
strict-checked-vars-0.2.0.0_3:chap \
strict-list-0.1.7.5 \
strict-mvar-1.5.0.0 \
strict-sop-core-0.1.2.0:chap \
strict-stm-1.5.0.0 \
string-conv-0.2.0 \
string-qq-0.0.6 \
syb-0.7.2.4 \
system-filepath-0.4.14_2 \
tagged-0.8.8_1 \
tar-0.6.0.0 \
tasty-1.5_2 \
tasty-expected-failure-0.12.3 \
tasty-golden-2.3.5 \
tasty-hedgehog-1.4.0.2_6 \
tasty-hunit-0.10.2 \
tasty-quickcheck-0.11 \
tasty-rerun-1.1.19_4 \
tdigest-0.3.1 \
temporary-1.3 \
terminal-size-0.3.4_1 \
testing-type-modifiers-0.1.0.1 \
text-2.0.2_1 \
text-builder-0.6.7 \
text-builder-dev-0.3.3.2 \
text-iso8601-0.1.1_1 \
text-manipulate-0.3.1.0 \
text-short-0.1.6_3 \
tf-random-0.5 \
th-abstraction-0.7.0.0 \
th-compat-0.1.5_2 \
th-env-0.1.1 \
th-expand-syns-0.4.11.0_4 \
th-lift-0.8.4_3 \
th-lift-instances-0.1.20 \
th-orphans-0.13.14_4 \
th-reify-many-0.1.10 \
th-utilities-0.2.5.0 \
these-1.2.1_2 \
time-compat-1.9.7_2 \
time-manager-0.1.0 \
time-units-1.0.0 \
tls-2.1.0 \
tracer-transformers-0.1.0.4:chap \
transformers-base-0.4.6 \
transformers-compat-0.7.2 \
transformers-except-0.1.4_1 \
tree-diff-0.3.1_1 \
trifecta-2.1.4_1 \
typed-process-0.2.12.0 \
typed-protocols-0.1.1.0_3:chap \
typed-protocols-cborg-0.1.0.4_2:chap \
typed-protocols-examples-0.2.0.2:chap \
unagi-chan-0.4.1.4 \
unbounded-delays-0.1.1.1 \
unicode-data-0.6.0_2 \
unicode-transforms-0.4.0.1_6 \
universe-base-1.1.4_1 \
unix-bytestring-0.4.0.2 \
unix-compat-0.7.2 \
unix-time-0.4.15 \
unliftio-0.2.25.0 \
unliftio-core-0.2.1.0_4 \
unordered-containers-0.2.20_4 \
utf8-string-1.0.2 \
utility-ht-0.0.17.2 \
uuid-types-1.0.6_2 \
validation-1.1.3_1 \
validation-selective-0.2.0.0.0.0.0.0.1:chap \
validity-0.12.1.0 \
vault-0.3.1.5_9 \
vector-0.13.1.0_2 \
vector-algorithms-0.9.0.2_1 \
vector-binary-instances-0.2.5.2_5 \
vector-map-1.1.0.0:chap \
vector-stream-0.1.0.1_3 \
vector-th-unbox-0.2.2_8 \
void-0.7.3 \
wai-3.2.4 \
wai-app-static-3.1.9 \
wai-extra-3.1.14 \
wai-logger-2.4.1 \
warp-3.4.2 \
with-utf8-1.1.0.0_1 \
witherable-0.5_1 \
wl-pprint-annotated-0.1.0.1_3 \
wl-pprint-text-1.2.0.2_3 \
word8-0.1.3 \
yaml-0.11.11.2_2 \
zlib-0.7.1.0_2 \
zlib-bindings-0.1.1.5_2
CABAL_PROJECT= append
CABAL_EXECUTABLES= cardano-node cardano-submit-api cardano-tracer
CABAL_REPOSITORIES= chap
BUILD_ARGS= --ghc-option -Wwarn
WITH_LTO= yes
post-patch:
${REINPLACE_CMD} -e 's/$$(gitRevFromGit)/"${CARDANO_NODE_HASH}"/' \
-e '/Cardano.Git.RevFromGit/d' \
${WRKSRC}/_cabal_deps/cardano-git-rev-0.2.2.0/src/Cardano/Git/Rev.hs
pre-build:
@${MKDIR} ${PKGCONFIG_LINKDIR}
cd ${WRKSRC_sodium} && ./autogen.sh
cd ${WRKSRC_sodium} && ./configure --prefix=${LIBS_PREFIX} --with-pthreads --disable-shared
cd ${WRKSRC_sodium} && ${GMAKE} -j${MAKE_JOBS_NUMBER} && ${GMAKE} ${INSTALL_TARGET}
${MV} ${LIBS_PREFIX}/lib/pkgconfig/libsodium.pc ${PKGCONFIG_LINKDIR}
.include <bsd.port.mk>
File diff suppressed because it is too large Load Diff
-338
View File
@@ -1,338 +0,0 @@
#!/bin/sh
# PROVIDE: cardano_node
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# -----------------------------------------------------------------------------
#
# This script supports running multiple instances of the daemon.
# To run additional instances make a symlink to script under different name:
#
# % ln -s %%PREFIX%%/etc/rc.d/cardano_node %%PREFIX%%/etc/rc.d/SOMENAME
#
# and define corresponding SOMENAME_* variables in /etc/rc.conf
# For example, if you linked the script to cardano_node_testnet, then each
# variable listed below should read as cardano_node_testnet_enable, etc.
#
# -----------------------------------------------------------------------------
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# cardano_node_enable: Set to YES to enable cardano-node.
# Default: "NO"
#
# cardano_node_jail_enable: Set to NO to disable running cardano-node in the jail.
# Default: "YES"
#
# cardano_node_home: An absolute path to the daemon home directory.
# The directory will be created if not exists.
# Default: "/var/db/cardano_node"
#
# cardano_node_net: A network name to connect to.
# Default: "mainnet"
#
# cardano_node_port: Port to listen for connections on.
# Default: "6000"
#
# Advanced settings that usually don't need to be changed for simple usage cases:
#
# cardano_node_host: Host address to bind to.
# Default: "0.0.0.0"
#
#
# cardano_node_socket: An absolute path to the daemon socket file.
# Default: "${cardano_node_home}/cardano-node.sock"
#
# cardano_node_db: An absolute path to the database directory.
# Default: "${cardano_node_home}/${cardano_node_net}-db"
#
# cardano_node_topology: An absolute or a relative to ${cardano_node_home} path
# to the topology JSON file.
# Default: "${cardano_node_net}-configs/topology.json"
#
# cardano_node_config: An absolute or a relative to ${cardano_node_home} path
# to the cardano-node config.json file.
# Default: "${cardano_node_net}-configs/config.json"
#
# cardano_node_rts_flags: GHC runtime flags to be passed between "+RTS" and "-RTS".
# See https://downloads.haskell.org/ghc/latest/docs/html/users_guide/runtime_control.html
# for the meaning of these flags.
# Default: "-N -A64m -n4m -F1.2 -qg1"
#
# cardano_node_flags: Any additional command line flags to pass to cardano-node.
# Default: ""
#
. /etc/rc.subr
# The following code snippet was taken from security/openvpn/files/openvpn.in rc script.
# service(8) does not create an authentic environment, try to guess,
# and as of 10.3-RELEASE-p0, it will not find the indented name=
# assignments below. So give it a default.
# Trailing semicolon also for service(8)'s benefit:
name="$file" ;
case "$0" in
/etc/rc*)
# during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),
# so get the name of the script from $_file
name="$_file"
;;
*/service)
# do not use this as $0
;;
*)
name="$0"
;;
esac
# default name to "cardano_node" if guessing failed
# Trailing semicolon also for service(8)'s benefit:
name="${name:-cardano_node}" ;
name="${name##*/}"
desc="Cardano Node daemon"
rcvar="${name}_enable"
command=%%PREFIX%%/bin/cardano-node
cardano_deployment_url="https://raw.githubusercontent.com/cardano-bsd-alliance/freebsd-ports-cardano-artifacts/master/cardano-node"
cardano_config_files="config byron-genesis shelley-genesis alonzo-genesis conway-genesis topology submit-api-config"
cardano_networks="mainnet preview preprod"
start_cmd="cardano_node_start"
start_precmd="cardano_node_prestart"
stop_cmd="cardano_node_stop"
status_cmd="cardano_node_status"
reload_cmd="cardano_node_reload"
fetch_cmd="cardano_node_fetch"
extra_commands="status fetch reload"
load_rc_config $name
eval ": \${${name}_enable:=NO}"
eval ": \${${name}_jail_enable:=YES}"
eval ": \${${name}_home:=\"/var/db/cardano_node\"}"
eval ": \${${name}_net:=\"mainnet\"}"
eval ": \${${name}_host:=\"0.0.0.0\"}"
eval ": \${${name}_port:=\"6000\"}"
eval ": \${${name}_socket:=\"\${${name}_home}/cardano-node.sock\"}"
eval ": \${${name}_db:=\"\${${name}_home}/\${${name}_net}-db\"}"
eval ": \${${name}_topology:=\"\${${name}_net}-configs/topology.json\"}"
eval ": \${${name}_config:=\"\${${name}_net}-configs/config.json\"}"
eval ": \${${name}_rts_flags:=\"-N -A64m -n4m -F1.2 -qg1\"}"
eval ": \${${name}_flags:=\"\"}"
# aliases
eval "_jail_enable=\${${name}_jail_enable}"
eval "_home=\${${name}_home}"
eval "_topology=\${${name}_topology}"
eval "_config=\${${name}_config}"
eval "_socket=\${${name}_socket}"
eval "_db=\${${name}_db}"
eval "_rts_flags=\${${name}_rts_flags}"
eval "_host=\${${name}_host}"
eval "_port=\${${name}_port}"
eval "_flags=\${${name}_flags}"
jail_topology="/topology_dir/`basename ${_topology}`"
jail_config="/config_dir/`basename ${_config}`"
jail_socket="/socket/`basename ${_socket}`"
jail_args="name=${name}_jail exec.jail_user=cardano exec.system_jail_user host=inherit"
jail_command=/bin/cardano-node
jail_root="${_home}/jail"
jail_copy_resolv_conf=yes
jail_copy_services=yes
jail_copy_programs="$command /usr/sbin/nologin"
jail_mount_devfs=yes
jail_ip_inherit=yes
#TODO: daemon fails with "Network.Socket.bind: permission denied" without suid ;\
jail_prepare_inside_cmds="mkdir ./socket ;\
ln -s ${_home}/jail/${jail_socket} ${_socket} ;\
chmod +s .${jail_command}"
jail_nullfs_mounts="${_db} ${jail_root}/db rw \
${_home}/logs ${jail_root}/logs rw"
if checkyesno "_jail_enable"; then
_socket_arg="${jail_socket}"
_topology_arg="${jail_topology}"
_config_arg="${jail_config}"
_db_arg="/db"
# We need to override ${command} to make check_pidfile work correctly when
# rc.subr calls it as "check_pidfile ${pidfile} ${command}"
command=/usr/sbin/jail
else
_socket_arg="${_socket}"
_topology_arg="${_topology}"
_config_arg="${_config}"
_db_arg="${_db}"
fi
pidfile="/var/run/${name}.pid"
flags="run +RTS ${_rts_flags} -RTS \
--database-path ${_db_arg} \
--host-addr ${_host} \
--port ${_port} \
--socket-path ${_socket_arg} \
--topology ${_topology_arg} \
--config ${_config_arg} \
${_flags}"
. %%LOCALBASE%%/share/rc-subr-jail/rc.subr.jail
# realpath2 path
# Returns an absolute path to ${_home}/${path} if it exists, otherwise
# treats ${path} as absolute
realpath2()
{
local _path _realpath
_path=$1
_realpath=$(/bin/sh -c "cd ${_home} && realpath ${_path}" 2> /dev/null)
if [ $? != "0" ]
then
return 1
else
echo $_realpath
fi
}
sanity_check()
{
realpath2 ${_topology} > /dev/null
if [ $? != "0" ]
then
echo "Invalid value for ${name}_topology: missing file ${_topology}"
echo "You might want to run service ${name} onefetch to download this file into default dir"
exit 1
fi
realpath2 ${_config} > /dev/null
if [ $? != "0" ]
then
echo "Invalid value for cardano_node_config: missing file ${_config}"
echo "You might want to run service ${name} onefetch to download this file into the default dir"
exit 1
fi
return 0
}
cardano_node_prestart()
{
# Create Cardano home directory, if not exists
if [ ! -d "${_home}" ]; then
mkdir -p "${_home}"
chown cardano:cardano "${_home}"
fi
# Do the same for the logs directory
if [ ! -d "${_home}/logs" ]; then
mkdir -p "${_home}/logs"
chown cardano:cardano "${_home}/logs"
fi
# Remove the symlink to the socket file if there is no pid file
if [ -L "${_socket}" -a ! -f $pidfile ]; then
rm "${_socket}"
fi
sanity_check
}
cardano_node_start()
{
check_startmsgs && echo "Starting ${name}."
local _topo _conf
_topo=$(realpath2 ${_topology})
_conf=$(realpath2 ${_config})
jail_nullfs_mounts="$jail_nullfs_mounts $(dirname ${_topo}) ${jail_root}/topology_dir ro"
jail_nullfs_mounts="$jail_nullfs_mounts $(dirname ${_conf}) ${jail_root}/config_dir ro"
if checkyesno "_jail_enable"; then
prepare_jail $jail_root
if [ "$?" != "0" ]; then
echo "Failed to start ${name}: jail creation error"
return 1
fi
cd $_home && /bin/sh -c "/usr/sbin/daemon -p $pidfile -S -T cardano-node \
${command} -c ${jail_prepared_args} ${jail_args} command=${jail_command} ${flags}"
else
cd $_home && /usr/sbin/daemon -p $pidfile -S -T cardano-node \
${command} ${flags}
fi
}
cardano_node_stop()
{
local _topo _conf _ret
_topo=$(realpath2 ${_topology})
_conf=$(realpath2 ${_config})
jail_nullfs_mounts="$jail_nullfs_mounts $(dirname ${_topo}) ${jail_root}/topology_dir ro"
jail_nullfs_mounts="$jail_nullfs_mounts $(dirname ${_conf}) ${jail_root}/config_dir ro"
pid=$(check_pidfile "${pidfile}" "$command")
if [ -z "${pid}" ]
then
echo "${name} is not running"
_ret=1
else
echo "Stopping ${name}."
kill_jail "$pid" -INT "_jail_enable"
wait_for_pids "$pid"
_ret=0
fi
if checkyesno "_jail_enable"; then
destroy_jail $jail_root 2> /dev/null
fi
rm -rf ${_socket}
return $_ret
}
cardano_node_status()
{
pid=$(check_pidfile "${pidfile}" "$command")
if [ -z "${pid}" ]
then
echo "${name} is not running"
return 1
else
echo ${name} is running as pid $pid
fi
}
cardano_node_reload()
{
pid=$(check_pidfile "${pidfile}" "$command")
if [ -z "${pid}" ]
then
echo "${name} is not running"
return 1
else
kill_jail "$pid" -HUP "_jail_enable"
fi
}
cardano_node_fetch()
{
for net in ${cardano_networks}
do
echo "===> Fetching configuration files for ${net}"
mkdir -p "${_home}/${net}-configs"
mkdir -p "${_home}/${net}-db"
/usr/bin/apply "/usr/bin/fetch -a -o \
${_home}/${net}-configs ${cardano_deployment_url}/${net}-configs/%1.json" $cardano_config_files
chown -R cardano:cardano "${_home}/${net}-configs"
chown -R cardano:cardano "${_home}/${net}-db"
done
}
run_rc_command "$1"
@@ -1,21 +0,0 @@
cabal-install ignores the --offline flag for custom package repositories, which
makes the build fail under poudriere
--- cabal.project.orig 2024-04-09 10:02:31 UTC
+++ cabal.project
@@ -1,15 +1,3 @@
--- Custom repository for cardano haskell packages, see CONTRIBUTING for more
-repository cardano-haskell-packages
- url: https://chap.intersectmbo.org/
- secure: True
- root-keys:
- 3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
- 443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
- a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
- bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
- c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
- d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
-
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
-6
View File
@@ -1,6 +0,0 @@
Cardano is a proof-of-stake blockchain platform built by a decentralized
community of scientists, engineers, and thought leaders. Cardano is based on
Ouroboros, an environmentally sustainable, verifiably secure consensus protocol
with rigorous security guarantees.
This package provides a daemon program to run the Cardano node.