Local DA implements the go-da interface over a Local Data Availability service.
It is intended to be used for testing DA layers without having to set up the actual services.
To build and run the local-da binary:
make build
./build/local-da
should output
2024/04/11 12:23:34 Listening on: localhost:7980
Which exposes the go-da interface over JSONRPC and can be accessed with an HTTP client like xh:
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.
$ ./build/local-da -listen-all
2024/04/11 12:23:34 Listening on: 0.0.0.0:7980
You can also run the local-da service using docker:
make docker-build
docker run --rm -p 7980:7980 local-da
xh http://127.0.0.1:7980 id=1 method=da.MaxBlobSize | jq
output:
{
"jsonrpc": "2.0",
"result": 1974272,
"id": "1"
}
xh http://127.0.0.1:7980 id=1 method=da.Submit 'params[][]=SGVsbG8gd28ybGQh' 'params[]:=-2' 'params[]=AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA=' | jq
output:
{
"jsonrpc": "2.0",
"result": [
"AQAAAAAAAADfgz5/IP20UeF81iRRzDBu/qC8eXr9DUyplrfXod3VOA=="
],
"id": "1"
}
xh http://127.0.0.1:7980 id=1 method=da.Get 'params[][]=AQAAAAAAAADfgz5/IP20UeF81iRRzDBu/qC8eXr9DUyplrfXod3VOA==' 'params[]=AAAAAAAAAAAAAAAAAAAAAAAAAAECAwQFBgcICRA='
output:
{
"jsonrpc": "2.0",
"result": [
"SGVsbG8gd28ybGQh"
],
"id": "1"
}
[1] go-da
[2] xh