diff --git a/stellar-rpc/debian/README b/stellar-rpc/debian/README new file mode 100644 index 0000000..83e5646 --- /dev/null +++ b/stellar-rpc/debian/README @@ -0,0 +1,6 @@ +The Debian Package stellar-rpc +---------------------------- + +RPC is the client facing API server for the Stellar Soroban ecosystem. + + -- Package Maintainer diff --git a/stellar-rpc/debian/changelog b/stellar-rpc/debian/changelog new file mode 100644 index 0000000..04776b2 --- /dev/null +++ b/stellar-rpc/debian/changelog @@ -0,0 +1,5 @@ +stellar-rpc (_VERSION_-_BUILD_VERSION_) stable; urgency=medium + + * Initial Release. + + -- Package Maintainer Mon, 02 Nov 2022 08:44:05 +0000 \ No newline at end of file diff --git a/stellar-rpc/debian/compat b/stellar-rpc/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/stellar-rpc/debian/compat @@ -0,0 +1 @@ +9 diff --git a/stellar-rpc/debian/control b/stellar-rpc/debian/control new file mode 100644 index 0000000..e648926 --- /dev/null +++ b/stellar-rpc/debian/control @@ -0,0 +1,12 @@ +Source: stellar-rpc +Section: web +Priority: optional +Maintainer: Package Maintainer +Build-Depends: debhelper (>=9), dh-systemd (>=1.5) +Standards-Version: 3.9.6 +Homepage: https://www.stellar.org/ + +Package: stellar-rpc +Architecture: any +Description: Stellar RPC is the client facing API server for the Stellar Soraban Smart Contracts ecosystem. It acts as the interface between stellar-core and applications that want to access smart contracts on the Stellar network. + diff --git a/stellar-rpc/debian/copyright b/stellar-rpc/debian/copyright new file mode 100644 index 0000000..f7ce222 --- /dev/null +++ b/stellar-rpc/debian/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: stellar-rpc +Source: https://www.stellar.org/ + +Files: * +Copyright: 2017 Stellar Development Foundation +License: Apache 2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache License 2.0 can + be found in "/usr/share/common-licenses/Apache-2.0" diff --git a/stellar-rpc/debian/rules b/stellar-rpc/debian/rules new file mode 100755 index 0000000..21fa460 --- /dev/null +++ b/stellar-rpc/debian/rules @@ -0,0 +1,32 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ --with systemd + +override_dh_systemd_start: + dh_systemd_start --restart-after-upgrade + +# Disable dh_strip to ship unmodified binary in the package. +# This allows anyone to "go build" exactly the same binary +# we ship with the package (reproducible builds) +override_dh_strip: + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/stellar-rpc/debian/source/format b/stellar-rpc/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/stellar-rpc/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/stellar-rpc/debian/stellar-rpc.default b/stellar-rpc/debian/stellar-rpc.default new file mode 100644 index 0000000..17a980d --- /dev/null +++ b/stellar-rpc/debian/stellar-rpc.default @@ -0,0 +1,17 @@ +## /etc/default/stellar-rpc + +# define the port on local machine that stellar rpc server will bind to. +ENDPOINT=localhost:8003 +# for now rpc requires access to horizon, this will change. +HORIZON_URL=http://localhost:8000 +NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022" +# for now rpc requires access to core, this will change. +STELLAR_CORE_URL="http://localhost:11626" + +# minimum log severity (debug, info, warn, error), default=info +# LOG_LEVEL=info +# Maximum number of concurrent transaction submissions, default=10 +# TX_CONCURRENCY=10 +# Maximum length of pending transactions queue, default=10 +# TX_QUEUE=10 + diff --git a/stellar-rpc/debian/stellar-rpc.dirs b/stellar-rpc/debian/stellar-rpc.dirs new file mode 100644 index 0000000..40ff31a --- /dev/null +++ b/stellar-rpc/debian/stellar-rpc.dirs @@ -0,0 +1,2 @@ +/var/lib/stellar/ +/var/log/stellar/ diff --git a/stellar-rpc/debian/stellar-rpc.install b/stellar-rpc/debian/stellar-rpc.install new file mode 100644 index 0000000..a172073 --- /dev/null +++ b/stellar-rpc/debian/stellar-rpc.install @@ -0,0 +1 @@ +stellar-rpc usr/bin/ diff --git a/stellar-rpc/debian/stellar-rpc.links b/stellar-rpc/debian/stellar-rpc.links new file mode 100644 index 0000000..511d085 --- /dev/null +++ b/stellar-rpc/debian/stellar-rpc.links @@ -0,0 +1 @@ +/etc/stellar/stellar-core_captive-futurenet.cfg /etc/stellar/soroban-rpc/stellar-captive-core.cfg diff --git a/stellar-rpc/debian/stellar-rpc.postinst b/stellar-rpc/debian/stellar-rpc.postinst new file mode 100644 index 0000000..b594755 --- /dev/null +++ b/stellar-rpc/debian/stellar-rpc.postinst @@ -0,0 +1,46 @@ +#!/bin/sh +# postinst script for stellar-rpc +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package +ROLE=stellar; + +case "$1" in + configure) + # check stellar user exists + if ! getent passwd stellar > /dev/null; then + adduser --system --group --quiet --home /var/lib/stellar \ + --no-create-home --disabled-password --shell /bin/bash $ROLE; + fi + + chown -R stellar:stellar /var/lib/stellar/ /var/log/stellar/ + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/stellar-rpc/debian/stellar-rpc.service b/stellar-rpc/debian/stellar-rpc.service new file mode 100644 index 0000000..65767fc --- /dev/null +++ b/stellar-rpc/debian/stellar-rpc.service @@ -0,0 +1,21 @@ +[Unit] +Description=SDF - stellar-rpc +Before=multi-user.target + +[Service] +User=stellar +Group=stellar +LimitNOFILE=8192 +StandardOutput=append:/var/log/stellar/stellar-rpc.log +StandardError=append:/var/log/stellar/stellar-rpc.log +SyslogIdentifier=stellar-rpc +EnvironmentFile=/etc/default/stellar-rpc +ExecStart=/usr/bin/stellar-rpc +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure +RestartPreventExitStatus=255 +Type=simple + +[Install] +WantedBy=multi-user.target diff --git a/stellar-rpc/stellar-core_captive-futurenet.cfg b/stellar-rpc/stellar-core_captive-futurenet.cfg new file mode 100644 index 0000000..cfb5d7e --- /dev/null +++ b/stellar-rpc/stellar-core_captive-futurenet.cfg @@ -0,0 +1,33 @@ +# This is a sample configuration from the stellar-captive-core package. +# Please note that only HOME_DOMAINS and VALIDATORS tables are required. + +# IMPORTANT +# You need to change domains and validators below to fit your needs + +# captive core config for futurenet +NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022" +# disable the web service port, not used +HTTP_PORT=0 +PUBLIC_HTTP_PORT=false +# To avoid conflicts with the core instance +PEER_PORT=11726 +DATABASE="sqlite3:///var/lib/stellar/soroban-rpc/captive-core/stellar-rpc.db" + +EXPERIMENTAL_BUCKETLIST_DB=true +EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT=12 +ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=false + +FAILURE_SAFETY=0 +UNSAFE_QUORUM=true + +[[HOME_DOMAINS]] +HOME_DOMAIN="futurenet.stellar.org" +QUALITY="MEDIUM" + +[[VALIDATORS]] +NAME="sdf_futurenet_1" +HOME_DOMAIN="futurenet.stellar.org" +PUBLIC_KEY="GBRIF2N52GVN3EXBBICD5F4L5VUFXK6S6VOUCF6T2DWPLOLGWEPPYZTF" +ADDRESS="core-live-futurenet.stellar.org:11625" +HISTORY="curl -sf https://history-futurenet.stellar.org/{0} -o {1}" +