p2pderivatives / rust-dlc

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

listsignedchannels is empty #217

Closed h10086733 closed 4 months ago

h10086733 commented 4 months ago

/home/qiyun/project/rust-dlc/target/debug/sample ./examples/configurations/bob.yml Node public key: 03fe3b2cb4e2c4579c9bdb546767285f76532f8794447ba145183d0d072fa4b4be DLC node startup successful. To view available commands: "help". DLC logs are available at /.dlc/logs

offerchannel 0324a7aaa5bb8dbc36d38082cd99a0464800c8ff5b8216675277d19a36fb291a61@127.0.0.1:9000 ./examples/contracts/numerical_contract_input.json Checking for messages ERROR: failed to connect to peer offerchannel 0324a7aaa5bb8dbc36d38082cd99a0464800c8ff5b8216675277d19a36fb291a61@127.0.0.1:9000 ./examples/contracts/numerical_contract_input.json Checking for messages SUCCESS: connected to peer 0324a7aaa5bb8dbc36d38082cd99a0464800c8ff5b8216675277d19a36fb291a61 listsignedchannels Checking for messages listsignedchannels Checking for messages

/home/qiyun/project/rust-dlc/target/debug/sample ./examples/configurations/alice.yml Node public key: 0324a7aaa5bb8dbc36d38082cd99a0464800c8ff5b8216675277d19a36fb291a61 DLC node startup successful. To view available commands: "help". DLC logs are available at /.dlc/logs

listchanneloffers Checking for messages Processing message from 03fe3b2cb4e2c4579c9bdb546767285f76532f8794447ba145183d0d072fa4b4be get_tx_input_infos tx id: 567a4dc3715c17a4a25385d01bb53cf990e65840214e27e36a276d22b9c0f682 get_tx_input_infos tx id: ac33576cb5fe4a8ef0c60378f9f7b02a83cfa0e00d8d839be0ccb66a0efb6b87 Offer channel "7cdc6ba20541b53608263cdda7da18395a94c899d15bb0be03d620d76f88e05f" from 03fe3b2cb4e2c4579c9bdb546767285f76532f8794447ba145183d0d072fa4b4be listchanneloffers Checking for messages Offer channel "7cdc6ba20541b53608263cdda7da18395a94c899d15bb0be03d620d76f88e05f" from 03fe3b2cb4e2c4579c9bdb546767285f76532f8794447ba145183d0d072fa4b4be acceptchannel 7cdc6ba20541b53608263cdda7da18395a94c899d15bb0be03d620d76f88e05f Checking for messages create cet tx:1048576 adaptor generate_sign :1048576 generate dlc trie: threshold:1 , nb_oracles:1 , min_nb_digits:20,base:2 accept channel end

Bob executes listsignedchannels to query alice acceptchannel. Is the list empty? I also executed it normally ../ Scripts/generatebocks.sh. Can you help me answer this?

Tibo-lg commented 4 months ago

I'm not sure I understand your issue, but try pressing enter a couple of time in each terminal to make sure all messages are properly processed. I tried on my side but didn't have any issue.

h10086733 commented 4 months ago

I have made multiple attempts, and when Bob executes the offer channel 0324a7aaa5bb8dbc36d38082cd99a0464800c8ff5b8216675277d19a36fb291a61@127.0.0.1 9000/ examples/contracts/numerical_contract_input.json

I can use listchanneloffers in Alice to find the corresponding channel offers, but after Alice executes acceptchannel xxx, Bob executes listsignedchannels and discovers any contracts. But when Alice executed acceptchannel xx again, she already indicated an unknown contract

Can you help explain the contract execution path? Can I have more information or documents to gain a deeper understanding of the project?

h10086733 commented 4 months ago

I now want to implement a simple DLC contract to lock in user funds and release them linearly at a certain time in the future. But I found that the status update code for the contract was not executed. How to trigger the linear release process of event event not found. Why is it a fixed 7-day period, including when I found reflund_locktime? If the amount returned after 7 days is the pledged amount, where did I deduct the amount paid during the process?

Tibo-lg commented 4 months ago

Can you help explain the contract execution path? Can I have more information or documents to gain a deeper understanding of the project?

You can maybe check here for an overview of the protocol: https://github.com/Tibo-lg/dlcspecs-1/blob/dlc-channels/Protocol.md#channel

Why is it a fixed 7-day period, including when I found reflund_locktime? If the amount returned after 7 days is the pledged amount, where did I deduct the amount paid during the process?

I'm not sure I understand you question, but the 7 days period is a hard coded value that enables refund after contract maturity if the oracle does not release a signature. If the oracle does release a signature you can close the channel/contract.

h10086733 commented 4 months ago

https://github.com/Tibo-lg/dlcspecs-1/blob/dlc-channels/images/dlc_channel_establish_ta.svg
All of my contract statuses have been stuck in the offered contract, and I confirm that I have executed them/ scripts/generate_blocks.sh. In the sample instance, I set a future eventId btcusd1716798725. Do I need to do anything extra when my oracle releases a signature?