substrate-contracts-node
substrate-contracts-node copied to clipboard
substrate-contracts-node does not produce blocks
When running substrate-contracts-node --dev no block is produced.
Only log line produced is:
2022-04-22 11:26:45 💻 Operating system: macos
2022-04-22 11:26:45 💻 CPU architecture: aarch64
2022-04-22 11:26:45 📦 Highest known block at #0
2022-04-22 11:26:45 〽️ Prometheus exporter started at 127.0.0.1:9615
2022-04-22 11:26:45 Listening for new connections on 127.0.0.1:9944.
2022-04-22 11:26:46 Accepted a new tcp connection from 127.0.0.1:59063.
2022-04-22 11:26:50 💤 Idle (0 peers), best: #0 (0x02ba…032a), finalized #0 (0x02ba…032a), ⬇ 0 ⬆ 0
2022-04-22 11:26:55 💤 Idle (0 peers), best: #0 (0x02ba…032a), finalized #0 (0x02ba…032a), ⬇ 0 ⬆ 0
2022-04-22 11:27:00 💤 Idle (0 peers), best: #0 (0x02ba…032a), finalized #0 (0x02ba…032a), ⬇ 0 ⬆ 0
2022-04-22 11:27:05 💤 Idle (0 peers), best: #0 (0x02ba…032a), finalized #0 (0x02ba…032a), ⬇ 0 ⬆ 0
2022-04-22 11:27:10 💤 Idle (0 peers), best: #0 (0x02ba…032a), finalized #0 (0x02ba…032a), ⬇ 0 ⬆ 0
Am I missing something?
@ceikit We switched to a consensus mechanism "menual seal" a while ago (in https://github.com/paritytech/substrate-contracts-node/pull/42). This was done so that there is no block time, but instead transactions are processed alsmost instantly. This is very handy for development and testing, but unsuitable for production.
It should still be possible to deploy and interact with contracts as normal, just faster. Did you run into any problems?
@cmichi thank you! my problem is that https://paritytech.github.io/contracts-ui/
shows Connection Error and cannot connect to Local Node, preventing contract deployment.
(I would assume then that I should not see any block produced in polkadot.js)

@cmichi it looks like it's an issue with the websocket:
2022-04-22 14:50:15 Blocked connection to WebSockets server from untrusted origin: Some("https://paritytech.github.io")
do you know how to allow the connection?
I've added --unsafe-ws-external to substrate-contracts-node command and Contract UI connects to LocalNode, but not sure this is the correct solution. (https://github.com/openethereum/parity-ethereum/issues/9678)
@ceikit this error happens when the local node is not ran in development mode. you need to run substrate-contracts-node --dev
. can you double check you do that?
also can you post your node version?
@statictype you are right, I guess the executable that we download from here https://github.com/paritytech/substrate-contracts-node/releases starts the node in Local Testnet
version 0.12.0-98a6757
@statictype I am running the pre-built binary (v15.0.1). I am not able to connect to the node via the Contracts UI.
When I open up the dev console, the only pertinent info I see is Content Security Policy: Upgrading insecure request ‘ws://localhost:9944/’ to use ‘wss’
On the other hand, I can connect via websocat ws://127.0.0.1:9944
, which the node accepts with Accepting new connection, 1/100
. The same accept does not occur when attempting to connect via the UI.
Thank you!
@smu160 I opened an issue about it https://github.com/paritytech/substrate-contracts-node/issues/79
In the meantime you can just execute ./substrate-contracts-node --dev
It would be very handy being able to configure this, as having blocks produced is useful for testing with indexers etc.
No idea why, but when I execute cargo run
the node does not want to start, at all. All I got:
tomek@rhei-box:~/ssd/workspaces/substrate-contracts-node$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.64s
Running `target/debug/substrate-contracts-node`
2022-10-09 19:42:37.698 INFO main sc_cli::runner: Substrate Contracts Node
2022-10-09 19:42:37.699 INFO main sc_cli::runner: ✌️ version 0.20.0-8d76d04faca
2022-10-09 19:42:37.699 INFO main sc_cli::runner: ❤️ by Parity Technologies <[email protected]>, 2021-2022
2022-10-09 19:42:37.699 INFO main sc_cli::runner: 📋 Chain specification: Development
2022-10-09 19:42:37.699 INFO main sc_cli::runner: 🏷 Node name: physical-glove-3120
2022-10-09 19:42:37.699 INFO main sc_cli::runner: 👤 Role: AUTHORITY
2022-10-09 19:42:37.699 INFO main sc_cli::runner: 💾 Database: RocksDb at /tmp/substrate1UmNVs/chains/dev/db/full
2022-10-09 19:42:37.699 INFO main sc_cli::runner: ⛓ Native runtime: substrate-contracts-node-100 (substrate-contracts-node-1.tx1.au1)
2022-10-09 19:43:16.139 INFO main sc_rpc_server: Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=None
2022-10-09 19:43:16.139 INFO main sc_rpc_server: Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=None
It is started. Read above. Blocks are produced on demand.