From e9df7ee6ec3671be7527ef9020c41f786dd9b610 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Wed, 5 Apr 2023 14:58:05 +0100 Subject: [PATCH 1/8] Working on soroban-rpc dpkg including working captive-core out of the box --- stellar-soroban-rpc/debian/control | 1 + .../debian/stellar-soroban-rpc.default | 12 ++++--- .../debian/stellar-soroban-rpc.install | 1 + .../debian/stellar-soroban-rpc.links | 2 ++ .../stellar-core_captive-futurenet.cfg | 33 +++++++++++++++++++ 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 stellar-soroban-rpc/debian/stellar-soroban-rpc.links create mode 100644 stellar-soroban-rpc/stellar-core_captive-futurenet.cfg diff --git a/stellar-soroban-rpc/debian/control b/stellar-soroban-rpc/debian/control index d3a66e6..c29c790 100644 --- a/stellar-soroban-rpc/debian/control +++ b/stellar-soroban-rpc/debian/control @@ -8,5 +8,6 @@ Homepage: https://www.stellar.org/ Package: stellar-soroban-rpc Architecture: any +Depends: stellar-core Description: Soroban 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-soroban-rpc/debian/stellar-soroban-rpc.default b/stellar-soroban-rpc/debian/stellar-soroban-rpc.default index 154080d..36477dd 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.default +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.default @@ -2,11 +2,15 @@ # define the port on local machine that soroban rpc server will bind to. ENDPOINT=localhost:8003 -# for now rpc requires access to horizon, this will change. -HORIZON_URL=http://localhost:8000 +FRIENDBOT_URL=https://friendbot-futurenet.stellar.org/ NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022" -# for now rpc requires access to core, this will change. -STELLAR_CORE_URL="http://localhost:11626" +CAPTIVE_CORE_CONFIG_PATH=/etc/stellar/soroban-rpc/etc/stellar-captive-core.cfg +CAPTIVE_CORE_STORAGE_PATH=/var/lib/stellar/soroban-rpc/captive-core +CAPTIVE_CORE_USE_DB=true +STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core +HISTORY_ARCHIVE_URLS="http://history-futurenet.stellar.org" +DB_PATH="/var/lib/stellar/soroban-rpc/soroban_rpc.sqlite" +STELLAR_CAPTIVE_CORE_HTTP_PORT=0 # minimum log severity (debug, info, warn, error), default=info # LOG_LEVEL=info diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.install b/stellar-soroban-rpc/debian/stellar-soroban-rpc.install index f51c361..abe3f33 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.install +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.install @@ -1 +1,2 @@ stellar-soroban-rpc usr/bin/ +stellar-core_captive-futurenet.cfg etc/stellar diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.links b/stellar-soroban-rpc/debian/stellar-soroban-rpc.links new file mode 100644 index 0000000..03006f1 --- /dev/null +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.links @@ -0,0 +1,2 @@ +/etc/stellar/stellar-core_captive-futurenet.cfg /etc/stellar/soroban-rpc/etc/stellar-captive-core.cfg +/etc/default/stellar-captive-core /etc/default/stellar-soroban-rpc diff --git a/stellar-soroban-rpc/stellar-core_captive-futurenet.cfg b/stellar-soroban-rpc/stellar-core_captive-futurenet.cfg new file mode 100644 index 0000000..5bc348f --- /dev/null +++ b/stellar-soroban-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 http://history-futurenet.stellar.org/{0} -o {1}" + From c754adf79e341503f794a02d703176fec3506f90 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 10 Apr 2023 18:04:14 +0100 Subject: [PATCH 2/8] Set the exact core version in the jenkins pipeline --- stellar-soroban-rpc/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stellar-soroban-rpc/debian/control b/stellar-soroban-rpc/debian/control index c29c790..36d9677 100644 --- a/stellar-soroban-rpc/debian/control +++ b/stellar-soroban-rpc/debian/control @@ -8,6 +8,6 @@ Homepage: https://www.stellar.org/ Package: stellar-soroban-rpc Architecture: any -Depends: stellar-core +Depends: stellar-core (= _CORE_VERSION_) Description: Soroban 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. From bec314ef7ed74d3c6a162d1206f413d5246bb128 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 10 Apr 2023 18:52:50 +0100 Subject: [PATCH 3/8] Need to create the captive-core db dir --- stellar-soroban-rpc/debian/stellar-soroban-rpc.dirs | 1 + 1 file changed, 1 insertion(+) diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.dirs b/stellar-soroban-rpc/debian/stellar-soroban-rpc.dirs index 40ff31a..d4c2fa0 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.dirs +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.dirs @@ -1,2 +1,3 @@ /var/lib/stellar/ +/var/lib/stellar/soroban-rpc/captive-core/ /var/log/stellar/ From 1682460b3590c5f7efc106783b320dfe0a58dba9 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 10 Apr 2023 18:54:08 +0100 Subject: [PATCH 4/8] Remove bogus link --- stellar-soroban-rpc/debian/stellar-soroban-rpc.links | 1 - 1 file changed, 1 deletion(-) diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.links b/stellar-soroban-rpc/debian/stellar-soroban-rpc.links index 03006f1..c57af55 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.links +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.links @@ -1,2 +1 @@ /etc/stellar/stellar-core_captive-futurenet.cfg /etc/stellar/soroban-rpc/etc/stellar-captive-core.cfg -/etc/default/stellar-captive-core /etc/default/stellar-soroban-rpc From f4f32fb92fb400ed9f3b3d4ec40ea4d30cec4f65 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Wed, 12 Apr 2023 16:27:32 +0100 Subject: [PATCH 5/8] Update stellar-soroban-rpc/debian/stellar-soroban-rpc.default Co-authored-by: jacekn --- stellar-soroban-rpc/debian/stellar-soroban-rpc.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.default b/stellar-soroban-rpc/debian/stellar-soroban-rpc.default index 36477dd..9346600 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.default +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.default @@ -8,7 +8,7 @@ CAPTIVE_CORE_CONFIG_PATH=/etc/stellar/soroban-rpc/etc/stellar-captive-core.cfg CAPTIVE_CORE_STORAGE_PATH=/var/lib/stellar/soroban-rpc/captive-core CAPTIVE_CORE_USE_DB=true STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core -HISTORY_ARCHIVE_URLS="http://history-futurenet.stellar.org" +HISTORY_ARCHIVE_URLS="https://history-futurenet.stellar.org" DB_PATH="/var/lib/stellar/soroban-rpc/soroban_rpc.sqlite" STELLAR_CAPTIVE_CORE_HTTP_PORT=0 From f221611509b45433d9e36b4bff1008b70e1a862c Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Wed, 12 Apr 2023 16:27:50 +0100 Subject: [PATCH 6/8] Update stellar-soroban-rpc/debian/stellar-soroban-rpc.default Co-authored-by: jacekn --- stellar-soroban-rpc/debian/stellar-soroban-rpc.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.default b/stellar-soroban-rpc/debian/stellar-soroban-rpc.default index 9346600..961d247 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.default +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.default @@ -4,7 +4,7 @@ ENDPOINT=localhost:8003 FRIENDBOT_URL=https://friendbot-futurenet.stellar.org/ NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022" -CAPTIVE_CORE_CONFIG_PATH=/etc/stellar/soroban-rpc/etc/stellar-captive-core.cfg +CAPTIVE_CORE_CONFIG_PATH=/etc/stellar/soroban-rpc/stellar-captive-core.cfg CAPTIVE_CORE_STORAGE_PATH=/var/lib/stellar/soroban-rpc/captive-core CAPTIVE_CORE_USE_DB=true STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core From a457443c8f06c84aca6e0c45f2eaee9396d8c006 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Wed, 12 Apr 2023 16:28:00 +0100 Subject: [PATCH 7/8] Update stellar-soroban-rpc/debian/stellar-soroban-rpc.links Co-authored-by: jacekn --- stellar-soroban-rpc/debian/stellar-soroban-rpc.links | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stellar-soroban-rpc/debian/stellar-soroban-rpc.links b/stellar-soroban-rpc/debian/stellar-soroban-rpc.links index c57af55..511d085 100644 --- a/stellar-soroban-rpc/debian/stellar-soroban-rpc.links +++ b/stellar-soroban-rpc/debian/stellar-soroban-rpc.links @@ -1 +1 @@ -/etc/stellar/stellar-core_captive-futurenet.cfg /etc/stellar/soroban-rpc/etc/stellar-captive-core.cfg +/etc/stellar/stellar-core_captive-futurenet.cfg /etc/stellar/soroban-rpc/stellar-captive-core.cfg From 82a3c2c1ae216b8ad0726750173ff4d570a854a3 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Wed, 12 Apr 2023 16:28:14 +0100 Subject: [PATCH 8/8] Update stellar-soroban-rpc/stellar-core_captive-futurenet.cfg Co-authored-by: jacekn --- stellar-soroban-rpc/stellar-core_captive-futurenet.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stellar-soroban-rpc/stellar-core_captive-futurenet.cfg b/stellar-soroban-rpc/stellar-core_captive-futurenet.cfg index 5bc348f..cfb5d7e 100644 --- a/stellar-soroban-rpc/stellar-core_captive-futurenet.cfg +++ b/stellar-soroban-rpc/stellar-core_captive-futurenet.cfg @@ -29,5 +29,5 @@ NAME="sdf_futurenet_1" HOME_DOMAIN="futurenet.stellar.org" PUBLIC_KEY="GBRIF2N52GVN3EXBBICD5F4L5VUFXK6S6VOUCF6T2DWPLOLGWEPPYZTF" ADDRESS="core-live-futurenet.stellar.org:11625" -HISTORY="curl -sf http://history-futurenet.stellar.org/{0} -o {1}" +HISTORY="curl -sf https://history-futurenet.stellar.org/{0} -o {1}"