Skip to content

Commit b1ec803

Browse files
authored
read the GRPC endpoint from the env var REMOTE_HSMD_ENDPOINT (#22)
* read the GRPC endpoint from the env var REMOTE_HSMD_ENDPOINT * logging
1 parent b6911c9 commit b1ec803

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/remote_hsmd/proxy.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ const char *proxy_last_message(void)
315315

316316
void proxy_setup()
317317
{
318-
STATUS_DEBUG("%s:%d %s", __FILE__, __LINE__, __FUNCTION__);
319-
auto channel = grpc::CreateChannel("localhost:50051",
318+
const char *endpointvar = getenv("REMOTE_HSMD_ENDPOINT");
319+
const char *endpoint = endpointvar != NULL ? endpointvar : "localhost:50051";
320+
STATUS_DEBUG("%s:%d %s endpoint:%s", __FILE__, __LINE__, __FUNCTION__, endpoint);
321+
auto channel = grpc::CreateChannel(endpoint,
320322
grpc::InsecureChannelCredentials());
321323
stub = Signer::NewStub(channel);
322324
last_message = "";

0 commit comments

Comments
 (0)