Skip to content

Commit

Permalink
add Huobi ECO (heco) endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Duchesneau committed Mar 10, 2021
1 parent be1e221 commit 98fd810
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ project adheres to
[MAINTAINERS.md](./MAINTAINERS.md) for instructions to keep up to
date.

# Unreleased
# v0.0.4

Added --heco endpoint

# v0.0.3

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ $ sf --handle-forks --start-cursor "10928019832019283019283" "to in ['0x7a250d56
$ sf --bsc "true" 100000 100002

# Look at ALL blocks in a given range on Polygon Chain
$ sf --polygon "true" 100000 100002
$ sf --polygon "true" 100000 100002

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

## Programmatic access
Expand Down
13 changes: 11 additions & 2 deletions cmd/sf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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 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 @@ -50,7 +51,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), errorUsage("Cannot set more than one network flag (ex: --polygon, --bsc)"))
ensure(noMoreThanOneTrue(*flagBSC, *flagPolygon, *flagHECO), errorUsage("Cannot set more than one network flag (ex: --polygon, --bsc)"))

filter := args[0]
cursor := *flagStartCursor
Expand All @@ -73,6 +74,8 @@ func main() {
endpoint = "bsc.streamingfast.io:443"
case *flagPolygon:
endpoint = "polygon.streamingfast.io:443"
case *flagHECO:
endpoint = "heco.streamingfast.io:443"
default:
if e := os.Getenv("STREAMINGFAST_ENDPOINT"); e != "" {
endpoint = e
Expand Down Expand Up @@ -315,7 +318,13 @@ Examples:
$ sf --handle-forks --start-cursor "10928019832019283019283" "to in ['0x7a250d5630b4cf539739df2c5dacb4c659f2488d']"
# Look at ALL blocks in a given range on Binance Smart Chain (BSC)
$ sf --bsc "true" 100000 100002
$ sf --bsc "true" 100000 100002
# Look at ALL blocks in a given range on Polygon Chain
$ sf --polygon "true" 100000 100002
# Look at ALL blocks in a given range on Huobi ECO Chain
$ sf --heco "true" 100000 100002
`
}

Expand Down

0 comments on commit 98fd810

Please sign in to comment.