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

substrate-contracts-node does not produce blocks #50

Closed
ceikit opened this issue Apr 22, 2022 · 10 comments
Closed

substrate-contracts-node does not produce blocks #50

ceikit opened this issue Apr 22, 2022 · 10 comments

Comments

@ceikit
Copy link

ceikit commented Apr 22, 2022

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?

@cmichi
Copy link
Contributor

cmichi commented Apr 22, 2022

@ceikit We switched to a consensus mechanism "menual seal" a while ago (in #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?

@ceikit
Copy link
Author

ceikit commented Apr 22, 2022

@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)

image

@ceikit
Copy link
Author

ceikit commented Apr 22, 2022

@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. (openethereum/parity-ethereum#9678)

@statictype
Copy link
Contributor

statictype commented Apr 22, 2022

@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?

@ceikit
Copy link
Author

ceikit commented Apr 22, 2022

@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

@smu160
Copy link

smu160 commented May 18, 2022

@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!

@statictype
Copy link
Contributor

@smu160 I opened an issue about it #79
In the meantime you can just execute ./substrate-contracts-node --dev

@boyswan
Copy link

boyswan commented Jul 28, 2022

It would be very handy being able to configure this, as having blocks produced is useful for testing with indexers etc.

@TomaszWaszczyk
Copy link

TomaszWaszczyk commented Oct 9, 2022

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 <admin@parity.io>, 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  

@athei
Copy link
Member

athei commented Oct 9, 2022

It is started. Read above. Blocks are produced on demand.

@athei athei closed this as completed Oct 9, 2022
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

7 participants