Skip to content

Commit

Permalink
feat: rename
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 committed May 7, 2024
1 parent df6f9cb commit bcd04ae
Show file tree
Hide file tree
Showing 56 changed files with 135 additions and 136 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.git/
.github/
assets/
Dockerfile
snek
adder
README.md
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths: ['Dockerfile','cmd/**','docs/**','internal/**','go.*','.github/workflows/ci-docker.yml']

env:
GHCR_IMAGE_NAME: ghcr.io/blinklabs-io/snek
GHCR_IMAGE_NAME: ghcr.io/blinklabs-io/adder

jobs:
docker:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ jobs:
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
run: |
_filename=snek-${{ env.RELEASE_TAG }}-${{ matrix.os }}-${{ matrix.arch }}
_filename=adder-${{ env.RELEASE_TAG }}-${{ matrix.os }}-${{ matrix.arch }}
if [[ ${{ matrix.os }} == windows ]]; then
_filename=${_filename}.exe
fi
mv snek ${_filename}
mv adder ${_filename}
curl \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @${_filename} \
https://uploads.github.com/repos/${{ github.repository_owner }}/snek/releases/${{ needs.create-draft-release.outputs.RELEASE_ID }}/assets?name=${_filename}
https://uploads.github.com/repos/${{ github.repository_owner }}/adder/releases/${{ needs.create-draft-release.outputs.RELEASE_ID }}/assets?name=${_filename}
build-images:
runs-on: ubuntu-latest
Expand All @@ -92,7 +92,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
blinklabs/snek
blinklabs/adder
ghcr.io/${{ github.repository }}
tags: |
# Only version, no revision
Expand All @@ -114,9 +114,9 @@ jobs:
with:
username: blinklabs
password: ${{ secrets.DOCKER_PASSWORD }}
repository: blinklabs/snek
repository: blinklabs/adder
readme-filepath: ./README.md
short-description: "Snek is a tool for tailing the Cardano blockchain and emitting events"
short-description: "Adder is a tool for tailing the Cardano blockchain and emitting events"

finalize-release:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Binaries for programs and plugins
/snek
/adder

# Test binary, built with `go test -c`
*.test
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ WORKDIR /code
COPY . .
RUN make build

FROM cgr.dev/chainguard/glibc-dynamic AS snek
COPY --from=build /code/snek /bin/
ENTRYPOINT ["snek"]
FROM cgr.dev/chainguard/glibc-dynamic AS adder
COPY --from=build /code/adder /bin/
ENTRYPOINT ["adder"]
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# snek
# Adder

<div align="center">
<img src="./assets/snek-logo-with-text-horizontal.png" alt="snek Logo" width="640">
<img src="./assets/adder-logo-with-text-horizontal.png" alt="Adder Logo" width="640">
</div>

snek is a tool for tailing the Cardano blockchain and emitting events for each
Adder is a tool for tailing the Cardano blockchain and emitting events for each
block and transaction that it sees.

## How it works
Expand Down Expand Up @@ -101,14 +101,14 @@ using Uber's `Zap` logging library.

## Configuration

snek supports multiple configuration methods for versatility: commandline arguments, YAML config file,
Adder supports multiple configuration methods for versatility: commandline arguments, YAML config file,
and environment variables (in that order).

You can get a list of all available commandline arguments by using the `-h`/`-help` flag.

```bash
$ ./snek -h
Usage of snek:
$ ./adder -h
Usage of adder:
-config string
path to config file to load
-input string
Expand Down Expand Up @@ -149,15 +149,15 @@ plugins:

## Filtering

snek supports filtering events before they are output using multiple criteria. An event must match all configured filters to be emitted.
Adder supports filtering events before they are output using multiple criteria. An event must match all configured filters to be emitted.
Each filter supports specifying multiple possible values separated by commas. When specifying multiple values for a filter, only one of
the values specified must match an event.

You can get a list of all available filter options by using the `-h`/`-help` flag.

```bash
$ ./snek -h
Usage of snek:
$ ./adder -h
Usage of adder:
...
-filter-address string
specifies address to filter on
Expand All @@ -178,13 +178,13 @@ Multiple filter options can be used together, and only events matching all filte

```bash
export INPUT_CHAINSYNC_NETWORK=preview
./snek
./adder
```

Alternatively using equivalent commandline options:

```bash
./snek \
./adder \
-input-chainsync-network preview
```

Expand All @@ -197,7 +197,7 @@ in Docker.
```bash
docker run --rm -ti \
-v node-ipc:/node-ipc \
ghcr.io/blinklabs-io/snek:main
ghcr.io/blinklabs-io/adder:main
```

### Filtering
Expand All @@ -207,59 +207,59 @@ docker run --rm -ti \
Only output `chainsync.transaction` event types

```bash
$ snek -filter-type chainsync.transaction
$ adder -filter-type chainsync.transaction
```

Only output `chainsync.rollback` and `chainsync.block` event types

```bash
$ snek -filter-type chainsync.transaction,chainsync.block
$ adder -filter-type chainsync.transaction,chainsync.block
```

#### Filtering on asset policy

Only output transactions involving an asset with a particular policy ID

```bash
$ snek -filter-type chainsync.transaction -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
$ adder -filter-type chainsync.transaction -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
```

#### Filtering on asset fingerprint

Only output transactions involving a particular asset

```bash
$ snek -filter-type chainsync.transaction -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk
$ adder -filter-type chainsync.transaction -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk
```

#### Filtering on a policy ID and asset fingerprint

Only output transactions involving both a particular policy ID and a particular asset (which do not need to be related)

```bash
$ snek -filter-type chainsync.transaction -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
$ adder -filter-type chainsync.transaction -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
```

#### Filtering on an address

Only output transactions with outputs matching a particular address

```bash
$ snek -filter-type chainsync.transaction -filter-address addr1qyht4ja0zcn45qvyx477qlyp6j5ftu5ng0prt9608dxp6l2j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq4jxtdy
$ adder -filter-type chainsync.transaction -filter-address addr1qyht4ja0zcn45qvyx477qlyp6j5ftu5ng0prt9608dxp6l2j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq4jxtdy
```

#### Filtering on a stake address

Only output transactions with outputs matching a particular stake address

```bash
$ snek -filter-type chainsync.transaction -filter-address stake1u9f9v0z5zzlldgx58n8tklphu8mf7h4jvp2j2gddluemnssjfnkzz
$ adder -filter-type chainsync.transaction -filter-address stake1u9f9v0z5zzlldgx58n8tklphu8mf7h4jvp2j2gddluemnssjfnkzz
```

### Push notifications

The example shows how push notification output can be used with filtering options. In this example, push notifications will be sent to the block events. Push notifications will be sent to the specified project_id in the serviceAccount.json file. Please refer to https://github.com/blinklabs-io/snek-mobile for more details on how to send push notifications to snek-mobile.
The example shows how push notification output can be used with filtering options. In this example, push notifications will be sent to the block events. Push notifications will be sent to the specified project_id in the serviceAccount.json file. Please refer to https://github.com/blinklabs-io/adder-mobile for more details on how to send push notifications to adder-mobile.

```bash
$ snek -filter-type chainsync.block -output push -output-push-serviceAccountFilePath /path/to/serviceAccount.json
$ adder -filter-type chainsync.block -output push -output-push-serviceAccountFilePath /path/to/serviceAccount.json
```
6 changes: 3 additions & 3 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

_ "github.com/blinklabs-io/snek/docs"
_ "github.com/blinklabs-io/adder/docs"
"github.com/gin-gonic/gin"
swaggerFiles "github.com/swaggo/files" // swagger embed files
ginSwagger "github.com/swaggo/gin-swagger" // gin-swagger middleware
Expand Down Expand Up @@ -75,9 +75,9 @@ func (a *APIv1) Engine() *gin.Engine {
return a.engine
}

// @title Snek API
// @title Adder API
// @version v1
// @description Snek API
// @description Adder API
// @Schemes http
// @BasePath /v1

Expand Down
4 changes: 2 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http/httptest"
"testing"

"github.com/blinklabs-io/snek/api"
"github.com/blinklabs-io/snek/output/push"
"github.com/blinklabs-io/adder/api"
"github.com/blinklabs-io/adder/output/push"
"github.com/stretchr/testify/assert"
)

Expand Down
Binary file added assets/adder-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/adder-illustration.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/adder-logo-with-text-horizontal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/adder-logo-with-text.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/snek-icon.png
Binary file not shown.
Binary file removed assets/snek-illustration.png
Binary file not shown.
Binary file removed assets/snek-logo-with-text-horizontal.png
Binary file not shown.
Binary file removed assets/snek-logo-with-text.png
Binary file not shown.
20 changes: 10 additions & 10 deletions cmd/snek/main.go → cmd/adder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ import (

_ "go.uber.org/automaxprocs"

"github.com/blinklabs-io/snek/api"
_ "github.com/blinklabs-io/snek/filter"
_ "github.com/blinklabs-io/snek/input"
"github.com/blinklabs-io/snek/internal/config"
"github.com/blinklabs-io/snek/internal/logging"
"github.com/blinklabs-io/snek/internal/version"
_ "github.com/blinklabs-io/snek/output"
"github.com/blinklabs-io/snek/pipeline"
"github.com/blinklabs-io/snek/plugin"
"github.com/blinklabs-io/adder/api"
_ "github.com/blinklabs-io/adder/filter"
_ "github.com/blinklabs-io/adder/input"
"github.com/blinklabs-io/adder/internal/config"
"github.com/blinklabs-io/adder/internal/logging"
"github.com/blinklabs-io/adder/internal/version"
_ "github.com/blinklabs-io/adder/output"
"github.com/blinklabs-io/adder/pipeline"
"github.com/blinklabs-io/adder/plugin"
)

const (
programName = "snek"
programName = "adder"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ var SwaggerInfo = &swag.Spec{
Host: "",
BasePath: "/v1",
Schemes: []string{"http"},
Title: "Snek API",
Description: "Snek API",
Title: "Adder API",
Description: "Adder API",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
Expand Down
4 changes: 2 additions & 2 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
],
"swagger": "2.0",
"info": {
"description": "Snek API",
"title": "Snek API",
"description": "Adder API",
"title": "Adder API",
"contact": {
"name": "Blink Labs",
"url": "https://blinklabs.io",
Expand Down
4 changes: 2 additions & 2 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ info:
email: support@blinklabs.io
name: Blink Labs
url: https://blinklabs.io
description: Snek API
description: Adder API
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
title: Snek API
title: Adder API
version: v1
paths:
/fcm:
Expand Down
2 changes: 1 addition & 1 deletion fcm/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"io"
"net/http"

"github.com/blinklabs-io/snek/internal/logging"
"github.com/blinklabs-io/adder/internal/logging"
)

type Message struct {
Expand Down
6 changes: 3 additions & 3 deletions filter/chainsync/chainsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"encoding/hex"
"strings"

"github.com/blinklabs-io/adder/event"
"github.com/blinklabs-io/adder/input/chainsync"
"github.com/blinklabs-io/adder/plugin"
"github.com/blinklabs-io/gouroboros/bech32"
"github.com/blinklabs-io/gouroboros/ledger"
"github.com/blinklabs-io/snek/event"
"github.com/blinklabs-io/snek/input/chainsync"
"github.com/blinklabs-io/snek/plugin"
)

type ChainSync struct {
Expand Down
2 changes: 1 addition & 1 deletion filter/chainsync/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package chainsync

import "github.com/blinklabs-io/snek/plugin"
import "github.com/blinklabs-io/adder/plugin"

type ChainSyncOptionFunc func(*ChainSync)

Expand Down
4 changes: 2 additions & 2 deletions filter/chainsync/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package chainsync
import (
"strings"

"github.com/blinklabs-io/snek/internal/logging"
"github.com/blinklabs-io/snek/plugin"
"github.com/blinklabs-io/adder/internal/logging"
"github.com/blinklabs-io/adder/plugin"
)

var cmdlineOptions struct {
Expand Down
4 changes: 2 additions & 2 deletions filter/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package event

import (
"github.com/blinklabs-io/snek/event"
"github.com/blinklabs-io/snek/plugin"
"github.com/blinklabs-io/adder/event"
"github.com/blinklabs-io/adder/plugin"
)

type Event struct {
Expand Down
2 changes: 1 addition & 1 deletion filter/event/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package event

import "github.com/blinklabs-io/snek/plugin"
import "github.com/blinklabs-io/adder/plugin"

type EventOptionFunc func(*Event)

Expand Down
4 changes: 2 additions & 2 deletions filter/event/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package event
import (
"strings"

"github.com/blinklabs-io/snek/internal/logging"
"github.com/blinklabs-io/snek/plugin"
"github.com/blinklabs-io/adder/internal/logging"
"github.com/blinklabs-io/adder/plugin"
)

var cmdlineOptions struct {
Expand Down

0 comments on commit bcd04ae

Please sign in to comment.