1
1
mirror of https://github.com/wader/fq.git synced 2024-12-25 22:34:14 +03:00

opentimestamps: add help text.

This commit is contained in:
fiatjaf 2023-09-26 15:21:12 -03:00
parent 64a4ff2e7a
commit 912f4116a9
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
2 changed files with 30 additions and 0 deletions

View File

@ -3,6 +3,8 @@ package opentimestamps
// https://opentimestamps.org/
import (
"embed"
"github.com/wader/fq/format"
"github.com/wader/fq/pkg/decode"
"github.com/wader/fq/pkg/interp"
@ -10,6 +12,9 @@ import (
"golang.org/x/exp/slices"
)
//go:embed opentimestamps.md
var otsFS embed.FS
func init() {
interp.RegisterFormat(
format.Opentimestamps,
@ -18,6 +23,7 @@ func init() {
DecodeFn: decodeOTSFile,
Groups: []*decode.Group{format.Probe},
})
interp.RegisterFS(otsFS)
}
const (

View File

@ -0,0 +1,24 @@
### View a full OpenTimestamps file
```
$ fq dd file.ots
```
### List the names of the Calendar servers used
```
$ fq '.operations | map(select(.attestation_type == "calendar") | .url)' file.ots
```
### Check if there are Bitcoin attestations present
```
$ fq '.operations | map(select(.attestation_type == "bitcoin")) | length > 0' file.ots
```
### Authors
- fiatjaf, https://fiatjaf.com
### References
- https://opentimestamps.org/
- https://github.com/opentimestamps/python-opentimestamps