Reputation: 21
Anchor deploy Deploying workspace: http://localhost:8899 Upgrade authority: /home/tomcatzy/.config/solana/id.json Deploying program "basic-1"... Program path: /home/tomcatzy/projects/anchor/examples/tutorial/basic-1/target/deploy/basic_1.so... Error: RPC request error: cluster version query failed: error sending request for url (http://localhost:8899/): error trying to connect: tcp connect error: Connection refused (os error 111) There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
solana config set --url http://localhost:8899 (Is this enough to start the localhost ?) solana-keygen new solana-test-validator
It seems strange that after a succesful anchor build that i can't do a anchor deploy with the solana command lines ran above. If by any means 'need' to run a - npm init - then where to do it ?
solana config set --url http://localhost:8899 (Is this enough to start the localhost ?) solana-keygen new solana-test-validator
I tried the above and got generated a keypair: keyname_1-keypair.json. The build went succesful but the deploy not !
I'm wondering why not ?
Hopefully some can guide me what to get it succed...
Upvotes: 1
Views: 2813
Reputation: 1
You can deploy on-chain programs with the Solana tools.
To deploy a program, you will need the location of the program's shared object.
It will return when you run anchor build
in the command line.
Run solana program deploy <PROGRAM_FILEPATH>
.
Successful deployment will return the program id of your program.
Upvotes: -2
Reputation: 21
By following the Solana docs and doing this
sudo $(command -v solana-sys-tuner) --user $(whoami) > sys-tuner.log 2>&1 &
https://docs.solana.com/running-validator/validator-start#system-tuning
The test-ledger
folder is done and a sys-tuner.log
file is created but it's 0 bytes...
Then i run the solana-test-validator
in a separate terminal and the other solana config commands in another termianl then i get the following results ->
Upvotes: 1
Reputation: 8402
In a separate window / terminal, you need to run solana-test-validator
so that the tools can talk to your local network. The error you're seeing on deployment is due to an error on connecting to that network.
Upvotes: 1