[英]Unable to get the RPC URL to connect MetaMask, When running multiple nodes on single machine in substrate
在基板上運行多個節點時,無法獲取正確的 RPC URL 以連接到 MetaMask 錢包
ChainId:運行時為 421
Output:
節點 1:
2022-07-27 14:32:35 〽️ Prometheus exporter started at 127.0.0.1:9615
2022-07-27 14:32:35 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=Some(["http://localhost:", "http://127.0.0.1:", "https://localhost:", "https://127.0.0.1:", "https://polkadot.js.org"])
2022-07-27 14:32:35 Running JSON-RPC WS server: addr=127.0.0.1:9945, allowed origins=Some(["http://localhost:", "http://127.0.0.1:", "https://localhost:", "https://127.0.0.1:", "https://polkadot.js.org"])
節點 2:
2022-07-27 14:32:56 Running JSON-RPC HTTP server: addr=127.0.0.1:9934, allowed origins=Some(["http://localhost:", "http://127.0.0.1:", "https://localhost:", "https://127.0.0.1:", "https://polkadot.js.org"])
2022-07-27 14:32:56 Running JSON-RPC WS server: addr=127.0.0.1:9946, allowed origins=Some(["http://localhost:", "http://127.0.0.1:", "https://localhost:", "https://127.0.0.1:", "https://polkadot.js.org"])
2022-07-27 14:32:56 creating instance on iface 192.168.22.183
在終端 1生成節點 1(命令)的步驟:
./target/release/frontier-template-node
--base-path /tmp/alice
--chain local
--alice
--port 30333
--ws-port 9945
--rpc-port 9933
--node-key 0000000000000000000000000000000000000000000000000000000000000001
--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0'
--validator
終端 2 上的節點 2(命令):
./target/release/frontier-template-node
--base-path /tmp/alice
--chain local
--alice
--port 30333
--ws-port 9945
--rpc-port 9933
--node-key 0000000000000000000000000000000000000000000000000000000000000001
--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0'
--validator
從提供的信息中很難知道“無法獲得正確的 RPC URL 以連接到 MetaMask 錢包”是什么意思。
但是根據您提供的命令,您不能使用相同的端口在單台機器上運行多個節點,也不應該使用相同的基本路徑來運行多個節點。 這將使兩個節點都寫入數據庫,並且它不知道其他進程也在寫入同一個文件。 相反,這是您應該嘗試的命令:
運行第一個節點
./target/release/frontier-template-node
--base-path /tmp/mynode/alice
--chain local
--alice
--port 3033
--ws-port 9945
--rpc-port 9933
--node-key 0000000000000000000000000000000000000000000000000000000000000001
--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0'
--validator
運行第二個節點
./target/release/frontier-template-node
--base-path /tmp/mynode/bob
--chain local
--bob
--port 3034
--ws-port 9944
--rpc-port 9934
--node-key 0000000000000000000000000000000000000000000000000000000000000001
--telemetry-url 'wss://telemetry.polkadot.io/submit/ 0'
--validator
注意運行兩個節點時端口值和基本路徑的變化。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.