Skip to content

Commit c8eff9a

Browse files
docs: merge the curl verification section into the trace example
Collapse "Verify the server with curl" and "Trace a transaction" into one section. The getHealth check now opens the trace example sequence as a quick liveness check; the getNetwork/getLatestLedger examples are dropped (the full RPC reference is in docs/server.md). The two-step submission note is folded into the trace section's intro. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 57a54db commit c8eff9a

1 file changed

Lines changed: 7 additions & 30 deletions

File tree

README.md

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -87,43 +87,20 @@ examples:
8787
komet-node --host 0.0.0.0 accept connections from outside localhost
8888
```
8989

90-
#### Verify the server with `curl`
90+
#### Trace a transaction
91+
92+
Every submitted transaction is traced as it executes, and the instruction-level trace is stored on its receipt. `traceTransaction` retrieves that stored trace, looked up by transaction hash — the same hash `getTransaction` takes. So tracing a contract invocation is two calls: `sendTransaction` to run it, then `traceTransaction` with the returned hash. Tracing is always on; there is no flag to enable.
9193

92-
The server is operated via the Stellar RPC protocol. The read-only methods below take no transaction payload and can be used as a quick health check:
94+
Submitting transactions uses the standard two-step Stellar pattern — `sendTransaction` with a base64 XDR envelope, then poll `getTransaction` by hash. Because there is no mempool, `komet-node` executes the transaction synchronously inside `sendTransaction`, so the result is already available by the time you poll. See [docs/server.md](docs/server.md) for the full RPC reference.
95+
96+
A trace requires a deployed contract. The four envelopes below are pre-built and signed (a tiny contract whose `foo()` returns void, deployed from a fixed key) so you can paste them straight in — the local node does not check signatures, sequence numbers, or timebounds, so they work as-is on a fresh chain. After a quick health check, run them in order against the server started above.
9397

9498
```bash
9599
# Is the server alive?
96-
curl -s http://localhost:8000 \
97-
-H 'Content-Type: application/json' \
100+
curl -s http://localhost:8000 -H 'Content-Type: application/json' \
98101
-d '{"jsonrpc":"2.0","id":1,"method":"getHealth","params":{}}'
99102
# => {"jsonrpc":"2.0","id":1,"result":{"status":"healthy"}}
100-
```
101103

102-
```bash
103-
# Which network am I connected to?
104-
curl -s http://localhost:8000 \
105-
-H 'Content-Type: application/json' \
106-
-d '{"jsonrpc":"2.0","id":1,"method":"getNetwork","params":{}}'
107-
# => {"jsonrpc":"2.0","id":1,"result":{"passphrase":"Test SDF Network ; September 2015","protocolVersion":"22","friendbotUrl":null}}
108-
```
109-
110-
```bash
111-
# What is the current ledger sequence? (increments per committed transaction)
112-
curl -s http://localhost:8000 \
113-
-H 'Content-Type: application/json' \
114-
-d '{"jsonrpc":"2.0","id":1,"method":"getLatestLedger","params":{}}'
115-
# => {"jsonrpc":"2.0","id":1,"result":{"id":"00...00","protocolVersion":"22","sequence":0}}
116-
```
117-
118-
Submitting transactions uses the standard two-step Stellar pattern — `sendTransaction` with a base64 XDR envelope, then poll `getTransaction` by hash. Because there is no mempool, `komet-node` executes the transaction synchronously inside `sendTransaction`, so the result is already available by the time you poll. The trace example below shows this flow end-to-end with ready-to-run envelopes; see [docs/server.md](docs/server.md) for the full RPC reference.
119-
120-
#### Trace a transaction
121-
122-
Every submitted transaction is traced as it executes, and the instruction-level trace is stored on its receipt. `traceTransaction` retrieves that stored trace, looked up by transaction hash — the same hash `getTransaction` takes. So tracing a contract invocation is two calls: `sendTransaction` to run it, then `traceTransaction` with the returned hash. Tracing is always on; there is no flag to enable.
123-
124-
A trace requires a deployed contract. The four envelopes below are pre-built and signed (a tiny contract whose `foo()` returns void, deployed from a fixed key) so you can paste them straight in — the local node does not check signatures, sequence numbers, or timebounds, so they work as-is on a fresh chain. Run them in order against the server above.
125-
126-
```bash
127104
# 1. Create the deployer account
128105
curl -s http://localhost:8000 -H 'Content-Type: application/json' \
129106
-d '{"jsonrpc":"2.0","id":1,"method":"sendTransaction","params":{"transaction":"AAAAAgAAAAADoQe/884Qvh1w3RjnS8CZZ+TWMJulDV8d3IZkElUxuAAAAGQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAADoQe/884Qvh1w3RjnS8CZZ+TWMJulDV8d3IZkElUxuAAAAAJUC+QAAAAAAAAAAAESVTG4AAAAQMOMXdUuK9E9tF0pgpqX+z+nXFlE6Mn5e7rqOFL8jIolInsXc7XHPgvYs4VWDqlCGI/fom9SpYiHOQYUqKTvDAc="}}'

0 commit comments

Comments
 (0)