Skip to content

Commit 472f0e6

Browse files
committed
Add support for secondary network to pythd
1 parent b5a6354 commit 472f0e6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pcapps/pythd.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,17 @@ int main(int argc, char **argv)
9797
commitment cmt = commitment::e_confirmed;
9898
std::string cnt_dir, cap_file, log_file;
9999
std::string rpc_host = get_rpc_host();
100+
std::string secondary_rpc_host = "";
100101
std::string key_dir = get_key_store();
101102
std::string tx_host = get_tx_host();
102103
int pyth_port = get_port();
103104
int opt = 0;
104105
unsigned max_batch_size = 0;
105106
bool do_wait = true, do_tx = true, do_ws = true, do_debug = false;
106-
while( (opt = ::getopt(argc,argv, "r:t:p:k:w:c:l:m:b:dnxhz" )) != -1 ) {
107+
while( (opt = ::getopt(argc,argv, "r:s:t:p:k:w:c:l:m:b:dnxhz" )) != -1 ) {
107108
switch(opt) {
108109
case 'r': rpc_host = optarg; break;
110+
case 's': secondary_rpc_host = optarg; break;
109111
case 't': tx_host = optarg; break;
110112
case 'p': pyth_port = ::atoi(optarg); break;
111113
case 'k': key_dir = optarg; break;
@@ -147,6 +149,11 @@ int main(int argc, char **argv)
147149
mgr.set_do_ws( do_ws );
148150
mgr.set_do_capture( !cap_file.empty() );
149151
mgr.set_commitment( cmt );
152+
153+
bool do_secondary = !secondary_rpc_host.empty();
154+
if ( do_secondary ) {
155+
mgr.add_secondary( secondary_rpc_host, key_dir );
156+
}
150157
if ( !mgr.init() ) {
151158
std::cerr << "pythd: " << mgr.get_err_msg() << std::endl;
152159
return 1;

0 commit comments

Comments
 (0)