Skip to content

Commit

Permalink
cleanup command structure, remove compare-blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Feb 16, 2024
1 parent e47c60c commit d247667
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 123 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ for instructions to keep up to date.
> 2. New Poller: firesol no longer gets blocks from a Bigtable instance: it fetches the blocks using RPC calls
> - Run `firecore start reader` with `--reader-node-path=/path/to/firesol` and `--reader-node-arguments=fetch rpc <https://your.solana.rpc/path> <start-block>`
> 3. New Block Format requires either fetching all the merged blocks again or converting them
> - Convert old blocks by running: `ACCEPT_SOLANA_LEGACY_BLOCK_FORMAT=true firesol block upgrade-merged-blocks <source-store> <dest-store> <start-num:stop-num>`
> - Convert old blocks by running: `ACCEPT_SOLANA_LEGACY_BLOCK_FORMAT=true firesol upgrade-merged-blocks <source-store> <dest-store> <start-num:stop-num>`
> 4. Upgrading your deployment will require a "stop the world" upgrade, where you start the new binaries, pointing to the new blocks, without any contact with the previous blocks or components.
## Removed

* All the `firesol start ...` commands have been removed. Use [firecore binary](https://github.com/streamingfast/firehose-core) to run the reader, merger, relayer, firehose and substreams services
* Most of the `firesol tools` commands
* All the existing `firesol tools` commands

## Added

* Added `fetch rpc <endpoint> <start_block>` command fetches and prints the blocks in protobuf format, to be used by the `firecore start reader` command.
* Added `block upgrade-merged-blocks` command to perform the upgrade on previous solana merged-blocks.
* Added `upgrade-merged-blocks` command to perform the upgrade on previous solana merged-blocks.
* Bumped firecore version to v1.2.0

## Fixed
Expand Down
98 changes: 0 additions & 98 deletions cmd/bt/main.go

This file was deleted.

10 changes: 1 addition & 9 deletions cmd/firesol/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import (
"time"

"github.com/spf13/cobra"
firecore "github.com/streamingfast/firehose-core"
"github.com/streamingfast/firehose-core/cmd/tools"
"github.com/streamingfast/firehose-core/cmd/tools/compare"
"github.com/streamingfast/firehose-solana/cmd/firesol/block"
"github.com/streamingfast/firehose-solana/cmd/firesol/rpc"
pbsol "github.com/streamingfast/firehose-solana/pb/sf/solana/type/v1"
"github.com/streamingfast/logging"
"go.uber.org/zap"
)
Expand All @@ -25,13 +21,9 @@ var rootCmd = &cobra.Command{
func init() {
logging.InstantiateLoggers(logging.WithDefaultLevel(zap.InfoLevel))
rootCmd.AddCommand(newFetchCmd(logger, tracer))
chain := &firecore.Chain[*pbsol.Block]{
BlockFactory: func() firecore.Block { return new(pbsol.Block) },
}

rootCmd.AddCommand(tools.ToolsCmd)
rootCmd.AddCommand(block.NewBlockCmd(logger, tracer))
tools.ToolsCmd.AddCommand(compare.NewToolsCompareBlocksCmd(chain))
tools.ToolsCmd.AddCommand(NewUpgradeCmd(logger, tracer))
}

func main() {
Expand Down
15 changes: 2 additions & 13 deletions cmd/firesol/block/upgrader.go → cmd/firesol/upgrader.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package block
package main

import (
"context"
Expand All @@ -18,18 +18,7 @@ import (
"golang.org/x/exp/slices"
)

func NewBlockCmd(logger *zap.Logger, tracer logging.Tracer) *cobra.Command {
cmd := &cobra.Command{
Use: "block <source> <destination> <range>",
Short: "upgrade-merged-blocks from legacy to new format using anypb.Any as payload",
}

cmd.AddCommand(NewFetchCmd(logger, tracer))

return cmd
}

func NewFetchCmd(logger *zap.Logger, tracer logging.Tracer) *cobra.Command {
func NewUpgradeCmd(logger *zap.Logger, tracer logging.Tracer) *cobra.Command {
cmd := &cobra.Command{
Use: "upgrade-merged-blocks <source> <destination> <range>",
Short: "upgrade-merged-blocks from legacy to new format using anypb.Any as payload",
Expand Down

0 comments on commit d247667

Please sign in to comment.