我正在尝试实现这个押注程序,但我不知道如何部署它,我必须先部署这个程序吗?
这是最前沿的:
https://github.com/SmartCodeBlockchainDev/Nelson-NFT-stacking-frontend
以及相关的程序:
https://github.com/SmartCodeBlockchainDev/Nelson-NFT-stacking
我要做以下几点:
我创建了一个锚项目:
anchor init staking --javascript然后我在里面输入/编程https://github.com/SmartCodeBlockchainDev/Nelson-NFT-stacking/tree/335688dfffb08e0920c394c835aa0afa29a85574内容
我试图构建(anchor build),但是它给了我以下错误:
未能阅读\staking\programs\*\Cargo.toml和
Caused by: El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del volumen no son correctos. (os error 123)这是:
Failed to obtain package metadata: `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\?\C:\staking\programs\*`发布于 2022-04-11 18:42:03
为了与程序进行交互,必须将其部署到网络中。例如,如果您试图使用血清,则必须将血清程序部署到某个地方,无论是testnet、devnet、mainnet-beta,甚至是本地网络。
程序有一个在代码:https://github.com/SmartCodeBlockchainDev/Nelson-NFT-stacking/blob/335688dfffb08e0920c394c835aa0afa29a85574/src/lib.rs#L9中声明的id https://github.com/SmartCodeBlockchainDev/Nelson-NFT-stacking/blob/335688dfffb08e0920c394c835aa0afa29a85574/src/lib.rs#L9。
不幸的是,这个程序还没有部署在任何网络上:https://explorer.solana.com/address/7zR41kNXcdLoyj3yDgEZVmEPR1euvRkrFW1jSqR1Y7ri,您可以看到,因为帐户中有0 SOL。部署的程序将提供更多信息,例如帐户中的所有者和SOL:https://explorer.solana.com/address/SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy。
要部署程序,您需要:
sh -c "$(curl -sSfL https://release.solana.com/v1.10.8/install)"npm i -g @project-serum/anchor-clianchor buildanchor deploy有关在https://docs.solana.com/cli/deploy-a-program部署程序和在https://project-serum.github.io/anchor/cli/commands.html上部署Anchor命令的更多信息
发布于 2022-04-17 13:15:33
首先,发生错误是因为cargo.toml文件没有指向程序的工作区。解决这一问题的一种简单方法是在根目录上运行锚init,将初始的src文件夹复制到程序文件夹内由锚init生成的文件夹中。
https://stackoverflow.com/questions/71801349
复制相似问题