Line data Source code
1 : #include "topology.h"
2 : #include "config.h"
3 : #include "../shared/boot/fd_boot.h"
4 : #include "../shared/commands/configure/configure.h"
5 :
6 : char const * FD_APP_NAME = "Firedancer";
7 : char const * FD_BINARY_NAME = "firedancer";
8 :
9 : extern fd_topo_obj_callbacks_t fd_obj_cb_mcache;
10 : extern fd_topo_obj_callbacks_t fd_obj_cb_dcache;
11 : extern fd_topo_obj_callbacks_t fd_obj_cb_fseq;
12 : extern fd_topo_obj_callbacks_t fd_obj_cb_metrics;
13 : extern fd_topo_obj_callbacks_t fd_obj_cb_opaque;
14 : extern fd_topo_obj_callbacks_t fd_obj_cb_dbl_buf;
15 : extern fd_topo_obj_callbacks_t fd_obj_cb_neigh4_hmap;
16 : extern fd_topo_obj_callbacks_t fd_obj_cb_fib4;
17 : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
18 : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
19 : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
20 : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
21 : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
22 : extern fd_topo_obj_callbacks_t fd_obj_cb_exec_spad;
23 : extern fd_topo_obj_callbacks_t fd_obj_cb_banks;
24 : extern fd_topo_obj_callbacks_t fd_obj_cb_funk;
25 : extern fd_topo_obj_callbacks_t fd_obj_cb_bank_hash_cmp;
26 :
27 : fd_topo_obj_callbacks_t * CALLBACKS[] = {
28 : &fd_obj_cb_mcache,
29 : &fd_obj_cb_dcache,
30 : &fd_obj_cb_fseq,
31 : &fd_obj_cb_metrics,
32 : &fd_obj_cb_opaque,
33 : &fd_obj_cb_dbl_buf,
34 : &fd_obj_cb_neigh4_hmap,
35 : &fd_obj_cb_fib4,
36 : &fd_obj_cb_keyswitch,
37 : &fd_obj_cb_tile,
38 : &fd_obj_cb_store,
39 : &fd_obj_cb_fec_sets,
40 : &fd_obj_cb_txncache,
41 : &fd_obj_cb_exec_spad,
42 : &fd_obj_cb_banks,
43 : &fd_obj_cb_funk,
44 : &fd_obj_cb_bank_hash_cmp,
45 : NULL,
46 : };
47 :
48 : configure_stage_t * STAGES[] = {
49 : &fd_cfg_stage_hugetlbfs,
50 : &fd_cfg_stage_sysctl,
51 : &fd_cfg_stage_ethtool_channels,
52 : &fd_cfg_stage_ethtool_gro,
53 : &fd_cfg_stage_ethtool_loopback,
54 : &fd_cfg_stage_snapshots,
55 : NULL,
56 : };
57 :
58 :
59 : extern fd_topo_run_tile_t fd_tile_net;
60 : extern fd_topo_run_tile_t fd_tile_netlnk;
61 : extern fd_topo_run_tile_t fd_tile_sock;
62 : extern fd_topo_run_tile_t fd_tile_quic;
63 : extern fd_topo_run_tile_t fd_tile_verify;
64 : extern fd_topo_run_tile_t fd_tile_dedup;
65 : extern fd_topo_run_tile_t fd_tile_resolv;
66 : extern fd_topo_run_tile_t fd_tile_pack;
67 : extern fd_topo_run_tile_t fd_tile_bank;
68 : extern fd_topo_run_tile_t fd_tile_shred;
69 : extern fd_topo_run_tile_t fd_tile_sign;
70 : extern fd_topo_run_tile_t fd_tile_metric;
71 : extern fd_topo_run_tile_t fd_tile_cswtch;
72 : extern fd_topo_run_tile_t fd_tile_gui;
73 : extern fd_topo_run_tile_t fd_tile_plugin;
74 : extern fd_topo_run_tile_t fd_tile_bundle;
75 :
76 : extern fd_topo_run_tile_t fd_tile_gossvf;
77 : extern fd_topo_run_tile_t fd_tile_gossip;
78 : extern fd_topo_run_tile_t fd_tile_repair;
79 : extern fd_topo_run_tile_t fd_tile_replay;
80 : extern fd_topo_run_tile_t fd_tile_execor;
81 : extern fd_topo_run_tile_t fd_tile_writer;
82 : extern fd_topo_run_tile_t fd_tile_poh;
83 : extern fd_topo_run_tile_t fd_tile_send;
84 : extern fd_topo_run_tile_t fd_tile_tower;
85 : extern fd_topo_run_tile_t fd_tile_rpcserv;
86 : extern fd_topo_run_tile_t fd_tile_genesi;
87 : extern fd_topo_run_tile_t fd_tile_ipecho;
88 :
89 : fd_topo_run_tile_t * TILES[] = {
90 : &fd_tile_net,
91 : &fd_tile_netlnk,
92 : &fd_tile_sock,
93 : &fd_tile_quic,
94 : &fd_tile_verify,
95 : &fd_tile_dedup,
96 : &fd_tile_resolv,
97 : &fd_tile_pack,
98 : &fd_tile_bank,
99 : &fd_tile_shred,
100 : &fd_tile_sign,
101 : &fd_tile_metric,
102 : &fd_tile_cswtch,
103 : &fd_tile_gui,
104 : &fd_tile_plugin,
105 : &fd_tile_bundle,
106 : &fd_tile_gossvf,
107 : &fd_tile_gossip,
108 : &fd_tile_repair,
109 : &fd_tile_replay,
110 : &fd_tile_execor,
111 : &fd_tile_writer,
112 : &fd_tile_poh,
113 : &fd_tile_send,
114 : &fd_tile_tower,
115 : &fd_tile_rpcserv,
116 : &fd_tile_genesi,
117 : &fd_tile_ipecho,
118 : NULL,
119 : };
120 :
121 : extern action_t fd_action_run;
122 : extern action_t fd_action_run1;
123 : extern action_t fd_action_configure;
124 : extern action_t fd_action_monitor;
125 : extern action_t fd_action_keys;
126 : extern action_t fd_action_ready;
127 : extern action_t fd_action_mem;
128 : extern action_t fd_action_netconf;
129 : extern action_t fd_action_set_identity;
130 : extern action_t fd_action_help;
131 : extern action_t fd_action_metrics;
132 : extern action_t fd_action_version;
133 : extern action_t fd_action_shred_version;
134 :
135 : action_t * ACTIONS[] = {
136 : &fd_action_run,
137 : &fd_action_run1,
138 : &fd_action_configure,
139 : &fd_action_monitor,
140 : &fd_action_keys,
141 : &fd_action_ready,
142 : &fd_action_mem,
143 : &fd_action_netconf,
144 : &fd_action_set_identity,
145 : &fd_action_help,
146 : &fd_action_metrics,
147 : &fd_action_version,
148 : &fd_action_shred_version,
149 : NULL,
150 : };
151 :
152 : int
153 : main( int argc,
154 12 : char ** argv ) {
155 12 : fd_config_file_t _default = fd_config_file_default();
156 12 : fd_config_file_t testnet = fd_config_file_testnet();
157 12 : fd_config_file_t devnet = fd_config_file_devnet();
158 12 : fd_config_file_t mainnet = fd_config_file_mainnet();
159 :
160 12 : fd_config_file_t * configs[] = {
161 12 : &_default,
162 12 : &testnet,
163 12 : &devnet,
164 12 : &mainnet,
165 12 : NULL
166 12 : };
167 :
168 12 : return fd_main( argc, argv, 1, configs, fd_topo_initialize );
169 12 : }
170 :
171 : /* Kind of a hack for now, we sometimes want to view bench generation
172 : in the monitor binary, but it's not part of the production binary. */
173 :
174 : void
175 : add_bench_topo( fd_topo_t * topo,
176 : char const * affinity,
177 : ulong benchg_tile_cnt,
178 : ulong benchs_tile_cnt,
179 : ulong accounts_cnt,
180 : int transaction_mode,
181 : float contending_fraction,
182 : float cu_price_spread,
183 : ulong conn_cnt,
184 : ushort send_to_port,
185 : uint send_to_ip_addr,
186 : ushort rpc_port,
187 : uint rpc_ip_addr,
188 : int no_quic,
189 0 : int reserve_agave_cores ) {
190 0 : (void)topo;
191 0 : (void)affinity;
192 0 : (void)benchg_tile_cnt;
193 0 : (void)benchs_tile_cnt;
194 0 : (void)accounts_cnt;
195 0 : (void)transaction_mode;
196 0 : (void)contending_fraction;
197 0 : (void)cu_price_spread;
198 0 : (void)conn_cnt;
199 0 : (void)send_to_port;
200 0 : (void)send_to_ip_addr;
201 0 : (void)rpc_port;
202 0 : (void)rpc_ip_addr;
203 0 : (void)no_quic;
204 0 : (void)reserve_agave_cores;
205 0 : }
|