mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
* core/state: typo Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: backport from https://github.com/bnb-chain/bsc/pull/543 Signed-off-by: Delweng <delweng@gmail.com> * eth,ethdb,node,core/state: backport from https://github.com/bnb-chain/bsc/pull/543 Signed-off-by: Delweng <delweng@gmail.com> * eth,core: backport from https://github.com/bnb-chain/bsc/pull/543 Signed-off-by: Delweng <delweng@gmail.com> * cmd: open db with freeze disabled Signed-off-by: Delweng <delweng@gmail.com> * cli: snapshot prune-block Signed-off-by: Delweng <delweng@gmail.com> * fix typo Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: fix the issue of dup open db error Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: resolve datadir and ancient before backup Signed-off-by: Delweng <delweng@gmail.com> * core: more prune-block log Signed-off-by: Delweng <delweng@gmail.com> * core: truncatetail missing f.offset Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: indextx adjust offset of pruned block Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: freezer batch should implement the offset commit, ref https://github.com/bnb-chain/bsc/pull/1005 Signed-off-by: Delweng <delweng@gmail.com> * core: check of ancientdb, backport https://github.com/bnb-chain/bsc/pull/817 Signed-off-by: Delweng <delweng@gmail.com> * core/state: read raw borReceipt to backup Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: bor receipt maybe in []Receipt or Receipt RLP format Signed-off-by: Delweng <delweng@gmail.com> * core/state: typo and error msg Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: offSet -> offset Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: comment Signed-off-by: Delweng <delweng@gmail.com> * cli/snapshot: add prune-block doc Signed-off-by: Delweng <delweng@gmail.com> * docs: add prune-block document Signed-off-by: Delweng <delweng@gmail.com> * core/rawdb: print wrong bor-receipt length Signed-off-by: Delweng <delweng@gmail.com> * internal/cli: add snapshot prune block tests (referenced from bsc's PR) * improve errors * cmd, core, eth, internal: fix lint * internal/cli: refactor snapshot prune block test * fix linters in tests * internal/cli: add inspect-ancient-db command, update docs * pruner: use a generic function for simplification * internal/cli: fixes for inspect-db command * internal/cli: improve pruning tests * core/rawdb: update end block calculation logic in inspect command * core/rawdb: improve checks db initialisation * core/rawdb: remove offset check * update mocks for span, ethdb and add command in makefile * docs/cli: update docs with inspect command * go mod tidy * refactor and resolve conflicts * resolve more conflicts * refactor * explicitly read node for hash scheme * add check for hash scheme, fix tests * fix typo * update docs and add warning * raise error if pbss is enabled * revert read raw bor receipt change * consensus/bor: handle nil header case in get root hash * address comments * core/rawdb: check chain continuity by matching parent hash * core/rawdb: account for pruned ancient blocks * go mod tidy * fix tests * fix tests --------- Signed-off-by: Delweng <delweng@gmail.com> Co-authored-by: Delweng <delweng@gmail.com>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package cli
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/mitchellh/cli"
|
|
)
|
|
|
|
// ChainCommand is the command to group the peers commands
|
|
type ChainCommand struct {
|
|
UI cli.Ui
|
|
}
|
|
|
|
// MarkDown implements cli.MarkDown interface
|
|
func (c *ChainCommand) MarkDown() string {
|
|
items := []string{
|
|
"# Chain",
|
|
"The ```chain``` command groups actions to interact with the blockchain in the client:",
|
|
"- [```chain sethead```](./chain_sethead.md): Set the current chain to a certain block.",
|
|
"- [```chain watch```](./chain_watch.md): Watch the chainHead, reorg and fork events in real-time.",
|
|
}
|
|
|
|
return strings.Join(items, "\n\n")
|
|
}
|
|
|
|
// Help implements the cli.Command interface
|
|
func (c *ChainCommand) Help() string {
|
|
return `Usage: bor chain <subcommand>
|
|
|
|
This command groups actions to interact with the chain.
|
|
|
|
Set the new head of the chain:
|
|
|
|
$ bor chain sethead <number>`
|
|
}
|
|
|
|
// Synopsis implements the cli.Command interface
|
|
func (c *ChainCommand) Synopsis() string {
|
|
return "Interact with the chain"
|
|
}
|
|
|
|
// Run implements the cli.Command interface
|
|
func (c *ChainCommand) Run(args []string) int {
|
|
return cli.RunResultHelp
|
|
}
|