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

Error FieldCountNotMatch when trying to open a channel #492

Open
Flouse opened this issue Jan 18, 2025 · 0 comments
Open

Error FieldCountNotMatch when trying to open a channel #492

Flouse opened this issue Jan 18, 2025 · 0 comments

Comments

@Flouse
Copy link
Contributor

Flouse commented Jan 18, 2025

Description

I am experiencing an issue while attempting to open a channel.

// Function to open a Fiber channel
async function openFiberChannel() {
  try {
    const response = await fetch(FIBER_RPC_URL, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'open_channel',
        params: [
          {
            // "/ip4/139.180.143.139/tcp/8228/p2p/QmdTjTyN9QZ93QwqKw1tEpeTcKCQPvFkbDquwWtAoa3Yod"
            peer_id: 'QmdTjTyN9QZ93QwqKw1tEpeTcKCQPvFkbDquwWtAoa3Yod',
            funding_amount: '0x174876E800', // 1000 CKB
          }
        ]
      })
    })

    const result = await response.json()
    console.log('Channel opened successfully:', result)
    return result
  } catch (error) {
    console.error('Error opening channel:', error)
    throw error
  }
}

RPC returns temporary_channel_id and the Funding transaction is successfully confirmed -> 0x5473726f6beda6d948d5e7010cca46a8078d5944d559c5d46f4190ec10e24e0d

{
  jsonrpc: '2.0',
  result: {
    temporary_channel_id: '0x92dcfe887081480faaa347142b1ac38a740da2093ab36995429b8431bfbe5411'
  },
  id: 1
}

While the fnn logs the error:

fiber-testnet-node  |   2025-01-18T14:44:10.808992Z  INFO fnn::fiber::channel: Trying to open a channel to PeerId(QmdTjTyN9QZ93QwqKw1tEpeTcKCQPvFkbDquwWtAoa3Yod)
fiber-testnet-node  |     at src/fiber/channel.rs:2124
fiber-testnet-node  |     in ractor::actor::Actor with id: "0.13", name: "Channel-1 QmPX4gorKbiWYazA4byg9mEsJFj3rLWVUDSorH2cfAExZu <-> QmdTjTyN9QZ93QwqKw1tEpeTcKCQPvFkbDquwWtAoa3Yod"
fiber-testnet-node  |     in ractor::actor::Actor with id: "0.2", name: "Network QmPX4gorKbiWYazA4byg9mEsJFj3rLWVUDSorH2cfAExZu"
fiber-testnet-node  | 
fiber-testnet-node  |   2025-01-18T14:45:30.433915Z  INFO fnn::fiber::network: Funding transaction Byte32(0x5473726f6beda6d948d5e7010cca46a8078d5944d559c5d46f4190ec10e24e0d) confirmed
fiber-testnet-node  |     at src/fiber/network.rs:2804
fiber-testnet-node  | 
fiber-testnet-node  |   2025-01-18T14:45:32.327241Z ERROR fnn::fiber::network: parse message: Molecule(FieldCountNotMatch("ReestablishChannelReader", 3, 4))
fiber-testnet-node  |     at src/fiber/network.rs:3370

list channel

{
  "channel_id": "0x540b71aa6152441d49aa543a482dcb51c9c73bb1a9ed3dab7d0f5b240dcbefc6",
  "is_public": true,
  "channel_outpoint": "0x5473726f6beda6d948d5e7010cca46a8078d5944d559c5d46f4190ec10e24e0d00000000",
  "peer_id": "QmdTjTyN9QZ93QwqKw1tEpeTcKCQPvFkbDquwWtAoa3Yod",
  "funding_udt_type_script": null,
  "state": {
    "state_name": "AWAITING_CHANNEL_READY",
    "state_flags": "OUR_CHANNEL_READY | THEIR_CHANNEL_READY"
  },
  "local_balance": "0x15d6ea6a00",
  "offered_tlc_balance": "0x0",
  "remote_balance": "0x0",
  "received_tlc_balance": "0x0",
  "latest_commitment_transaction_hash": "0x5c0f7ea760d9b9ff3448fdfc616e18ea74b2191f59b862cbc50c82f3bbe1cace",
  "created_at": "0x19479df15b9"
},

Environment

  • Fiber Node Version: v0.3.0
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