11# Local DA
22
3- Local DA implements the [ go- da] [ go- da] interface over a Local Data Availability service.
3+ Local DA implements the [ da] [ da ] interface over a Local Data Availability service.
44
55It is intended to be used for testing DA layers without having to set up the actual services.
66
@@ -15,28 +15,41 @@ make build
1515./build/local-da
1616```
1717
18- should output
18+ This will start the Local DA service with default settings, listening on ` localhost:7980 ` and with a default maximum blob size.
19+
20+ The output should look similar to this (the timestamp and maxBlobSize might vary):
1921
2022``` sh
21- 2024/04/11 12:23:34 Listening on: localhost:7980
23+ 11:07AM INF NewLocalDA: initialized LocalDA module=local-da
24+ 11:07AM INF Listening on host=localhost maxBlobSize=1974272 module=da port=7980
25+ 11:07AM INF server started listening on=localhost:7980 module=da
2226```
2327
24- Which exposes the [ go-da] interface over JSONRPC and can be accessed with an HTTP client like [ xh] [ xh ] :
28+ Which exposes the [ da] interface over JSONRPC and can be accessed with an HTTP client like [ xh] [ xh ] :
29+
30+ #### Flags
31+
32+ You can customize the behavior of the ` local-da ` binary using the following flags:
2533
26- You can also run local-da with a ` -listen-all ` flag which will make the process listen on 0.0.0.0 so that it can be accessed from other machines.
34+ * ` -port <port> ` : Specifies the listening port. Default: ` 7980 ` .
35+ * ` -host <host> ` : Specifies the listening address. Default: ` localhost ` .
36+ * ` -listen-all ` : If set, the service listens on all network interfaces (` 0.0.0.0 ` ) instead of just ` localhost ` . This allows access from other machines.
37+ * ` -max-blob-size <bytes> ` : Sets the maximum blob size in bytes that the DA service will accept. Default: ` 1974272 ` (which is ` 64 * 64 * 482 ` ).
38+
39+ ** Example with flags:**
40+
41+ To run ` local-da ` on port ` 8000 ` , accessible from any IP, with a max blob size of ` 1000000 ` bytes:
2742
2843``` sh
29- $ ./build/local-da -listen-all
30- 2024/04/11 12:23:34 Listening on: 0.0.0.0:7980
44+ ./build/local-da -port 8000 -listen-all -max-blob-size 1000000
3145```
3246
33- ### Docker
34-
35- You can also run the local-da service using docker:
47+ Output:
3648
3749``` sh
38- make docker-build
39- docker run --rm -p 7980:7980 local-da
50+ 11:07AM INF NewLocalDA: initialized LocalDA module=local-da
51+ 11:07AM INF Listening on host=0.0.0.0 maxBlobSize=1974272 module=da port=8000
52+ 11:07AM INF server started listening on=0.0.0.0:8000 module=da
4053```
4154
4255### MaxBlobSize
@@ -93,9 +106,9 @@ output:
93106
94107## References
95108
96- [ 1] [ go- da] [ go- da]
109+ [ 1] [ da] [ da]
97110
98111[ 2] [ xh] [ xh ]
99112
100- [ go- da] : https://github.com/rollkit/go-da
113+ [ da ] : https://github.com/rollkit/rollkit/blob/main/core/da/da.go#L11
101114[ xh ] : https://github.com/ducaale/xh
0 commit comments