simpleledgerinc / grpc-bchrpc-node

A BCHD gRPC client for node.js
11 stars 10 forks source link

Isomorphic #4

Closed elderapo closed 3 years ago

elderapo commented 4 years ago

It would be nice to have isomorphic grpc-bchrpc package that uses grpc-bchrpc-node if ran from nodejs and grpc-bchrpc-web if ran from web.

I think both of these packages have exact same API besides connection logic which could be abstracted like:

const nodeClient = new GrpcClient({
    transport: new GrpcClientNodeTransport({
        url: "bchd.greyh.at:8335"
        rootCertPath: ...,
        ...otherNodeTransportOptions
    })
});

const browserClient = new GrpcClient({
    transport: new GrpcClientBrowserTransport({
        url: "https://bchd.greyh.at:8335"
    })
});
jcramer commented 4 years ago

I really like this idea.

jcramer commented 3 years ago

Closing this as I don't see it happening unless someone else wants to take the time to make it happen.