简体   繁体   English

在本地主机上将程序部署到 solana 的问题

[英]Problem with deploying program to solana on localhost

I am trying to deploy some program to my local solana and im stuck on this我正在尝试将一些程序部署到我本地的 solana 并且我坚持这个

    -vote-tutorial
> babel-node src/client/deploy_simplest.js

Deploying...
(node:11063) Warning: N-API is an experimental feature and could change at any time.
Our account: Bfoj2PiwU4qvgHbdiQ7AysM4jKVQD73NF9GdwqMs7yzw
Connection to cluster established: http://localhost:8899 { 'feature-set': 2068214666, 'solana-core': '1.3.15' }
-----
Estimated cost to program load: 407338560  lamports ( 0.40733856 ) Sol
ProgramAccount: Axx1mNZpXBSuHqRYv6Bt6r5H5aKMALH8SuWEs9VNJawJ
Error: failed to get recent blockhash: Error: failed to get recent blockhash: Invalid params: unknown variant `finalized`, expected one of `max`, `recent`, `root`, `single`, `singleGossip`.
    at Connection.getRecentBlockhash (/home/radoslaw/applications/blockchain/simple-vote-tutorial/node_modules/@solana/web3.js/src/connection.js:2363:13)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

I am going with this tutorial https://smith-mcf.medium.com/a-simple-solana-dapp-tutorial-6dedbdf65444我将使用本教程https://smith-mcf.medium.com/a-simple-solana-dapp-tutorial-6dedbdf65444

When I use . start_docker当我使用. start_docker . start_docker

. start_docker

Starting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/root/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell: 
# eval $(docker-machine env default)

> simplevotetutorial@0.0.1 localnet:up /home/radoslaw/applications/blockchain/simple-vote-tutorial
> set -x; solana-localnet down; set -e; solana-localnet up

+ solana-localnet down
Docker version 20.10.7, build f0df350
++ docker ps --filter 'name=^/solana-localnet$' -q
+ [[ -n '' ]]
+ set -e
+ solana-localnet up
Docker version 20.10.7, build f0df350
+ RUST_LOG=solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=info,solana_bpf_loader=debug,solana_bpf_loader_program=info,solana_rbpf=trace
+ ARGS=(--detach --name solana-localnet --rm --publish 8001:8001/tcp --publish 8899:8899/tcp --publish 8900:8900/tcp --publish 8901:8901/tcp --publish 8902:8902/tcp --publish 9900:9900/tcp --publish 8000:8000/udp --publish 8001:8001/udp --publish 8002:8002/udp --publish 8003:8003/udp --publish 8004:8004/udp --publish 8005:8005/udp --publish 8006:8006/udp --publish 8007:8007/udp --publish 8008:8008/udp --tty --ulimit "nofile=700000" --env "RUST_LOG=$RUST_LOG")
+ [[ -n '' ]]
+ docker run --detach --name solana-localnet --rm --publish 8001:8001/tcp --publish 8899:8899/tcp --publish 8900:8900/tcp --publish 8901:8901/tcp --publish 8902:8902/tcp --publish 9900:9900/tcp --publish 8000:8000/udp --publish 8001:8001/udp --publish 8002:8002/udp --publish 8003:8003/udp --publish 8004:8004/udp --publish 8005:8005/udp --publish 8006:8006/udp --publish 8007:8007/udp --publish 8008:8008/udp --tty --ulimit nofile=700000 --env RUST_LOG=solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=info,solana_bpf_loader=debug,solana_bpf_loader_program=info,solana_rbpf=trace solanalabs/solana:v1.3.15
b3e960613b640aedba3b35d18be03a4e327bab9296bd4e1dba59c0802bd1aecf
+ for _ in 1 2 3 4 5
+ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' http://localhost:8899
curl: (52) Empty reply from server
+ sleep 1
+ for _ in 1 2 3 4 5
+ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' http://localhost:8899
{"jsonrpc":"2.0","result":0,"id":1}
+ break

When I run localhost:8899 in chrome there is response "Used HTTP Method is not allowed. POST or OPTIONS is required"当我在 Chrome 中运行localhost:8899 ,出现响应“不允许使用 HTTP 方法。需要 POST 或 OPTIONS”

I need to say im totally newbie about docker but the tutorial was requiring it.我需要说我是关于 docker 的新手,但教程需要它。

It appears that you're using a mix of new and old unfortunately.不幸的是,您似乎正在使用新旧混合。 The error that you're seeing:您看到的错误:

Error: failed to get recent blockhash: Invalid params: unknown variant `finalized`, expected one of `max`, `recent`, `root`, `single`, `singleGossip`.

is because you're using a newer version of @solana/web3.js with a very old version of the network.是因为您使用的是较旧版本的网络的@solana/web3.js 的较新版本。 The easiest solution is to downgrade to @solana/web3.js version 0.78.2 to keep following the tutorial.最简单的解决方案是降级到 @solana/web3.js 版本 0.78.2 以继续遵循教程。

Separately, there are a lot of newer tools for local development.另外,还有许多用于本地开发的较新工具。 If you're using a new version of the network and SDK, there's a binary called solana-test-validator ( https://docs.solana.com/developing/test-validator ) which is much easier than developing against Docker.如果您使用的是新版本的网络和 SDK,则有一个名为solana-test-validator ( https://docs.solana.com/developing/test-validator ) 的二进制文件,它比针对 Docker 进行开发要容易得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 golang 应用程序部署到 kubernetes 时出现问题 - Problem deploying golang app to kubernetes 使用 gitlab-ci 部署无服务器时出现问题 - Problem while deploying serverless with gitlab-ci 在 Heroku 上部署 Docker 图像时出现问题(反应应用程序) - Problem on deploying Docker image on Heroku (react app) 将 blazor 服务器应用程序部署到 Kubernetes 时出现问题 - Problem with deploying blazor server app to Kubernetes 让docker不要让程序将端口绑定到localhost - Have docker not let a program bind a port to localhost Docker 上的本地主机有“冲突的服务器名称”问题 - Localhost on Docker Has "conflicting server name" Problem Docker Tomcat映像:部署WAR文件时Umlaute编码出现问题 - Docker Tomcat Image: Encoding problem with Umlaute when deploying WAR file 将我的 ktor 应用程序部署到 docker 时运行问题。jar 文件 - Problem running .jar file while deploying my ktor application to docker 部署应用程序时出错:Get http://localhost:8080/api: dial tcp [::1]:8080: connectex: - Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connectex: 无法从Dockerized节点程序连接到Localhost Mongodb - Unable to Connect From Dockerized Node Program to Localhost Mongodb
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM