Skip to content

Commit

Permalink
opentimestamps: add help text.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Sep 26, 2023
1 parent 64a4ff2 commit 912f411
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ package opentimestamps
// https://opentimestamps.org/

import (
"embed"

"github.com/wader/fq/format"
"github.com/wader/fq/pkg/decode"
"github.com/wader/fq/pkg/interp"
"github.com/wader/fq/pkg/scalar"
"golang.org/x/exp/slices"
)

//go:embed opentimestamps.md
var otsFS embed.FS

func init() {
interp.RegisterFormat(
format.Opentimestamps,
Expand All @@ -18,6 +23,7 @@ func init() {
DecodeFn: decodeOTSFile,
Groups: []*decode.Group{format.Probe},
})
interp.RegisterFS(otsFS)
}

const (
Expand Down
24 changes: 24 additions & 0 deletions format/opentimestamps/opentimestamps.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 912f411

Please sign in to comment.