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_dbl_buf;
14 : extern fd_topo_obj_callbacks_t fd_obj_cb_neigh4_hmap;
15 : extern fd_topo_obj_callbacks_t fd_obj_cb_fib4;
16 : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
17 : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
18 : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
19 : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
20 : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
21 : extern fd_topo_obj_callbacks_t fd_obj_cb_banks;
22 : extern fd_topo_obj_callbacks_t fd_obj_cb_funk;
23 : extern fd_topo_obj_callbacks_t fd_obj_cb_funk_locks;
24 : extern fd_topo_obj_callbacks_t fd_obj_cb_progcache;
25 : extern fd_topo_obj_callbacks_t fd_obj_cb_acc_pool;
26 : extern fd_topo_obj_callbacks_t fd_obj_cb_rnonce_ss;
27 :
28 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_meta;
29 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_meta_ele;
30 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_data;
31 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_req_pool;
32 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_rq;
33 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_cq;
34 : extern fd_topo_obj_callbacks_t fd_obj_cb_vinyl_admin;
35 :
36 : fd_topo_obj_callbacks_t * CALLBACKS[] = {
37 : &fd_obj_cb_mcache,
38 : &fd_obj_cb_dcache,
39 : &fd_obj_cb_fseq,
40 : &fd_obj_cb_metrics,
41 : &fd_obj_cb_dbl_buf,
42 : &fd_obj_cb_neigh4_hmap,
43 : &fd_obj_cb_fib4,
44 : &fd_obj_cb_keyswitch,
45 : &fd_obj_cb_tile,
46 : &fd_obj_cb_store,
47 : &fd_obj_cb_fec_sets,
48 : &fd_obj_cb_txncache,
49 : &fd_obj_cb_banks,
50 : &fd_obj_cb_funk,
51 : &fd_obj_cb_funk_locks,
52 : &fd_obj_cb_progcache,
53 : &fd_obj_cb_acc_pool,
54 : &fd_obj_cb_vinyl_meta,
55 : &fd_obj_cb_vinyl_meta_ele,
56 : &fd_obj_cb_vinyl_data,
57 : &fd_obj_cb_acc_pool,
58 : &fd_obj_cb_vinyl_req_pool,
59 : &fd_obj_cb_vinyl_rq,
60 : &fd_obj_cb_vinyl_cq,
61 : &fd_obj_cb_vinyl_admin,
62 : &fd_obj_cb_rnonce_ss,
63 : NULL,
64 : };
65 :
66 : extern configure_stage_t fd_cfg_stage_accdb;
67 :
68 : configure_stage_t * STAGES[] = {
69 : &fd_cfg_stage_hugetlbfs,
70 : &fd_cfg_stage_sysctl,
71 : &fd_cfg_stage_bonding,
72 : &fd_cfg_stage_ethtool_channels,
73 : &fd_cfg_stage_ethtool_offloads,
74 : &fd_cfg_stage_ethtool_loopback,
75 : &fd_cfg_stage_snapshots,
76 : &fd_cfg_stage_accdb,
77 : NULL,
78 : };
79 :
80 :
81 : extern fd_topo_run_tile_t fd_tile_net;
82 : extern fd_topo_run_tile_t fd_tile_netlnk;
83 : extern fd_topo_run_tile_t fd_tile_sock;
84 : extern fd_topo_run_tile_t fd_tile_quic;
85 : extern fd_topo_run_tile_t fd_tile_verify;
86 : extern fd_topo_run_tile_t fd_tile_dedup;
87 : extern fd_topo_run_tile_t fd_tile_resolv;
88 : extern fd_topo_run_tile_t fd_tile_pack;
89 : extern fd_topo_run_tile_t fd_tile_execle;
90 : extern fd_topo_run_tile_t fd_tile_poh;
91 : extern fd_topo_run_tile_t fd_tile_shred;
92 : extern fd_topo_run_tile_t fd_tile_sign;
93 : extern fd_topo_run_tile_t fd_tile_metric;
94 : extern fd_topo_run_tile_t fd_tile_event;
95 : extern fd_topo_run_tile_t fd_tile_diag;
96 : extern fd_topo_run_tile_t fd_tile_gui;
97 : extern fd_topo_run_tile_t fd_tile_rpc;
98 : extern fd_topo_run_tile_t fd_tile_plugin;
99 : extern fd_topo_run_tile_t fd_tile_bundle;
100 : #if FD_HAS_BZIP2
101 : extern fd_topo_run_tile_t fd_tile_genesi;
102 : #endif
103 : extern fd_topo_run_tile_t fd_tile_ipecho;
104 :
105 : extern fd_topo_run_tile_t fd_tile_gossvf;
106 : extern fd_topo_run_tile_t fd_tile_gossip;
107 : extern fd_topo_run_tile_t fd_tile_repair;
108 : extern fd_topo_run_tile_t fd_tile_replay;
109 : extern fd_topo_run_tile_t fd_tile_execrp;
110 : extern fd_topo_run_tile_t fd_tile_txsend;
111 : extern fd_topo_run_tile_t fd_tile_tower;
112 : extern fd_topo_run_tile_t fd_tile_vinyl;
113 : extern fd_topo_run_tile_t fd_tile_solcap;
114 :
115 : extern fd_topo_run_tile_t fd_tile_snapct;
116 : extern fd_topo_run_tile_t fd_tile_snapld;
117 : extern fd_topo_run_tile_t fd_tile_snapdc;
118 : extern fd_topo_run_tile_t fd_tile_snapin;
119 : extern fd_topo_run_tile_t fd_tile_snapwm;
120 : extern fd_topo_run_tile_t fd_tile_snapwh;
121 : extern fd_topo_run_tile_t fd_tile_snapwr;
122 : extern fd_topo_run_tile_t fd_tile_snapla;
123 : extern fd_topo_run_tile_t fd_tile_snapls;
124 : extern fd_topo_run_tile_t fd_tile_snaplh;
125 : extern fd_topo_run_tile_t fd_tile_snaplv;
126 :
127 : fd_topo_run_tile_t * TILES[] = {
128 : &fd_tile_net,
129 : &fd_tile_netlnk,
130 : &fd_tile_sock,
131 : &fd_tile_quic,
132 : &fd_tile_verify,
133 : &fd_tile_dedup,
134 : &fd_tile_resolv,
135 : &fd_tile_pack,
136 : &fd_tile_execle,
137 : &fd_tile_shred,
138 : &fd_tile_sign,
139 : &fd_tile_metric,
140 : &fd_tile_event,
141 : &fd_tile_diag,
142 : &fd_tile_gui,
143 : &fd_tile_rpc,
144 : &fd_tile_plugin,
145 : &fd_tile_bundle,
146 : &fd_tile_gossvf,
147 : &fd_tile_gossip,
148 : &fd_tile_repair,
149 : &fd_tile_replay,
150 : &fd_tile_execrp,
151 : &fd_tile_poh,
152 : &fd_tile_txsend,
153 : &fd_tile_tower,
154 : &fd_tile_snapct,
155 : &fd_tile_snapld,
156 : &fd_tile_snapdc,
157 : &fd_tile_snapin,
158 : &fd_tile_snapwm,
159 : &fd_tile_snapwh,
160 : &fd_tile_snapwr,
161 : &fd_tile_snapla,
162 : &fd_tile_snapls,
163 : &fd_tile_snaplh,
164 : &fd_tile_snaplv,
165 : # if FD_HAS_BZIP2
166 : &fd_tile_genesi,
167 : # endif
168 : &fd_tile_ipecho,
169 : &fd_tile_vinyl,
170 : &fd_tile_solcap,
171 : NULL,
172 : };
173 :
174 : extern action_t fd_action_run;
175 : extern action_t fd_action_run1;
176 : extern action_t fd_action_configure;
177 : extern action_t fd_action_monitor;
178 : extern action_t fd_action_keys;
179 : extern action_t fd_action_ready;
180 : extern action_t fd_action_mem;
181 : extern action_t fd_action_netconf;
182 : extern action_t fd_action_help;
183 : extern action_t fd_action_metrics;
184 : extern action_t fd_action_version;
185 : extern action_t fd_action_shred_version;
186 : extern action_t fd_action_watch;
187 : extern action_t fd_action_add_authorized_voter;
188 : extern action_t fd_action_set_identity;
189 : extern action_t fd_action_monitor_gossip;
190 :
191 : action_t * ACTIONS[] = {
192 : &fd_action_run,
193 : &fd_action_run1,
194 : &fd_action_configure,
195 : &fd_action_monitor,
196 : &fd_action_keys,
197 : &fd_action_ready,
198 : &fd_action_mem,
199 : &fd_action_netconf,
200 : &fd_action_help,
201 : &fd_action_metrics,
202 : &fd_action_version,
203 : &fd_action_shred_version,
204 : &fd_action_add_authorized_voter,
205 : &fd_action_watch,
206 : &fd_action_monitor_gossip,
207 : &fd_action_set_identity,
208 : NULL,
209 : };
210 :
211 : int
212 : main( int argc,
213 18 : char ** argv ) {
214 18 : fd_config_file_t _default = fd_config_file_default();
215 18 : fd_config_file_t testnet = fd_config_file_testnet();
216 18 : fd_config_file_t devnet = fd_config_file_devnet();
217 18 : fd_config_file_t mainnet = fd_config_file_mainnet();
218 :
219 18 : fd_config_file_t * configs[] = {
220 18 : &_default,
221 18 : &testnet,
222 18 : &devnet,
223 18 : &mainnet,
224 18 : NULL
225 18 : };
226 :
227 18 : return fd_main( argc, argv, 1, configs, fd_topo_initialize );
228 18 : }
229 :
230 : /* Kind of a hack for now, we sometimes want to view bench generation
231 : in the monitor binary, but it's not part of the production binary. */
232 :
233 : void
234 : add_bench_topo( fd_topo_t * topo,
235 : char const * affinity,
236 : ulong benchg_tile_cnt,
237 : ulong benchs_tile_cnt,
238 : ulong accounts_cnt,
239 : int transaction_mode,
240 : float contending_fraction,
241 : float cu_price_spread,
242 : ulong conn_cnt,
243 : ushort send_to_port,
244 : uint send_to_ip_addr,
245 : ushort rpc_port,
246 : uint rpc_ip_addr,
247 : int no_quic,
248 0 : int reserve_agave_cores ) {
249 0 : (void)topo;
250 0 : (void)affinity;
251 0 : (void)benchg_tile_cnt;
252 0 : (void)benchs_tile_cnt;
253 0 : (void)accounts_cnt;
254 0 : (void)transaction_mode;
255 0 : (void)contending_fraction;
256 0 : (void)cu_price_spread;
257 0 : (void)conn_cnt;
258 0 : (void)send_to_port;
259 0 : (void)send_to_ip_addr;
260 0 : (void)rpc_port;
261 0 : (void)rpc_ip_addr;
262 0 : (void)no_quic;
263 0 : (void)reserve_agave_cores;
264 0 : }
|