RadarTech / lnrpc

A Typescript gRPC client for LND with support for all LND sub-servers
MIT License
43 stars 13 forks source link

Missing annotations.proto on Windows 10 #59

Closed jamaljsr closed 4 years ago

jamaljsr commented 4 years ago

This issue is related to #56.

I've upgraded my app to use v0.8.0-beta.3. Everything works great on OSX, but on Windows, there is still an issue loading the google proto files. I get this error when calling createLnRpc:

ENOENT: no such file or directory, open 'C:\\...\\node_modules\\@radar\\lnrpc\\lnd\\v0.8.0-beta\\google\\api\\annotations.proto'

I went digging into my node_modules and noticed the google dir is missing.There's only the rpc.proto file there. I went ahead and copied the google dir from the root lnrpc dir.

$ tree lnd/
lnd/
└── v0.8.0-beta
    ├── google
    │   └── api
    │       ├── annotations.proto
    │       └── http.proto
    └── rpc.proto

Now when running my app, I get a slightly different error:

ENOENT: no such file or directory, open 'C:\\...\\node_modules\\@radar\\lnrpc\\lnd\\v0.8.0-beta\\google\\api\\google\\api\\http.proto'

Its looking for a google dir inside of the google dir. So I created a nested copy.

$ tree lnd/
lnd/
└── v0.8.0-beta
    ├── google
    │   └── api
    │       ├── annotations.proto
    │       ├── google
    │       │   └── api
    │       │       ├── annotations.proto
    │       │       └── http.proto
    │       └── http.proto
    └── rpc.proto

Now when I run my app, I get another error:

ENOENT: no such file or directory, open 'C:\\...\\node_modules\\@radar\\lnrpc\\lnd\\v0.8.0-beta\\google\\api\\google\\protobuf\\descriptor.proto'

Its looking for a descriptor.proto file now. I was able to find it here. I saved it into the path, so now I have:

$ tree lnd/
lnd/
└── v0.8.0-beta
    ├── google
    │   └── api
    │       ├── annotations.proto
    │       ├── google
    │       │   ├── api
    │       │   │   ├── annotations.proto
    │       │   │   └── http.proto
    │       │   └── protobuf
    │       │       └── descriptor.proto
    │       └── http.proto
    └── rpc.proto

Finally, my app is able to connect to the LND node.

Just to be certain this wasn't being caused by a configuration issue in my app, I created a simple nodejs app. It produces the same error message about missing annotations.proto.

cavanmflynn commented 4 years ago

Thanks, @jamaljsr. Looking into this issue.

cavanmflynn commented 4 years ago

A fix has been published in v0.8.0-beta.4.

jamaljsr commented 4 years ago

@cavanmflynn wow, that was fast! i’ll give it a try. Thanks