Skip to content

Commit

Permalink
no more acme, more fields
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Nov 6, 2024
1 parent 3910e98 commit c272eab
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 271 deletions.
27 changes: 0 additions & 27 deletions cmd/fireacme/main.go

This file was deleted.

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
3 changes: 1 addition & 2 deletions devel/stdin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

clean=
fireacme="$ROOT/../fireacme"
firefil="$ROOT/../firefil"

main() {
pushd "$ROOT" &> /dev/null
Expand Down Expand Up @@ -33,7 +33,6 @@ 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" | $fireacme -c $(basename $ROOT).yaml start "$@"
forest --chain calibnet --encrypt-keystore=false | $firefil -c $(basename $ROOT).yaml 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 15:20:13 +07 2024 - rumcajs
streamingfast/firehose-filecoin/proto revision: edddbaf
generate.sh - Wed Nov 6 15:46:22 +07 2024 - rumcajs
streamingfast/firehose-filecoin/proto revision: 3910e98
33 changes: 0 additions & 33 deletions pb/sf/acme/type/v1/type.go

This file was deleted.

171 changes: 0 additions & 171 deletions pb/sf/acme/type/v1/type.pb.go

This file was deleted.

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 c272eab

Please sign in to comment.