I am trying to deploy some program to my local solana and im stuck on this
-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
When I use . 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)
> [email protected] 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"
I need to say im totally newbie about docker but the tutorial was requiring it.
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. The easiest solution is to downgrade to @solana/web3.js version 0.78.2 to keep following the tutorial.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With