From 11fad84d302b4588d99a2e33c105f58a8a38729e Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:01:57 +1000 Subject: [PATCH 1/2] run stellar-rpc as rpcv2 --- Dockerfile | 2 +- common/stellar-rpc/bin/start | 2 +- futurenet/stellar-rpc/etc/stellar-rpc.cfg | 13 ------------ futurenet/stellar-rpc/etc/stellar-rpc.toml | 24 ++++++++++++++++++++++ local/stellar-rpc/etc/stellar-rpc.cfg | 13 ------------ local/stellar-rpc/etc/stellar-rpc.toml | 23 +++++++++++++++++++++ pubnet/stellar-rpc/etc/stellar-rpc.cfg | 12 ----------- pubnet/stellar-rpc/etc/stellar-rpc.toml | 21 +++++++++++++++++++ start | 5 ++--- testnet/stellar-rpc/etc/stellar-rpc.cfg | 13 ------------ testnet/stellar-rpc/etc/stellar-rpc.toml | 24 ++++++++++++++++++++++ 11 files changed, 96 insertions(+), 56 deletions(-) delete mode 100644 futurenet/stellar-rpc/etc/stellar-rpc.cfg create mode 100644 futurenet/stellar-rpc/etc/stellar-rpc.toml delete mode 100644 local/stellar-rpc/etc/stellar-rpc.cfg create mode 100644 local/stellar-rpc/etc/stellar-rpc.toml delete mode 100644 pubnet/stellar-rpc/etc/stellar-rpc.cfg create mode 100644 pubnet/stellar-rpc/etc/stellar-rpc.toml delete mode 100644 testnet/stellar-rpc/etc/stellar-rpc.cfg create mode 100644 testnet/stellar-rpc/etc/stellar-rpc.toml diff --git a/Dockerfile b/Dockerfile index 4c6a2f21..1e751316 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,7 +105,7 @@ COPY apt-retry /usr/local/bin/ RUN apt-retry sh -c 'apt-get update && apt-get install -y build-essential jq' && apt-get clean RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLCHAIN_VERSION -RUN make build-stellar-rpc +RUN make build-stellar-rpc RPCV2=true FROM scratch AS stellar-rpc-stage diff --git a/common/stellar-rpc/bin/start b/common/stellar-rpc/bin/start index 15c8878d..692d4e7f 100755 --- a/common/stellar-rpc/bin/start +++ b/common/stellar-rpc/bin/start @@ -4,4 +4,4 @@ set -e set -o pipefail echo "starting stellar-rpc..." -exec /usr/bin/stellar-rpc --config-path=/opt/stellar/stellar-rpc/etc/stellar-rpc.cfg +exec /usr/bin/stellar-rpc --enable-rpcv2 --config-path=/opt/stellar/stellar-rpc/etc/stellar-rpc.toml diff --git a/futurenet/stellar-rpc/etc/stellar-rpc.cfg b/futurenet/stellar-rpc/etc/stellar-rpc.cfg deleted file mode 100644 index 15f0f08b..00000000 --- a/futurenet/stellar-rpc/etc/stellar-rpc.cfg +++ /dev/null @@ -1,13 +0,0 @@ -ENDPOINT="localhost:8003" -ADMIN_ENDPOINT="__STELLAR_RPC_ADMIN_ENDPOINT__" -FRIENDBOT_URL="https://friendbot-futurenet.stellar.org/" -NETWORK_PASSPHRASE="__NETWORK__" -STELLAR_CORE_URL="http://localhost:11826" -CAPTIVE_CORE_CONFIG_PATH="/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" -CAPTIVE_CORE_STORAGE_PATH="/opt/stellar/stellar-rpc/captive-core" -CAPTIVE_CORE_USE_DB=true -STELLAR_CORE_BINARY_PATH="/usr/bin/stellar-core" -HISTORY_ARCHIVE_URLS="__ARCHIVE__" -DB_PATH="/opt/stellar/stellar-rpc/rpc_db.sqlite" -STELLAR_CAPTIVE_CORE_HTTP_PORT=11826 -CHECKPOINT_FREQUENCY=64 diff --git a/futurenet/stellar-rpc/etc/stellar-rpc.toml b/futurenet/stellar-rpc/etc/stellar-rpc.toml new file mode 100644 index 00000000..61d8ac7b --- /dev/null +++ b/futurenet/stellar-rpc/etc/stellar-rpc.toml @@ -0,0 +1,24 @@ +# The start script fills in the __X__ values. + +[storage] +default_data_dir = "/opt/stellar/stellar-rpc/data" + +[retention] +# Backfilling from genesis would take days, so keep history from the +# 10,000-ledger chunk holding the network tip at first start. +earliest_ledger = "now" + +[service] +endpoint = "localhost:8003" +admin_endpoint = "__STELLAR_RPC_ADMIN_ENDPOINT__" + +[service.methods.getNetwork] +friendbot_url = "https://friendbot-futurenet.stellar.org/" + +[ingestion] +# rpcv2 reads the network passphrase from the captive-core config. +captive_core_config = "/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" +captive_core_storage_path = "/opt/stellar/stellar-rpc/captive-core" +history_archive_urls = ["__ARCHIVE__"] +stellar_core_binary_path = "/usr/bin/stellar-core" +core_http_port = 11826 diff --git a/local/stellar-rpc/etc/stellar-rpc.cfg b/local/stellar-rpc/etc/stellar-rpc.cfg deleted file mode 100644 index 0e208dbc..00000000 --- a/local/stellar-rpc/etc/stellar-rpc.cfg +++ /dev/null @@ -1,13 +0,0 @@ -ENDPOINT="localhost:8003" -ADMIN_ENDPOINT="__STELLAR_RPC_ADMIN_ENDPOINT__" -FRIENDBOT_URL="http://localhost:8000/friendbot" -NETWORK_PASSPHRASE="__NETWORK__" -STELLAR_CORE_URL="http://localhost:11826" -CAPTIVE_CORE_CONFIG_PATH="/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" -CAPTIVE_CORE_STORAGE_PATH="/opt/stellar/stellar-rpc/captive-core" -CAPTIVE_CORE_USE_DB=true -STELLAR_CORE_BINARY_PATH="/usr/bin/stellar-core" -HISTORY_ARCHIVE_URLS=["__ARCHIVE__"] -DB_PATH="/opt/stellar/stellar-rpc/rpc_db.sqlite" -STELLAR_CAPTIVE_CORE_HTTP_PORT=11826 -CHECKPOINT_FREQUENCY=8 diff --git a/local/stellar-rpc/etc/stellar-rpc.toml b/local/stellar-rpc/etc/stellar-rpc.toml new file mode 100644 index 00000000..5bff94f1 --- /dev/null +++ b/local/stellar-rpc/etc/stellar-rpc.toml @@ -0,0 +1,23 @@ +# The start script fills in the __X__ values. + +[storage] +default_data_dir = "/opt/stellar/stellar-rpc/data" + +[retention] +# The local network is new, so keep all of its history. +earliest_ledger = "genesis" + +[service] +endpoint = "localhost:8003" +admin_endpoint = "__STELLAR_RPC_ADMIN_ENDPOINT__" + +[service.methods.getNetwork] +friendbot_url = "http://localhost:8000/friendbot" + +[ingestion] +# rpcv2 reads the network passphrase from the captive-core config. +captive_core_config = "/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" +captive_core_storage_path = "/opt/stellar/stellar-rpc/captive-core" +history_archive_urls = ["__ARCHIVE__"] +stellar_core_binary_path = "/usr/bin/stellar-core" +core_http_port = 11826 diff --git a/pubnet/stellar-rpc/etc/stellar-rpc.cfg b/pubnet/stellar-rpc/etc/stellar-rpc.cfg deleted file mode 100644 index 0497c71d..00000000 --- a/pubnet/stellar-rpc/etc/stellar-rpc.cfg +++ /dev/null @@ -1,12 +0,0 @@ -ENDPOINT="localhost:8003" -ADMIN_ENDPOINT="__STELLAR_RPC_ADMIN_ENDPOINT__" -NETWORK_PASSPHRASE="__NETWORK__" -STELLAR_CORE_URL="http://localhost:11826" -CAPTIVE_CORE_CONFIG_PATH="/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" -CAPTIVE_CORE_STORAGE_PATH="/opt/stellar/stellar-rpc/captive-core" -CAPTIVE_CORE_USE_DB=true -STELLAR_CORE_BINARY_PATH="/usr/bin/stellar-core" -HISTORY_ARCHIVE_URLS="__ARCHIVE__" -DB_PATH="/opt/stellar/stellar-rpc/rpc_db.sqlite" -STELLAR_CAPTIVE_CORE_HTTP_PORT=11826 -CHECKPOINT_FREQUENCY=64 diff --git a/pubnet/stellar-rpc/etc/stellar-rpc.toml b/pubnet/stellar-rpc/etc/stellar-rpc.toml new file mode 100644 index 00000000..ee1b4a94 --- /dev/null +++ b/pubnet/stellar-rpc/etc/stellar-rpc.toml @@ -0,0 +1,21 @@ +# The start script fills in the __X__ values. + +[storage] +default_data_dir = "/opt/stellar/stellar-rpc/data" + +[retention] +# Backfilling from genesis would take days, so keep history from the +# 10,000-ledger chunk holding the network tip at first start. +earliest_ledger = "now" + +[service] +endpoint = "localhost:8003" +admin_endpoint = "__STELLAR_RPC_ADMIN_ENDPOINT__" + +[ingestion] +# rpcv2 reads the network passphrase from the captive-core config. +captive_core_config = "/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" +captive_core_storage_path = "/opt/stellar/stellar-rpc/captive-core" +history_archive_urls = ["__ARCHIVE__"] +stellar_core_binary_path = "/usr/bin/stellar-core" +core_http_port = 11826 diff --git a/start b/start index 6a7cc80d..59f6f963 100755 --- a/start +++ b/start @@ -621,9 +621,8 @@ function init_stellar_rpc() { ADMIN_ENDPOINT= fi - perl -pi -e "s/__STELLAR_RPC_ADMIN_ENDPOINT__/$ADMIN_ENDPOINT/g" etc/stellar-rpc.cfg - perl -pi -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" etc/stellar-rpc.cfg - perl -pi -e "s=__ARCHIVE__=$HISTORY_ARCHIVE_URLS=g" etc/stellar-rpc.cfg + perl -pi -e "s/__STELLAR_RPC_ADMIN_ENDPOINT__/$ADMIN_ENDPOINT/g" etc/stellar-rpc.toml + perl -pi -e "s=__ARCHIVE__=$HISTORY_ARCHIVE_URLS=g" etc/stellar-rpc.toml run_silent "init-stellar-rpc" chown -R stellar:stellar . diff --git a/testnet/stellar-rpc/etc/stellar-rpc.cfg b/testnet/stellar-rpc/etc/stellar-rpc.cfg deleted file mode 100644 index 7ef9ea3d..00000000 --- a/testnet/stellar-rpc/etc/stellar-rpc.cfg +++ /dev/null @@ -1,13 +0,0 @@ -ENDPOINT="localhost:8003" -ADMIN_ENDPOINT="__STELLAR_RPC_ADMIN_ENDPOINT__" -FRIENDBOT_URL="https://friendbot.stellar.org/" -NETWORK_PASSPHRASE="__NETWORK__" -STELLAR_CORE_URL="http://localhost:11826" -CAPTIVE_CORE_CONFIG_PATH="/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" -CAPTIVE_CORE_STORAGE_PATH="/opt/stellar/stellar-rpc/captive-core" -CAPTIVE_CORE_USE_DB=true -STELLAR_CORE_BINARY_PATH="/usr/bin/stellar-core" -HISTORY_ARCHIVE_URLS="__ARCHIVE__" -DB_PATH="/opt/stellar/stellar-rpc/rpc_db.sqlite" -STELLAR_CAPTIVE_CORE_HTTP_PORT=11826 -CHECKPOINT_FREQUENCY=64 diff --git a/testnet/stellar-rpc/etc/stellar-rpc.toml b/testnet/stellar-rpc/etc/stellar-rpc.toml new file mode 100644 index 00000000..e415bbbb --- /dev/null +++ b/testnet/stellar-rpc/etc/stellar-rpc.toml @@ -0,0 +1,24 @@ +# The start script fills in the __X__ values. + +[storage] +default_data_dir = "/opt/stellar/stellar-rpc/data" + +[retention] +# Backfilling from genesis would take days, so keep history from the +# 10,000-ledger chunk holding the network tip at first start. +earliest_ledger = "now" + +[service] +endpoint = "localhost:8003" +admin_endpoint = "__STELLAR_RPC_ADMIN_ENDPOINT__" + +[service.methods.getNetwork] +friendbot_url = "https://friendbot.stellar.org/" + +[ingestion] +# rpcv2 reads the network passphrase from the captive-core config. +captive_core_config = "/opt/stellar/stellar-rpc/etc/stellar-captive-core.cfg" +captive_core_storage_path = "/opt/stellar/stellar-rpc/captive-core" +history_archive_urls = ["__ARCHIVE__"] +stellar_core_binary_path = "/usr/bin/stellar-core" +core_http_port = 11826 From eeae9e31df5017f149efcde92b3daff5d5bdc7a7 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Sat, 21 Nov 2026 20:44:14 +1000 Subject: [PATCH 2/2] bump build cache id to rebuild rpc with rpcv2 --- .github/workflows/internal-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/internal-build.yml b/.github/workflows/internal-build.yml index 1c76a94d..8ad47484 100644 --- a/.github/workflows/internal-build.yml +++ b/.github/workflows/internal-build.yml @@ -39,7 +39,7 @@ on: cache_id: description: "A value insert into cache keys to namespace cache usage, or invalidate it by incrementing" type: "string" - default: 19 + default: 20 cache_prefix: description: "A prefix added to all cache keys generated by this workflow" type: "string"