p2pderivatives / rust-dlc

Rust library for working with Discreet Log Contracts
MIT License
138 stars 36 forks source link

running sample errors #192

Closed kevkevinpal closed 7 months ago

kevkevinpal commented 9 months ago

I tried running the sample but ran into a few issues


1). When trying to start alice with her configuration I had a SSL cert issue but it seemed this website's certificate was expired https://oracle.p2pderivatives.io/

I resolved this by running https://github.com/p2pderivatives/p2pderivatives-oracle locally


2). After starting up alice and bob I ran this command to try and send offer offercontract 024b5bc3c328d92fdf30421093b214b4099b78617e9195afd2106f444b670c731d@127.0.0.1:9000 ./examples/contracts/numerical_contract_input.json

I ran into this error

> offercontract 024b5bc3c328d92fdf30421093b214b4099b78617e9195afd2106f444b670c731d@127.0.0.1:9000 ./examples/contracts/numerical_contract_input.json
Checking for messages
connecting to peer 024b5bc3c328d92fdf30421093b214b4099b78617e9195afd2106f444b670c731d
ERROR: Peer disconnected before we finished the handshake
thread 'tokio-runtime-worker' panicked at sample/src/cli.rs:203:38:
Error sending offer: InvalidParameters("Unknown oracle public key")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at sample/src/cli.rs:216:22:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(27), ...)

I then tried using the connectpeer command but then got this error

> connectpeer 024b5bc3c328d92fdf30421093b214b4099b78617e9195afd2106f444b670c731d@localhost:9000
Checking for messages
ERROR: Peer disconnected before we finished the handshake

Now I am stuck at this point any guidance would be helpful, I can also open a PR for any changes I need to make to run the sample successfully for anyone in the future

kevkevinpal commented 9 months ago

its probably good to add that I'm running on a 2019 Macbook pro

Tibo-lg commented 8 months ago

Finally found the cause of the connection issue, will be pushing a PR to fix everything soonish.

Tibo-lg commented 8 months ago

Unfortunately I found another issue within LDK which prevents running the sample properly. Will need to wait for https://github.com/lightningdevkit/rust-lightning/pull/2832 to be merged and a new release of LDK.