Code Monkey home page Code Monkey logo

solana-example-helloworld's People

Contributors

dzadmin avatar jsoneaday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

solana-example-helloworld's Issues

QUESTION: how to add custom props/fields to the GreetingAccount struct?

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.

Can't find node modules and dist file

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.