Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[open_channel] funding_amount not eq tx.capacity #253

Closed
gpBlockchain opened this issue Oct 19, 2024 · 1 comment
Closed

[open_channel] funding_amount not eq tx.capacity #253

gpBlockchain opened this issue Oct 19, 2024 · 1 comment

Comments

@gpBlockchain
Copy link
Contributor

node1 ckb :19999999999.99998976 (CKB)

  1. open channel("funding_amount": 19999999999 * 10)
curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "open_channel",
    "params": [
        {
            "peer_id": "QmYduVLcpSNvJnCvhsCVD83xbFcjwSF42ydiYkAC5qN8k6",
            "funding_amount": "0x1158e4608d8353600",
            "public": true
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"temporary_channel_id": "0xdd90b57b169d7c163f40287d238668642fdd38ca700afe3ecb7902745f666964"}, "id": 42}

  1. wait channel CHANNEL_READY

  2. query list_channels

curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "list_channels",
    "params": [
        {
            "peer_id": "QmYduVLcpSNvJnCvhsCVD83xbFcjwSF42ydiYkAC5qN8k6"
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"channels": [{"channel_id": "0xe03ec0c18a0855e6801b2a01faf6b7b64a5bf192fc679134f1ba31e1ee8a0b19", "peer_id": "QmYduVLcpSNvJnCvhsCVD83xbFcjwSF42ydiYkAC5qN8k6", "funding_udt_type_script": null, "state": {"state_name": "CHANNEL_READY", "state_flags": []}, "local_balance": "0x1158e460766a8b800", "offered_tlc_balance": "0x0", "remote_balance": "0x0", "received_tlc_balance": "0x0", "created_at": "0x624cf445ee6e2"}]}, "id": 42}

  1. graph_channels
curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "graph_channels",
    "params": [
        {}
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"channels": [{"channel_outpoint": "0x32c287cf27d6ec5912acf1908f754b3404641d1ec07e1bd097fe507302fdca6000000000", "funding_tx_block_number": "0x26", "funding_tx_index": "0x0", "node1": "0252b887472edc3eaf55d6c1030e4d4866d91009f970c04344d52efea7f8b9711c", "node2": "02ee29d7f6cb1152adc29ebdbf7bfefb9a28cea479fc5a2d79643f32a4276ce791", "last_updated_timestamp": "0x192a3a729fb", "created_timestamp": 1729322494450, "node1_to_node2_fee_rate": "0x3e8", "node2_to_node1_fee_rate": "0x3e8", "capacity": "0x1158e460a49c1b400", "chain_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "udt_type_script": null}], "last_cursor": "0x6032c287cf27d6ec5912acf1908f754b3404641d1ec07e1bd097fe507302fdca6000000000"}, "id": 42}

8.get open channel capacity(1553255931490448384)

curl --location 'http://127.0.0.1:8114' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "get_transaction",
    "params": [
        "0x32c287cf27d6ec5912acf1908f754b3404641d1ec07e1bd097fe507302fdca60"
    ]
}'

{"jsonrpc":"2.0","result":{"cycles":"0x339d38","fee":null,"min_replace_fee":null,"time_added_to_pool":null,"transaction":{"cell_deps":[{"dep_type":"dep_group","out_point":{"index":"0x0","tx_hash":"0xa611f41952574b8a200465b2281d17bc1196a878e31f206857ee3d20925d5795"}}],"hash":"0x32c287cf27d6ec5912acf1908f754b3404641d1ec07e1bd097fe507302fdca60","header_deps":[],"inputs":[{"previous_output":{"index":"0x1","tx_hash":"0xf51ac16e1e683522295d62355145f0316b5f06c799d01bfdf31f71d4d792547f"},"since":"0x0"},{"previous_output":{"index":"0xe","tx_hash":"0x8924295bde0c8224f3e7324729e70121d91bac34ca763b8fd283905feb75b9fa"},"since":"0x0"}],"outputs":[{"capacity":"0x158e460a49c1b400","lock":{"args":"0x33eb894c195e0fa0411f5247d81d6dd311d9a0ad","code_hash":"0x03ae445d1bec9930ba5d9c77a0c2110c0f7e5fa504e7343dc13d9aaa8649cfcb","hash_type":"data1"},"type":null},{"capacity":"0x6332752d2574fc7","lock":{"args":"0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7","code_hash":"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8","hash_type":"type"},"type":null},{"capacity":"0x736f6310aa09da1","lock":{"args":"0x470dcdc5e44064909650113a274b3b36aecb6dc7","code_hash":"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8","hash_type":"type"},"type":null}],"outputs_data":["0x","0x","0x"],"version":"0x0","witnesses":["0x5500000010000000550000005500000041000000b92bdfac4739a1934cf63ec07b4e9f739fa20e8ec1d29d911c17e7cb445dd069027597f298b5f13d7edf09e0f1c9e7312d078440b301dcca1207122d36f4275401","0x55000000100000005500000055000000410000004a59dea94b15f54c468b251927c09b01555db91294207e1381257a21fb70a1664e9d88d55f62766105669f1b2931968a878dd79e317cd3641cbb5dcc07e408d200"]},"tx_status":{"block_hash":"0x7c256b92e879e5ee269cfc3124947c9b0357ec963f816ab3c12e6a650f9dc0b0","block_number":"0x26","reason":null,"status":"committed","tx_index":"0x1"}},"id":42}

expected : open channel failed

log :
node.log

@gpBlockchain
Copy link
Contributor Author

#256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant