bitcoin-dev-project / sim-ln

Payment activity generator for the lightning network
MIT License
64 stars 27 forks source link

Installation instructions needs to mention protobuf as a requirement #198

Open zealsham opened 3 weeks ago

zealsham commented 3 weeks ago

Describe the bug when trying to build sim-cli , i ran into an issue where the build process panicked because i did not have the protoc binary installed on my device

failed to run custom build command for cln-grpc v0.1.6

Caused by:
  process didn't exit successfully: /Users/shammah/sim-ln/target/release/build/cln-grpc-a808399b7e9d80ba/build-script-build (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=proto/node.proto
  cargo:rerun-if-changed=proto

  --- stderr
  thread 'main' panicked at /Users/shammah/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-build-0.11.9/src/lib.rs:1457:10:
  Could not find protoc installation and this build crate cannot proceed without
      this knowledge. If protoc is installed and this crate had trouble finding
      it, you can set the PROTOC environment variable with the specific path to your
      installed protoc binary.You could try running brew install protobuf or downloading it from https://github.com/protocolbuffers/protobuf/releases

  For more information: https://docs.rs/prost-build/#sourcing-protoc

  note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile sim-cli v0.1.0 (/Users/shammah/sim-ln/sim-cli), intermediate artifacts can be found at /Users/shammah/sim-ln/target.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

it would ease the installation process if the installation instructions mentions something like , "make sure protobuf is installed on your device "

i can push a Pr if you sim-ln devs agree with this suggestion

carlaKC commented 3 weeks ago

A PR with instructions would be great, thank you!

zealsham commented 2 weeks ago

so i went on a mission to install sim-ln on linux , windows and macos for this task . However on m1 mac i'm running into an issue that i spent a couple of days trying to resolve and i could not .

After starting a local network with Polar and running sim-cli with a test configuration , i get the following error

[hyper::client::client] Connection is HTTP/1, but request requires HTTP/2
Error: Get info error: status: Unknown, message: "request has unsupported HTTP version", details: [], metadata: MetadataMap { headers: {} }

which implies i am sending a HTTP/1 connection instead of HTTP/2 which LND supports over it's REST interface . what could be the cause of this . is there a way to force only HTTP/2 connection from sim-cli ?

zealsham commented 2 weeks ago

i also want to add that i am able to query LND rest interface using curl with no problem

curl -k --header "Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 /Ulnd/alice/data/chain/bitcoin/regtest/admin.macaroon)" \
--cacert /networks/1/volumes/lnd/alice/tls.cert \
https://127.0.0.1:8081/v1/getinfo

which i proxied via burp suite and confirmed that even though i'm using htpp/1.1 , the request goes through as expected

carlaKC commented 2 weeks ago

which implies i am sending a HTTP/1 connection instead of HTTP/2 which LND supports over it's REST interface . what could be the cause of this . is there a way to force only HTTP/2 connection from sim-cli ?

Sim-ln uses grpc to connect to LND, so you'll need to point it to ther rpcserver port not the rest one 👍