Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy over current changes #5

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/firefil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import (
)

func main() {
fhCmd.Main(&firecore.Chain[*pbfilecoin.Block]{
fhCmd.Main(&firecore.Chain[*pbfilecoin.Tipset]{
ShortName: "filecoin",
LongName: "Filecoin",
ExecutableName: "dummy-blockchain",
FullyQualifiedModule: "github.com/chainsafe/firehose-filecoin",
ExecutableName: "forest",
FullyQualifiedModule: "github.com/chainsafe/firehose-filecoin",
Version: version,

FirstStreamableBlock: 1,

BlockFactory: func() firecore.Block { return new(pbfilecoin.Block) },
BlockFactory: func() firecore.Block { return new(pbfilecoin.Tipset) },
ConsoleReaderFactory: firecore.NewConsoleReader,

Tools: &firecore.ToolsConfig[*pbfilecoin.Block]{},
Tools: &firecore.ToolsConfig[*pbfilecoin.Tipset]{},
})
}

Expand Down
8 changes: 3 additions & 5 deletions devel/standard/standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ start:
# Specifies the path to the binary, we assume you did
# `go install github.com/streamingfast/dummy-blockchain@latest` (and that you have value
# of `go env GOPATH` in your environment).
reader-node-path: "dummy-blockchain"
reader-node-path: "forest"
reader-node-data-dir: "{data-dir}/reader-node"

# Flags that will be added to the dummy chain process command
reader-node-arguments:
start
--tracer=firehose
--store-dir={node-data-dir}
--block-rate=60
--chain calibnet
--encrypt-keystore false
4 changes: 2 additions & 2 deletions devel/stdin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ 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 "$@"
forest --chain calibnet --encrypt-keystore=false | $firefil -c $(basename $ROOT).yaml start "$@"
}

usage_error() {
Expand All @@ -55,4 +55,4 @@ usage() {
echo " -c Clean actual data directory first"
}

main "$@"
main "$@"
2 changes: 1 addition & 1 deletion devel/stdin/stdin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Invoked using:
#
# dummy-blockchain start --tracer=firehose --store-dir=./devel/stdin/firehose-data/reader-node --block-rate=60 | ./devel/stdin/start.sh
# forest --chain calibnet --encrypt-keystore=false | ./devel/stdin/start.sh
#
# The `./devel/stdin/start.sh` does the above invocation and pipes the output to the `stdin` process.
start:
Expand Down
4 changes: 2 additions & 2 deletions pb/last_generate.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
generate.sh - Wed Nov 6 00:50:26 EST 2024 - d
streamingfast/firehose-filecoin/proto revision: ada6ee7
generate.sh - Wed Nov 6 15:46:22 +07 2024 - rumcajs
streamingfast/firehose-filecoin/proto revision: 3910e98
30 changes: 15 additions & 15 deletions pb/sf/filecoin/type/v1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@ import (
firecore "github.com/streamingfast/firehose-core"
)

var _ firecore.Block = (*Block)(nil)
var _ firecore.Block = (*Tipset)(nil)

func (b *Block) GetFirehoseBlockID() string {
return b.Header.Hash
func (b *Tipset) GetFirehoseBlockID() string {
return b.TipsetKey
}

func (b *Block) GetFirehoseBlockNumber() uint64 {
return b.Header.Height
func (b *Tipset) GetFirehoseBlockNumber() uint64 {
return b.Height
}

func (b *Block) GetFirehoseBlockParentID() string {
if b.Header.PreviousHash == nil {
func (b *Tipset) GetFirehoseBlockParentID() string {
if b.ParentTipsetKey == nil {
return ""
}

return *b.Header.PreviousHash
return *b.ParentTipsetKey
}

func (b *Block) GetFirehoseBlockParentNumber() uint64 {
if b.Header.PreviousNum == nil {
func (b *Tipset) GetFirehoseBlockParentNumber() uint64 {
if b.Height == 0 {
return 0
}

return *b.Header.PreviousNum
return b.Height - 1
}

func (b *Block) GetFirehoseBlockTime() time.Time {
return time.Unix(0, int64(b.Header.Timestamp)).UTC()
func (b *Tipset) GetFirehoseBlockTime() time.Time {
return time.Unix(0, int64(b.Timestamp)).UTC()
}

func (b *Block) GetFirehoseBlockLIBNum() uint64 {
return b.Header.FinalNum
func (b *Tipset) GetFirehoseBlockLIBNum() uint64 {
return 1;
}
Loading
Loading