We Are Going To Discuss About The transaction declared chain ID 5777, but the connected node is on 1337. So lets Start this Python Article.
The transaction declared chain ID 5777, but the connected node is on 1337
- How to solve The transaction declared chain ID 5777, but the connected node is on 1337
Had this issue myself, apparently it's some sort of Ganache CLI error but the simplest fix I could find was to change the network id in Ganache through settings>server to 1337. It restarts the session so you'd then need to change the address and private key variable.
If it's the same tutorial I'm doing, you're likely to come unstuck after this… the code for transaction should be:transaction = SimpleStorage.constructor().buildTransaction( { "gasPrice": w3.eth.gas_price, "chainId": chain_id, "from": my_address, "nonce": nonce, }) print(transaction)
Otherwise you get a value error if you don't set the gasPrice - The transaction declared chain ID 5777, but the connected node is on 1337
Had this issue myself, apparently it's some sort of Ganache CLI error but the simplest fix I could find was to change the network id in Ganache through settings>server to 1337. It restarts the session so you'd then need to change the address and private key variable.
If it's the same tutorial I'm doing, you're likely to come unstuck after this… the code for transaction should be:transaction = SimpleStorage.constructor().buildTransaction( { "gasPrice": w3.eth.gas_price, "chainId": chain_id, "from": my_address, "nonce": nonce, }) print(transaction)
Otherwise you get a value error if you don't set the gasPrice
Solution 1
Had this issue myself, apparently it’s some sort of Ganache CLI error but the simplest fix I could find was to change the network id in Ganache through settings>server to 1337. It restarts the session so you’d then need to change the address and private key variable.
If it’s the same tutorial I’m doing, you’re likely to come unstuck after this… the code for transaction should be:
transaction =
SimpleStorage.constructor().buildTransaction( {
"gasPrice": w3.eth.gas_price,
"chainId": chain_id,
"from": my_address,
"nonce": nonce,
})
print(transaction)
Otherwise you get a value error if you don’t set the gasPrice
Original Author Jamie Di Cataldo Of This Content
Solution 2
this line of code is wrong
chain_id = 5777
Ganache chain id is not 5777. This is network id. Network id is used by nodes to transfer data between nodes that are on the same network. Network id is not included in blocks and it is not used for signing transactions or mining blocks.
chain_id = 1377
Chain ID is not included in blocks either, but it is used during the transaction signing and verification process.
Original Author Yilmaz Of This Content
Solution 3
It works for me, I get value chain_id from w3.eth.chain_id
transaction = SimpleStorage.constructor().buildTransaction(
{
"gasPrice": w3.eth.gas_price,
"chainId": w3.eth.chain_id,
"from": my_address,
"nonce": nonce,
}
)
Delegates to eth_chainId RPC Method
Returns an integer value for the currently configured “Chain Id” value introduced in EIP-155. Returns None if no Chain Id is available.
Original Author Visal SUOS Of This Content
Solution 4
Hey it happened to me too, you need to build the constructor like this
SimpleStorage.constructor().buildTransaction( {
“gasPrice”: w3.eth.gas_price,
“chainId”: chain_id,
“from”: my_address,
“nonce”: nonce,
You need to add the gas price part.
Worked for me
Original Author PaulB Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.