Skip to content
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
1 change: 1 addition & 0 deletions builder/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chain = "mainnet"
# identity = "Pratiks-MacBook-Pro.local"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "/var/lib/bor/keystore"
syncmode = "full"
# gcmode = "full"
Expand Down
1 change: 1 addition & 0 deletions docs/cli/example_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ chain = "mainnet" # Name of the chain to sync ("mumbai", "mainnet") o
identity = "Annon-Identity" # Name/Identity of the node (default = OS hostname)
log-level = "INFO" # Set log level for the server
datadir = "var/lib/bor" # Path of the data directory to store information
ancient = "" # Data directory for ancient chain segments (default = inside chaindata)
keystore = "" # Path of the directory where keystores are located
syncmode = "full" # Blockchain sync mode (only "full" sync supported)
gcmode = "full" # Blockchain garbage collection mode ("full", "archive")
Expand Down
8 changes: 8 additions & 0 deletions internal/cli/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ type Config struct {
// DataDir is the directory to store the state in
DataDir string `hcl:"datadir,optional" toml:"datadir,optional"`

// Ancient is the directory to store the state in
Ancient string `hcl:"ancient,optional" toml:"ancient,optional"`

// KeyStoreDir is the directory to store keystores
KeyStoreDir string `hcl:"keystore,optional" toml:"keystore,optional"`

Expand Down Expand Up @@ -398,6 +401,7 @@ func DefaultConfig() *Config {
RequiredBlocks: map[string]string{},
LogLevel: "INFO",
DataDir: DefaultDataDir(),
Ancient: "",
P2P: &P2PConfig{
MaxPeers: 50,
MaxPendPeers: 50,
Expand Down Expand Up @@ -879,6 +883,10 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
n.BorLogs = c.BorLogs
n.DatabaseHandles = dbHandles

if c.Ancient != "" {
n.DatabaseFreezer = c.Ancient
}

return &n, nil
}

Expand Down
6 changes: 6 additions & 0 deletions internal/cli/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ func (c *Command) Flags() *flagset.Flagset {
Value: &c.cliConfig.DataDir,
Default: c.cliConfig.DataDir,
})
f.StringFlag(&flagset.StringFlag{
Name: "datadir.ancient",
Usage: "Data directory for ancient chain segments (default = inside chaindata)",
Value: &c.cliConfig.Ancient,
Default: c.cliConfig.Ancient,
})
f.StringFlag(&flagset.StringFlag{
Name: "keystore",
Usage: "Path of the directory where keystores are located",
Expand Down
1 change: 1 addition & 0 deletions packaging/templates/mainnet-v1/archive/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ chain = "mainnet"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = ""
syncmode = "full"
gcmode = "archive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ chain = "mainnet"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = ""
syncmode = "full"
# gcmode = "full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mainnet"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "$BOR_DIR/keystore"
syncmode = "full"
# gcmode = "full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mainnet"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "$BOR_DIR/keystore"
syncmode = "full"
# gcmode = "full"
Expand Down
1 change: 1 addition & 0 deletions packaging/templates/testnet-v4/archive/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ chain = "mumbai"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = ""
syncmode = "full"
gcmode = "archive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ chain = "mumbai"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = ""
syncmode = "full"
# gcmode = "full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mumbai"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "$BOR_DIR/keystore"
syncmode = "full"
# gcmode = "full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chain = "mumbai"
# identity = "node_name"
# log-level = "INFO"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "$BOR_DIR/keystore"
syncmode = "full"
# gcmode = "full"
Expand Down