Skip to content

Commit

Permalink
Remove deprecated cli options for fluffy (#2517)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme authored Jul 23, 2024
1 parent 1e1bc66 commit c2d9c0b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 41 deletions.
18 changes: 0 additions & 18 deletions fluffy/conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ type
name: "listen-address"
.}: IpAddress

portalNetworkDeprecated* {.
hidden,
desc:
"DEPRECATED: The --portal-network flag will be removed in the future, " &
"please use the drop in replacement --network flag instead",
defaultValue: none(PortalNetwork),
name: "portal-network"
.}: Option[PortalNetwork]

network* {.
desc:
"Select which Portal network to join. This will set the " &
Expand All @@ -100,15 +91,6 @@ type
name: "network"
.}: PortalNetwork

networksDeprecated* {.
hidden,
desc:
"DEPRECATED: The --networks flag will be removed in the future, " &
"please use the drop in replacement --portal-subnetworks flag instead",
defaultValue: {},
name: "networks"
.}: set[PortalSubnetwork]

portalSubnetworks* {.
desc: "Select which networks (Portal sub-protocols) to enable",
defaultValue: {PortalSubnetwork.history},
Expand Down
2 changes: 1 addition & 1 deletion fluffy/docs/the_fluffy_book/docs/run-local-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ any of the running nodes their ENR.
E.g. to manually add a Fluffy node to the local testnet run:

```bash
./build/fluffy --rpc --portal-network:none --udp-port:9010 --nat:extip:127.0.0.1 --bootstrap-node:`cat ./local_testnet_data/node0/fluffy_node.enr`
./build/fluffy --rpc --network:none --udp-port:9010 --nat:extip:127.0.0.1 --bootstrap-node:`cat ./local_testnet_data/node0/fluffy_node.enr`
```
24 changes: 4 additions & 20 deletions fluffy/fluffy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,7 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
loadBootstrapFile(string config.bootstrapNodesFile, bootstrapRecords)
bootstrapRecords.add(config.bootstrapNodes)

let portalNetwork =
if config.portalNetworkDeprecated.isNone():
config.network
else:
warn "DEPRECATED: The --portal-network flag will be removed in the future, " &
"please use the drop in replacement --network flag instead"
config.portalNetworkDeprecated.get()

let portalSubnetworks =
if config.networksDeprecated == {}:
config.portalSubnetworks
else:
warn "DEPRECATED: The --networks flag will be removed in the future, " &
"please use the drop in replacement --portal-subnetworks flag instead"
config.networksDeprecated

case portalNetwork
case config.network
of PortalNetwork.none:
discard # don't connect to any network bootstrap nodes
of PortalNetwork.mainnet:
Expand Down Expand Up @@ -142,7 +126,7 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
## Force pruning - optional
if config.forcePrune:
let db = ContentDB.new(
config.dataDir / portalNetwork.getDbDirectory() / "contentdb_" &
config.dataDir / config.network.getDbDirectory() / "contentdb_" &
d.localNode.id.toBytesBE().toOpenArray(0, 8).toHex(),
storageCapacity = config.storageCapacityMB * 1_000_000,
manualCheckpoint = true,
Expand Down Expand Up @@ -189,10 +173,10 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
)

node = PortalNode.new(
portalNetwork,
config.network,
portalNodeConfig,
d,
portalSubnetworks,
config.portalSubnetworks,
bootstrapRecords = bootstrapRecords,
rng = rng,
)
Expand Down
4 changes: 2 additions & 2 deletions fluffy/scripts/launch_local_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do
--log-level="${LOG_LEVEL}" \
--udp-port=$(( BASE_PORT + NUM_NODE )) \
--data-dir="${NODE_DATA_DIR}" \
--portal-network="none" \
--network="none" \
${BOOTSTRAP_ARG} \
--rpc \
--rpc-address="127.0.0.1" \
Expand All @@ -315,7 +315,7 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do
--table-ip-limit=1024 \
--bucket-ip-limit=24 \
--bits-per-hop=1 \
--networks:beacon,history,state \
--portal-subnetworks:beacon,history,state \
${TRUSTED_BLOCK_ROOT_ARG} \
${RADIUS_ARG} \
${EXTRA_ARGS} \
Expand Down

0 comments on commit c2d9c0b

Please sign in to comment.