Merge pull request #9287 from Abhinav-Bansal751/master
Update docs/grpc/python.md and ruby.md
This commit is contained in:
2 files changed
+8
-17
No files matched your search
+7
-12
@@ -17,25 +17,20 @@ file in Python before you can use it to communicate with lnd.
|
|||||||
```shell
|
```shell
|
||||||
$ source lnd/bin/activate
|
$ source lnd/bin/activate
|
||||||
```
|
```
|
||||||
3. Install dependencies (googleapis-common-protos is required due to the use of
|
3. Install dependencies
|
||||||
google/api/annotations.proto)
|
|
||||||
```shell
|
```shell
|
||||||
lnd $ pip install grpcio grpcio-tools googleapis-common-protos mypy-protobuf
|
lnd $ pip install grpcio-tools
|
||||||
```
|
```
|
||||||
4. Clone the google api's repository (required due to the use of
|
|
||||||
google/api/annotations.proto)
|
4. Copy the lnd lightning.proto file (you'll find this at
|
||||||
```shell
|
|
||||||
lnd $ git clone https://github.com/googleapis/googleapis.git
|
|
||||||
```
|
|
||||||
5. Copy the lnd lightning.proto file (you'll find this at
|
|
||||||
[lnrpc/lightning.proto](https://github.com/lightningnetwork/lnd/blob/master/lnrpc/lightning.proto))
|
[lnrpc/lightning.proto](https://github.com/lightningnetwork/lnd/blob/master/lnrpc/lightning.proto))
|
||||||
or just download it
|
or just download it
|
||||||
```shell
|
```shell
|
||||||
lnd $ curl -o lightning.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/lightning.proto
|
lnd $ curl -o lightning.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/lightning.proto
|
||||||
```
|
```
|
||||||
6. Compile the proto file
|
5. Compile the proto file
|
||||||
```shell
|
```shell
|
||||||
lnd $ python -m grpc_tools.protoc --proto_path=googleapis:. --mypy_out=. --python_out=. --grpc_python_out=. lightning.proto
|
lnd $ python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. lightning.proto
|
||||||
```
|
```
|
||||||
|
|
||||||
After following these steps, three files `lightning_pb2.py`,
|
After following these steps, three files `lightning_pb2.py`,
|
||||||
@@ -53,7 +48,7 @@ extra steps (after completing all 6 step described above) to get the
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
lnd $ curl -o router.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/routerrpc/router.proto
|
lnd $ curl -o router.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/routerrpc/router.proto
|
||||||
lnd $ python -m grpc_tools.protoc --proto_path=googleapis:. --mypy_out=. --python_out=. --grpc_python_out=. router.proto
|
lnd $ python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. router.proto
|
||||||
```
|
```
|
||||||
|
|
||||||
### Imports and Client
|
### Imports and Client
|
||||||
|
|||||||
+1
-5
@@ -19,11 +19,7 @@ $ gem install grpc
|
|||||||
$ gem install grpc-tools
|
$ gem install grpc-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
Clone the Google APIs repository:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ git clone https://github.com/googleapis/googleapis.git
|
|
||||||
```
|
|
||||||
|
|
||||||
Fetch the `lightning.proto` file (or copy it from your local source directory):
|
Fetch the `lightning.proto` file (or copy it from your local source directory):
|
||||||
|
|
||||||
@@ -34,7 +30,7 @@ $ curl -o lightning.proto -s https://raw.githubusercontent.com/lightningnetwork
|
|||||||
Compile the proto file:
|
Compile the proto file:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ grpc_tools_ruby_protoc --proto_path googleapis:. --ruby_out=. --grpc_out=. lightning.proto
|
$ grpc_tools_ruby_protoc --ruby_out=. --grpc_out=. lightning.proto
|
||||||
```
|
```
|
||||||
|
|
||||||
Two files will be generated in the current directory:
|
Two files will be generated in the current directory:
|
||||||
|
|||||||
Reference in new issue
Block a user