Skip to content

Commit 3c6af3c

Browse files
committed
Create debian package of the Stellar RPC executable !!
1 parent e4d0365 commit 3c6af3c

14 files changed

+199
-0
lines changed

stellar-rpc/debian/README

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The Debian Package stellar-rpc
2+
----------------------------
3+
4+
RPC is the client facing API server for the Stellar Soroban ecosystem.
5+
6+
-- Package Maintainer <packages@stellar.org>

stellar-rpc/debian/changelog

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
stellar-rpc (_VERSION_-_BUILD_VERSION_) stable; urgency=medium
2+
3+
* Initial Release.
4+
5+
-- Package Maintainer <packages@stellar.org> Mon, 02 Nov 2022 08:44:05 +0000

stellar-rpc/debian/compat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

stellar-rpc/debian/control

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Source: stellar-rpc
2+
Section: web
3+
Priority: optional
4+
Maintainer: Package Maintainer <packages@stellar.org>
5+
Build-Depends: debhelper (>=9), dh-systemd (>=1.5)
6+
Standards-Version: 3.9.6
7+
Homepage: https://www.stellar.org/
8+
9+
Package: stellar-rpc
10+
Architecture: any
11+
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.
12+

stellar-rpc/debian/copyright

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: stellar-rpc
3+
Source: https://www.stellar.org/
4+
5+
Files: *
6+
Copyright: 2017 Stellar Development Foundation
7+
License: Apache 2.0
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
.
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
.
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
.
20+
On Debian systems, the complete text of the Apache License 2.0 can
21+
be found in "/usr/share/common-licenses/Apache-2.0"

stellar-rpc/debian/rules

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/make -f
2+
# See debhelper(7) (uncomment to enable)
3+
# output every command that modifies files on the build system.
4+
#export DH_VERBOSE = 1
5+
6+
7+
# see FEATURE AREAS in dpkg-buildflags(1)
8+
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9+
10+
# see ENVIRONMENT in dpkg-buildflags(1)
11+
# package maintainers to append CFLAGS
12+
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
13+
# package maintainers to append LDFLAGS
14+
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
15+
16+
17+
%:
18+
dh $@ --with systemd
19+
20+
override_dh_systemd_start:
21+
dh_systemd_start --restart-after-upgrade
22+
23+
# Disable dh_strip to ship unmodified binary in the package.
24+
# This allows anyone to "go build" exactly the same binary
25+
# we ship with the package (reproducible builds)
26+
override_dh_strip:
27+
28+
# dh_make generated override targets
29+
# This is example for Cmake (See https://bugs.debian.org/641051 )
30+
#override_dh_auto_configure:
31+
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
32+

stellar-rpc/debian/source/format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (native)
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## /etc/default/stellar-rpc
2+
3+
# define the port on local machine that stellar rpc server will bind to.
4+
ENDPOINT=localhost:8003
5+
# for now rpc requires access to horizon, this will change.
6+
HORIZON_URL=http://localhost:8000
7+
NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022"
8+
# for now rpc requires access to core, this will change.
9+
STELLAR_CORE_URL="http://localhost:11626"
10+
11+
# minimum log severity (debug, info, warn, error), default=info
12+
# LOG_LEVEL=info
13+
# Maximum number of concurrent transaction submissions, default=10
14+
# TX_CONCURRENCY=10
15+
# Maximum length of pending transactions queue, default=10
16+
# TX_QUEUE=10
17+

stellar-rpc/debian/stellar-rpc.dirs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/var/lib/stellar/
2+
/var/log/stellar/
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
stellar-rpc usr/bin/

stellar-rpc/debian/stellar-rpc.links

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/stellar/stellar-core_captive-futurenet.cfg /etc/stellar/soroban-rpc/stellar-captive-core.cfg
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
# postinst script for stellar-rpc
3+
#
4+
# see: dh_installdeb(1)
5+
6+
set -e
7+
8+
# summary of how this script can be called:
9+
# * <postinst> `configure' <most-recently-configured-version>
10+
# * <old-postinst> `abort-upgrade' <new version>
11+
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12+
# <new-version>
13+
# * <postinst> `abort-remove'
14+
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15+
# <failed-install-package> <version> `removing'
16+
# <conflicting-package> <version>
17+
# for details, see https://www.debian.org/doc/debian-policy/ or
18+
# the debian-policy package
19+
ROLE=stellar;
20+
21+
case "$1" in
22+
configure)
23+
# check stellar user exists
24+
if ! getent passwd stellar > /dev/null; then
25+
adduser --system --group --quiet --home /var/lib/stellar \
26+
--no-create-home --disabled-password --shell /bin/bash $ROLE;
27+
fi
28+
29+
chown -R stellar:stellar /var/lib/stellar/ /var/log/stellar/
30+
;;
31+
32+
abort-upgrade|abort-remove|abort-deconfigure)
33+
;;
34+
35+
*)
36+
echo "postinst called with unknown argument \`$1'" >&2
37+
exit 1
38+
;;
39+
esac
40+
41+
# dh_installdeb will replace this with shell code automatically
42+
# generated by other debhelper scripts.
43+
44+
#DEBHELPER#
45+
46+
exit 0
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Unit]
2+
Description=SDF - stellar-rpc
3+
Before=multi-user.target
4+
5+
[Service]
6+
User=stellar
7+
Group=stellar
8+
LimitNOFILE=8192
9+
StandardOutput=append:/var/log/stellar/stellar-rpc.log
10+
StandardError=append:/var/log/stellar/stellar-rpc.log
11+
SyslogIdentifier=stellar-rpc
12+
EnvironmentFile=/etc/default/stellar-rpc
13+
ExecStart=/usr/bin/stellar-rpc
14+
ExecReload=/bin/kill -HUP $MAINPID
15+
KillMode=process
16+
Restart=on-failure
17+
RestartPreventExitStatus=255
18+
Type=simple
19+
20+
[Install]
21+
WantedBy=multi-user.target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This is a sample configuration from the stellar-captive-core package.
2+
# Please note that only HOME_DOMAINS and VALIDATORS tables are required.
3+
4+
# IMPORTANT
5+
# You need to change domains and validators below to fit your needs
6+
7+
# captive core config for futurenet
8+
NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022"
9+
# disable the web service port, not used
10+
HTTP_PORT=0
11+
PUBLIC_HTTP_PORT=false
12+
# To avoid conflicts with the core instance
13+
PEER_PORT=11726
14+
DATABASE="sqlite3:///var/lib/stellar/soroban-rpc/captive-core/stellar-rpc.db"
15+
16+
EXPERIMENTAL_BUCKETLIST_DB=true
17+
EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT=12
18+
ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=false
19+
20+
FAILURE_SAFETY=0
21+
UNSAFE_QUORUM=true
22+
23+
[[HOME_DOMAINS]]
24+
HOME_DOMAIN="futurenet.stellar.org"
25+
QUALITY="MEDIUM"
26+
27+
[[VALIDATORS]]
28+
NAME="sdf_futurenet_1"
29+
HOME_DOMAIN="futurenet.stellar.org"
30+
PUBLIC_KEY="GBRIF2N52GVN3EXBBICD5F4L5VUFXK6S6VOUCF6T2DWPLOLGWEPPYZTF"
31+
ADDRESS="core-live-futurenet.stellar.org:11625"
32+
HISTORY="curl -sf https://history-futurenet.stellar.org/{0} -o {1}"
33+

0 commit comments

Comments
 (0)