我正在尝试将一些程序部署到我当地的 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)
我将使用本教程 https://smith-mcf.medium.com/a-simple-solana-dapp-tutorial-6dedbdf65444
当我使用. 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
当我localhost:8899
在 chrome 中运行时,响应“不允许使用使用的 HTTP 方法。需要 POST 或 OPTIONS”
我需要说我对 docker 完全是新手,但教程需要它。