Skip to content

Commit 8dc55bd

Browse files
Merge branch 'main' into galexie
2 parents c54a5a6 + d08c68f commit 8dc55bd

File tree

7 files changed

+84
-16
lines changed

7 files changed

+84
-16
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ HTTP APIs and Tools are available at the following port and paths:
5858
- Lab: `http://localhost:8000/lab`
5959
- Friendbot: `http://localhost:8000/friendbot`
6060
- Ledger Meta: `http://localhost:8000/ledger-meta` (available with `--local` and `--enable galexie`)
61+
- History Archive: `http://localhost:8000/archive` (available with `--local` only)
6162
6263
## Tags
6364
@@ -166,6 +167,45 @@ To enable [Stellar Lab](https://github.com/stellar/laboratory) which will use th
166167
167168
**Note: In `--local` mode the `core` service always runs no matter what options are passed, the `friendbot` faucet service runs whenever `horizon` is running, and `horizon` is run when `rpc` is requested so that friendbot is available.**
168169
170+
### Core Options
171+
172+
#### `--core-log-level`
173+
174+
Set Stellar Core's log level at startup. Valid values are (case-sensitive):
175+
176+
| Level | Description |
177+
| ----- | ----------- |
178+
| FATAL | Only log fatal errors |
179+
| ERROR | Log errors and above |
180+
| WARNING | Log warnings and above |
181+
| INFO | Log info and above |
182+
| DEBUG | Log debug and above (default for `--local`) |
183+
| TRACE | Log everything (very verbose) |
184+
185+
Example:
186+
187+
```shell
188+
docker run -p "8000:8000" stellar/quickstart --local --core-log-level DEBUG
189+
```
190+
191+
For more granular control over specific subsystems, you can use Stellar Core's HTTP command interface on port 11626. First, expose the port:
192+
193+
```shell
194+
docker run -p "8000:8000" -p "11626:11626" stellar/quickstart --local
195+
```
196+
197+
Then adjust log levels per partition:
198+
199+
```shell
200+
# Set History partition to TRACE level
201+
curl "http://localhost:11626/ll?level=TRACE&partition=History"
202+
203+
# Set SCP partition to DEBUG level
204+
curl "http://localhost:11626/ll?level=DEBUG&partition=SCP"
205+
```
206+
207+
Available partitions: `Fs`, `SCP`, `Bucket`, `Database`, `History`, `Process`, `Ledger`, `Overlay`, `Herder`, `Tx`, `LoadGen`, `Work`, `Invariant`, `Perf`
208+
169209
### Stellar Lab
170210

171211
Stellar Lab is an interactive toolkit for exploring and interacting with the Stellar network. It allows developers to build, sign, simulate, and submit transactions, and to make requests to both the Friendbot, RPC, and Horizon APIs. Lab is also built-in to Quickstart.
@@ -230,6 +270,7 @@ The action supports several configuration options. None are required and default
230270
network: "local" # Network: local, testnet, futurenet (default: "local")
231271
enable: "core,horizon,rpc" # Services to enable (default: "core,horizon,rpc")
232272
protocol_version: "" # Protocol version to run for 'local' network only (leave blank for default for image)"
273+
core_log_level: "" # Core log level: FATAL, ERROR, WARNING, INFO, DEBUG, TRACE (default: "")
233274
enable_logs: "true" # Enable container logs (default: "true")
234275
health_interval: "10" # Time between health checks in seconds (default: "10")
235276
health_timeout: "5" # Maximum time for each health check in seconds (default: "5")

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
protocol_version:
2121
description: "Protocol version to run for 'local' network only (leave blank for default for image)"
2222
default: ""
23+
core_log_level:
24+
description: "Stellar Core log level (FATAL, ERROR, WARNING, INFO, DEBUG, TRACE)"
25+
default: ""
2326
enable_logs:
2427
description: "Boolean flag enabling the logs"
2528
default: "true"
@@ -87,8 +90,9 @@ runs:
8790
-p 11826:11826
8891
-e ENABLE_LOGS="${{ inputs.enable_logs }}"
8992
-e ENABLE="${{ inputs.enable }}"
90-
-e NETWORK="${{ inputs.network }}"
91-
-e PROTOCOL_VERSION="${{ inputs.protocol_version }}"
93+
-e NETWORK="${{ inputs.network }}"
94+
-e PROTOCOL_VERSION="${{ inputs.protocol_version }}"
95+
-e CORE_LOG_LEVEL="${{ inputs.core_log_level }}"
9296
--health-cmd "curl --no-progress-meter -X POST -H 'Content-Type: application/json' -d
9397
'{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"getHealth\"}' 'http://localhost:8000/rpc'
9498
| grep 'healthy'

common/core/bin/start

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ while ! psql -U stellar -c 'select 1' core &> /dev/null ; do
55
sleep 1
66
done
77

8+
# Source environment file if it exists
9+
if [ -f /opt/stellar/core/etc/env ]; then
10+
source /opt/stellar/core/etc/env
11+
fi
12+
813
echo "starting core..."
914
set -e
10-
exec /usr/bin/stellar-core --conf "/opt/stellar/core/etc/stellar-core.cfg" run
15+
exec /usr/bin/stellar-core --conf "/opt/stellar/core/etc/stellar-core.cfg" run ${CORE_LOG_LEVEL:+--ll "$CORE_LOG_LEVEL"}

images.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
},
3030
{
3131
"name": "horizon",
32-
"repo": "stellar/go",
33-
"ref": "horizon-v24.0.0",
32+
"repo": "stellar/stellar-horizon",
33+
"ref": "v25.0.0",
3434
"options": {
35-
"pkg": "github.com/stellar/go/services/horizon"
35+
"pkg": "github.com/stellar/stellar-horizon"
3636
}
3737
},
3838
{
@@ -72,7 +72,7 @@
7272
"push"
7373
],
7474
"config": {
75-
"protocol_version_default": 24
75+
"protocol_version_default": 25
7676
},
7777
"deps": [
7878
{
@@ -95,10 +95,10 @@
9595
},
9696
{
9797
"name": "horizon",
98-
"repo": "stellar/go",
99-
"ref": "horizon-v24.0.0",
98+
"repo": "stellar/stellar-horizon",
99+
"ref": "v25.0.0",
100100
"options": {
101-
"pkg": "github.com/stellar/go/services/horizon"
101+
"pkg": "github.com/stellar/stellar-horizon"
102102
}
103103
},
104104
{

local/core/etc/stellar-core.cfg

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ NODE_IS_VALIDATOR=true
1515
#DATABASE="sqlite3://stellar.db"
1616
DATABASE="postgresql://dbname=core host=localhost user=stellar password=__PGPASS__"
1717

18-
COMMANDS=["ll?level=debug"]
19-
2018
FAILURE_SAFETY=0
2119
UNSAFE_QUORUM=true
2220
#The public keys of the Stellar testnet servers
@@ -25,6 +23,6 @@ THRESHOLD_PERCENT=100
2523
VALIDATORS=["$self"]
2624

2725
[HISTORY.vs]
28-
get="cp /tmp/stellar-core/history/vs/{0} {1}"
29-
put="cp {0} /tmp/stellar-core/history/vs/{1}"
30-
mkdir="mkdir -p /tmp/stellar-core/history/vs/{0}"
26+
get="cp /opt/stellar/history-archive/data/{0} {1}"
27+
put="cp {0} /opt/stellar/history-archive/data/{1}"
28+
mkdir="mkdir -p /opt/stellar/history-archive/data/{0}"

local/supervisor/etc/supervisord.conf.d/history-archive.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[program:history-archive]
22
user=stellar
3-
directory=/tmp/stellar-core/history/vs
3+
directory=/opt/stellar/history-archive/data
44
command=/usr/bin/python3 -m http.server 1570
55
autostart=true
66
autorestart=true

start

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export NXHOME="$STELLAR_HOME/nginx"
1818
export STELLAR_RPC_HOME="$STELLAR_HOME/stellar-rpc"
1919
export GALEXIEHOME="$STELLAR_HOME/galexie"
2020
export LEDGERMETASTOREHOME="$STELLAR_HOME/ledger-meta-store"
21+
export HISTORYARCHIVEHOME="$STELLAR_HOME/history-archive"
2122

2223
export CORELOG="/var/log/stellar-core"
2324

@@ -44,6 +45,7 @@ export PROTOCOL_VERSION_DEFAULT="$(< /image.json jq -r '.config.protocol_version
4445
: "${ENABLE_SOROBAN_RPC_ADMIN_ENDPOINT:=false}"
4546
: "${ENABLE_RPC_ADMIN_ENDPOINT:=$ENABLE_SOROBAN_RPC_ADMIN_ENDPOINT}"
4647
: "${ENABLE_CORE_MANUAL_CLOSE:=false}"
48+
: "${CORE_LOG_LEVEL:=}"
4749
: "${LIMITS:=testnet}"
4850

4951
QUICKSTART_INITIALIZED=false
@@ -202,6 +204,10 @@ function process_args() {
202204
--randomize-network-passphrase)
203205
RANDOMIZE_NETWORK_PASSPHRASE=true
204206
;;
207+
--core-log-level)
208+
CORE_LOG_LEVEL="$1"
209+
shift
210+
;;
205211
*)
206212
echo "Unknown container arg $ARG" >&2
207213
exit 1
@@ -482,6 +488,18 @@ function init_stellar_core() {
482488

483489
pushd $COREHOME
484490
run_silent "chown-core" chown -R stellar:stellar .
491+
492+
# Write core environment file for runtime configuration.
493+
# This runs on every startup to support changing settings on restart.
494+
# Default to "debug" for local network to maintain backward compatibility.
495+
local core_log_level="$CORE_LOG_LEVEL"
496+
if [ -z "$core_log_level" ] && [ "$NETWORK" = "local" ]; then
497+
core_log_level="debug"
498+
fi
499+
cat > $COREHOME/etc/env <<EOF
500+
CORE_LOG_LEVEL="$core_log_level"
501+
EOF
502+
485503
if [ -f $COREHOME/.quickstart-initialized ]; then
486504
echo "core: already initialized"
487505

@@ -507,6 +525,8 @@ function init_stellar_core() {
507525
if [ "$NETWORK" = "local" ]; then
508526
run_silent "init-core-scp" sudo -u stellar stellar-core force-scp --conf etc/stellar-core.cfg
509527

528+
run_silent "mkdir-history-archive" mkdir -p $HISTORYARCHIVEHOME/data
529+
run_silent "chown-history-archive" chown -R stellar:stellar $HISTORYARCHIVEHOME
510530
run_silent "init-history" sudo -u stellar stellar-core new-hist vs --conf $COREHOME/etc/stellar-core.cfg
511531
fi
512532

0 commit comments

Comments
 (0)