example-helloworld | Hello world on Solana | Blockchain library
kandi X-RAY | example-helloworld Summary
kandi X-RAY | example-helloworld Summary
This project demonstrates how to use the Solana Javascript API to interact with programs on the Solana blockchain.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of example-helloworld
example-helloworld Key Features
example-helloworld Examples and Code Snippets
Community Discussions
Trending Discussions on example-helloworld
QUESTION
I am currently trying to learn on writing programs for Solana and interacting with those.
I am using the example-helloworld code. In order to interact with the helloworld program, the nodejs code creates an account with seed:
...ANSWER
Answered 2022-Mar-28 at 18:12When creating an account with createAccount
, you must provide a signature from that new account. So in your case, greetedPubkey
must be a Keypair
, just like payer
. You can do:
QUESTION
I am trying to understand the solana/example-helloworld
by re-writing the rust lib myself. I have done this and from the package.json file, to generate the .so
file, following is what is run:
ANSWER
Answered 2022-Feb-28 at 11:09.so file are signifies solana files, right?
so
stand for shared object, also known as a dynamically relocatable library or dylib
in Cargo.toml.
What do we mean by cargo build-bpf?
BPF is a virtual machine inside the kernel, so this should instruct cargo to build for that target.
Is there any reason, why 2021 edition didn't work for the solana example?
I don't know, but I suspect it's a simple fix.
Finally, why does the above command not output my .so file?
Could it be that you are missing the lib section in Cargo.toml:
QUESTION
I'm a beginner Rust/Solana Developer and wanted to ask if someone knows how to send a spl-token from an account when the account receives a SOL?
I read the https://docs.solana.com/ but i could not find anything about SPL transfers.
Example of Smart Contract: https://github.com/solana-labs/example-helloworld
Example:
Acc1 sends 0.1 SOL to a address and for that Acc1 receives 1 SPL-TOKEN from that address.
Simple explanation: I need a minting website for a token.
I would really appreciate some help, thanks!
...ANSWER
Answered 2022-Jan-06 at 02:48You can send SPL-Tokens by using CPI on the token program's transfer instruction.
For example:
QUESTION
I have successfully deploy the BPF and run the client on the Solana hello world example: https://github.com/solana-labs/example-helloworld. The greeted counter in the program also works as expected.
Then, I tried to inspect the transactions using Solana Explorer pointing to localhost. I can see the transactions that I made on the program's transaction history, but after few minutes (1.5-3.5 minutes), if I refresh the page, those transactions is missing.
I've tried to create my own hello program but the transaction is disappeared after few minutes in the history. I also did a simple solana transfer, but it still same.
I did search on google about this problem, but I can't find any good information. I know the state is not a problem (because the solana balance and the data contained in hello world program is correct), so I suspect the problem is from Solana Explorer, but then I tried solana transaction-history
on my cli. And same as before, the transaction appeared and disappeared.
So now, I suspect that solana-test-validator
remove the transaction history from ledger. But, I found that the test-ledger
is growing (last time I check is 10gb).
I'm still not sure why the transaction history is missing and how to fix it, so I can inspect the transactions that I and the program make. It will make my on-chain program development easier. Thanks!
...ANSWER
Answered 2022-Jan-04 at 05:40This can be confusing. The default ledger size for solana-test-validator
is very small, so you'll lose transactions very quickly. You can use the --limit-ledger-size
argument to make it bigger. More information from -h
:
QUESTION
I am trying to run Solana rust hello world example locally (https://github.com/solana-labs/example-helloworld). I went through the readme but the step "Start local Solana cluster" (https://github.com/solana-labs/example-helloworld#start-local-solana-cluster) is not working for me. I am receiving thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', validator/src/bin/solana-test-validator.rs:294:71
error.
My solana-test-validator version is 1.7.9
This is my config.yml
file:
ANSWER
Answered 2021-Aug-04 at 10:38I solved it with installing a stable version like this: sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
QUESTION
does anyone know why introducing a simple line like "Pubkey::new_unique()" inside https://github.com/solana-labs/example-helloworld/blob/master/src/program-rust/src/lib.rs#L22 will make the program fail?
...ANSWER
Answered 2021-Jun-24 at 22:29The implementation of that function uses global data. Programs cannot use global data
QUESTION
I am attempting to run the HelloWorld solana program. I have cloned this repo. I have started the project with
...ANSWER
Answered 2021-May-20 at 19:31A couple things to make sure of:
- The localhost (as opposed to devnet) is set via
solana config set --url localhost
- You have generated a new keypair
solana-keygen new
QUESTION
It seems, that I cannot exclude the JBoss/ Wildfly Logging Subsystem.
I have an Java EE ear and would like to use slf4j API together with log4J2 Implementation.
My intention was to disable JBoss logging subsystem to let my slf4j log4j2 implementation handle the logging. But I still get duplicate handling of stdout:
12:55:00,820 INFO [stdout] (Thread-316) 12:55:00 INFO
the ear structure is as follows:
...ANSWER
Answered 2020-Jul-08 at 15:06If you want to use log4j-core, the log4j2 log manager implementation, in your deployment with slf4j you'll need to include the correct dependencies in your deployment which you appear to be doing.
You'll then need to tell WildFly to not add the logging dependencies to your deployment. The following options will exclude the logging dependencies from being added to your deployment
- Use a
jboss-deployment-structure.xml
to exclude the logging subsystem
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install example-helloworld
Install node (v14 recommended)
Install npm
Install Rust v1.56.1 or later from https://rustup.rs/
Install Solana v1.8.14 or later from https://docs.solana.com/cli/install-solana-cli-tools
There is both a Rust and C version of the on-chain program, whichever is built last will be the one used when running the example.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page