Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ansermino/console_reader
Browse files Browse the repository at this point in the history
# Conflicts:
#	cmd/firefil/main.go
  • Loading branch information
ansermino committed Nov 6, 2024
2 parents 01c8563 + 57bda4e commit d7cec85
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 561 deletions.
10 changes: 5 additions & 5 deletions cmd/firefil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,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: console_reader.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/dummy-blockchain@v1.2.0 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

0 comments on commit d7cec85

Please sign in to comment.