-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9d795d
commit edddbaf
Showing
7 changed files
with
250 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
pbacme "github.com/streamingfast/firehose-acme/pb/sf/acme/type/v1" | ||
Check failure on line 4 in cmd/fireacme/main.go GitHub Actions / Test (1.21.x, ubuntu-latest)
|
||
firecore "github.com/streamingfast/firehose-core" | ||
fhCmd "github.com/streamingfast/firehose-core/cmd" | ||
) | ||
|
||
func main() { | ||
fhCmd.Main(&firecore.Chain[*pbacme.Tipset]{ | ||
ShortName: "acme", | ||
LongName: "Acme", | ||
ExecutableName: "forest", | ||
FullyQualifiedModule: "github.com/streamingfast/firehose-acme", | ||
Version: version, | ||
|
||
FirstStreamableBlock: 1, | ||
|
||
BlockFactory: func() firecore.Block { return new(pbacme.Tipset) }, | ||
ConsoleReaderFactory: firecore.NewConsoleReader, | ||
|
||
Tools: &firecore.ToolsConfig[*pbacme.Tipset]{}, | ||
}) | ||
} | ||
|
||
// Version value, injected via go build `ldflags` at build time, **must** not be removed or inlined | ||
var version = "dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
clean= | ||
firefil="$ROOT/../firefil" | ||
fireacme="$ROOT/../fireacme" | ||
|
||
main() { | ||
pushd "$ROOT" &> /dev/null | ||
|
@@ -33,7 +33,8 @@ main() { | |
# usage_error "The 'dummy-blockchain' executable must be found within your PATH, install it from source of 'https://github.com/streamingfast/dummy-blockchain'" | ||
# fi | ||
|
||
exec go run github.com/streamingfast/[email protected] start --tracer=firehose --block-rate=60 --store-dir "$chain_data" | $firefil -c $(basename $ROOT).yaml start "$@" | ||
# exec go run github.com/streamingfast/[email protected] start --tracer=firehose --block-rate=60 --store-dir "$chain_data" | $fireacme -c $(basename $ROOT).yaml start "$@" | ||
forest --chain calibnet --encrypt-keystore=false | $fireacme -c $(basename $ROOT).yaml start "$@" | ||
} | ||
|
||
usage_error() { | ||
|
@@ -55,4 +56,4 @@ usage() { | |
echo " -c Clean actual data directory first" | ||
} | ||
|
||
main "$@" | ||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package pbacme | ||
|
||
import ( | ||
"time" | ||
|
||
firecore "github.com/streamingfast/firehose-core" | ||
) | ||
|
||
var _ firecore.Block = (*Tipset)(nil) | ||
|
||
func (b *Tipset) GetFirehoseBlockID() string { | ||
return "blah" | ||
} | ||
|
||
func (b *Tipset) GetFirehoseBlockNumber() uint64 { | ||
return b.Height | ||
} | ||
|
||
func (b *Tipset) GetFirehoseBlockParentID() string { | ||
return "" | ||
} | ||
|
||
func (b *Tipset) GetFirehoseBlockParentNumber() uint64 { | ||
return *&b.Height - 1 | ||
} | ||
|
||
func (b *Tipset) GetFirehoseBlockTime() time.Time { | ||
return time.Unix(0, int64(b.Timestamp)).UTC() | ||
} | ||
|
||
func (b *Tipset) GetFirehoseBlockLIBNum() uint64 { | ||
return b.Height | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
package sf.acme.type.v1; | ||
|
||
option go_package = "github.com/streamingfast/firehose-acme/pb/sf/acme/type/v1;pbacme"; | ||
|
||
message Tipset { | ||
uint64 height = 1; | ||
uint64 block_count = 2; | ||
uint64 timestamp = 3; | ||
} |