jsoneaday / solana-example-helloworld Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
First of all, awesome tutorial.
I'm experimenting with the example hello world solana chain app, and I want to add a another field/property to the GreetingAccount struct but I can't seem to get it to work. I'm new to solana/rust so I think I'm just not understanding something about either or both.
Here's what I want to do:
/// Define the type of state stored in accounts
#[derive(BorshSerialize, BorshDeserialize, Debug)]
pub struct GreetingAccount {
/// number of greetings
pub counter: u64,
/// add this new field
pub counter2: u32,
}
I want to add that new counter2 field so I can figure out how to add new fields and use them in the on-chain program.
I think it has something to do with the BorshDeserialize try_from_slice
method.
The error when I run the the rust tests is:
---- test::test_sanity stdout ----
Account Data len(): [0, 0, 0, 0]
thread 'test::test_sanity' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "Unexpected length of input" }', src/lib.rs:89:18
So it looks like I need to match the size but the weird thing is the account was created, shouldn't the size being deserialized work out-of-the-box?
I'm studying up on some rust as I'm new to it as we speak.
why src/client is empty can you help me
After downloading the zip folder for this project unable to see dist file and node modules. Though I tried installing solana on my windows but it's not installing so I want to use a Virtual Machine(VM) to use Ubuntu on my windows by downloading the ISO file of Ubuntu, the CLI I downloaded for Ubuntu is saying a package something needed that means a Virtual Machine not found in my system that's why I downloaded a virtual box for me to complete the installation after restarting my system on downloading WSL through command prompt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.