Skip to content

Commit

Permalink
add --fantom for opera mainnet flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Duchesneau committed Mar 19, 2021
1 parent 499f5a8 commit d9be54c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ project adheres to
[MAINTAINERS.md](./MAINTAINERS.md) for instructions to keep up to
date.

# v0.0.6

Added --fantom endpoint

# v0.0.5

Added OSX package signature

# v0.0.4

Added --heco endpoint
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ $ sf --polygon "true" 100000 100002

# Look at ALL blocks in a given range on Huobi ECO Chain
$ sf --heco "true" 100000 100002

# Look at recent blocks and stream forever on Fantom Opera Mainnet
$ sf --fantom "true" -5
```

## Programmatic access
Expand Down
8 changes: 7 additions & 1 deletion cmd/sf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var flagEndpoint = flag.String("e", "api.streamingfast.io:443", "The endpoint to
var flagBSC = flag.Bool("bsc", false, "When set, will force the endpoint to Binance Smart Chain")
var flagPolygon = flag.Bool("polygon", false, "When set, will force the endpoint to Polygon (previously Matic)")
var flagHECO = flag.Bool("heco", false, "When set, will force the endpoint to Huobi Eco Chain")
var flagFantom = flag.Bool("fantom", false, "When set, will force the endpoint to Fantom Opera Mainnet")

var flagHandleForks = flag.Bool("handle-forks", false, "Request notifications type STEP_UNDO when a block was forked out, and STEP_IRREVERSIBLE after a block has seen enough confirmations (200)")
var flagSkipVerify = flag.Bool("s", false, "When set, skips certification verification")
Expand All @@ -51,7 +52,7 @@ func main() {

args := flag.Args()
ensure((len(args) == 1 && *flagStartCursor != "") || len(args) > 1, errorUsage("Expecting between 1 and 3 arguments"))
ensure(noMoreThanOneTrue(*flagBSC, *flagPolygon, *flagHECO), errorUsage("Cannot set more than one network flag (ex: --polygon, --bsc)"))
ensure(noMoreThanOneTrue(*flagBSC, *flagPolygon, *flagHECO, *flagFantom), errorUsage("Cannot set more than one network flag (ex: --polygon, --bsc)"))

filter := args[0]
cursor := *flagStartCursor
Expand All @@ -76,6 +77,8 @@ func main() {
endpoint = "polygon.streamingfast.io:443"
case *flagHECO:
endpoint = "heco.streamingfast.io:443"
case *flagFantom:
endpoint = "fantom.streamingfast.io:443"
default:
if e := os.Getenv("STREAMINGFAST_ENDPOINT"); e != "" {
endpoint = e
Expand Down Expand Up @@ -325,6 +328,9 @@ Examples:
# Look at ALL blocks in a given range on Huobi ECO Chain
$ sf --heco "true" 100000 100002
# Look at recent blocks and stream forever on Fantom Opera Mainnet
$ sf --fantom "true" -5
`
}

Expand Down

0 comments on commit d9be54c

Please sign in to comment.