Skip to content

Commit 448369f

Browse files
Merge #335
335: Implement real vs mock protocol selection r=Jimbo4350 a=Jimbo4350 Implements the `NodeProtocolMode` type which differentiates whether the node is running a real protocol vs a mock protocol. Changes: - When running a real protocol, the topology comes from a `JSON` file which is decoded to `RealNodeTopology` which specifies the addresses the node intends to connect to. - `socket-dir` command line argument is changed to `socket-path` i.e you must specify socket paths and not dirs anymore. - `NodeId` only needs to be specified for mock protocols (https://github.com/input-output-hk/cardano-node/blob/d24cefd7a4fb1afbf13e8e7f7971e22704673f98/cardano-config/src/Cardano/Config/Protocol.hs#L129) The `cardano-node` client is now as follows (with further help for both `run` and `run-mock` via `cabal exec cardano-node run/run-mock -- --help`): ``` Usage: cardano-node (run | run-mock) [--help] Start node of the Cardano blockchain. Available options: --help Show this help text Execute node with a real protocol. run Execute node with a real protocol. Execute node with a mock protocol. run-mock Execute node with a mock protocol. ``` Relevant: #297, #318, #314 Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
2 parents 23c0855 + caf342f commit 448369f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+692
-472
lines changed

benchmarking/chain-sync/benchmark-chain-sync-mainnet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ exec ${NODE} \
3939
--genesis-hash "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb" \
4040
--config ${BASEDIR}/configuration/log-configuration.yaml \
4141
--database-path .//db-mainnet \
42-
--socket-dir /tmp/socket-bm-chain-sync \
42+
--socket-path /tmp/socket-bm-chain-sync \
4343
--topology ${BASEDIR}/configuration/topology-local.yaml \
4444
--host-addr 127.0.0.1 \
4545
--port 7778 \

benchmarking/chain-sync/configuration/log-config-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ options:
7777
##########################################################
7878

7979

80-
NodeId: 0
80+
NodeId:
8181
Protocol: RealPBFT
8282
NumCoreNodes: 1
8383
RequiresNetworkMagic: RequiresNoMagic

benchmarking/chain-sync/configuration/log-configuration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ options:
8585
##########################################################
8686

8787

88-
NodeId: 0
88+
NodeId:
8989
Protocol: RealPBFT
9090
NumCoreNodes: 1
9191
RequiresNetworkMagic: RequiresNoMagic
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
[{"nodeAddress":{"addr":"127.0.0.1","port":3001},"nodeId":0,"producers":[{"addr":"127.0.0.1","port":7777,"valency":1}]}]
1+
{
2+
"Producers":[
3+
{
4+
"addr":"127.0.0.1",
5+
"port":7777,
6+
"valency":1
7+
}
8+
]
9+
}

benchmarking/cluster3nodes/configuration/log-config-0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ options:
7575
##########################################################
7676

7777

78-
NodeId: 0
78+
NodeId:
7979
Protocol: RealPBFT
8080
NumCoreNodes: 1
8181
RequiresNetworkMagic: RequiresMagic

benchmarking/cluster3nodes/configuration/log-config-1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ options:
7777
##########################################################
7878

7979

80-
NodeId: 1
80+
NodeId:
8181
Protocol: RealPBFT
8282
NumCoreNodes: 1
8383
RequiresNetworkMagic: RequiresMagic

benchmarking/cluster3nodes/configuration/log-config-2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ options:
8181
##########################################################
8282

8383

84-
NodeId: 2
84+
NodeId:
8585
Protocol: RealPBFT
8686
NumCoreNodes: 1
8787
RequiresNetworkMagic: RequiresMagic

benchmarking/cluster3nodes/configuration/log-config-generator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ options:
8181
##########################################################
8282

8383

84-
NodeId: 99
84+
NodeId:
8585
Protocol: RealPBFT
8686
NumCoreNodes: 1
8787
RequiresNetworkMagic: RequiresMagic

benchmarking/cluster3nodes/configuration/log-config-genesis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ options:
4949
##########################################################
5050

5151

52-
NodeId: 0
52+
NodeId:
5353
Protocol: RealPBFT
5454
NumCoreNodes: 1
5555
RequiresNetworkMagic: RequiresMagic
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
{
3+
"Producers":[
4+
{
5+
"addr":"127.0.0.1",
6+
"port":3001,
7+
"valency":1
8+
},
9+
{
10+
"addr":"127.0.0.1",
11+
"port":3002,
12+
"valency":1
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)