[英]Not able to deploy solana smart contract over devnet
I have followed below steps to deploy my smart contract over solana de.net but i am facing Blockhashed Expired: 5 retries remaining.我已按照以下步骤在 solana de.net 上部署我的智能合约,但我面临 Blockhashed Expired:剩余 5 次重试。
I have followed below steps to deploy my smart contract over solana de.net but i am facing Blockhashed Expired: 5 retries remaining.我已按照以下步骤在 solana de.net 上部署我的智能合约,但我面临 Blockhashed Expired:剩余 5 次重试。
solana-keygen new --outfile solana/my_wallet.json --force solana-keygen new --outfile solana/my_wallet.json --force
solana config set --url de.net solana 配置集 --url de.net
solana airdrop 2 0xxx.... 0xxxx [and get sufficient balance upto 10 sol] solana airdrop 2 0xxx.... 0xxxx [并获得足够的余额高达 10 sol]
anchor build锚构建
solana address -k target/deploy/my-keypair.json solana地址-k target/deploy/my-keypair.json
Copy programId and updated my Anchor.toml file as well as Lib.rs file [declare_id]复制 programId 并更新我的 Anchor.toml 文件以及 Lib.rs 文件 [declare_id]
Set cluster and programs to de.net in Anchor.toml file在 Anchor.toml 文件中将集群和程序设置为 de.net
anchor build锚构建
I updated programId in idl file as well.我也更新了 idl 文件中的 programId。
anchor deploy --provider.cluster de.net anchor deploy --provider.cluster de.net
How to resolve this issue?如何解决这个问题?
this might be one issue这可能是一个问题
solana address -k target/deploy/my-keypair.json solana地址-k target/deploy/my-keypair.json
file name should include your contract name.文件名应包括您的合同名称。 this is the syntax
这是语法
yourContractName-keypair.json
you should also add this to anchor.toml
你还应该将它添加到
anchor.toml
cluster = "de.net" wallet = "./my_wallet.json"
It looks like you're using the Public RPC.看起来您正在使用公共 RPC。 One possible cause of this issue is that the public de.net RPC is overloaded.
此问题的一个可能原因是公共 de.net RPC 过载。
You might want to try a private RPC.您可能想尝试私有 RPC。 You can try using a service like Quicknode , which has private Solana de.net RPCs and a free tier you can use for this purpose.
您可以尝试使用像Quicknode这样的服务,它具有私有的 Solana de.net RPC 和可用于此目的的免费套餐。
Then, once you have the URL to your private node, you use:然后,一旦你将 URL 连接到你的私有节点,你就可以使用:
solana config set --url https://quicknode.com.....{insertrestofurl}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.