solana-foundation / developer-content

Collection of Developer content for exploring, learning, and building in the Solana ecosystem.
https://solana.com/developers
81 stars 95 forks source link

init_if_needed may not be required here [CRUD App Tutorial] #231

Open adlonymous opened 4 weeks ago

adlonymous commented 4 weeks ago

Problem

Re: content/guides/dapps/journal.md [The CRUD app tutorial] while defining the account for creating a journal entry, init_if_needed is one of the account constraints, which I don't think is needed and I'm not really sure the feature flag is included when using create-solana-dapp

Proposed Solution

Just include init instead of init_if_needed in the code snippet

adlonymous commented 4 weeks ago

Using init_if_needed also throws an error which is probably because it hasn't been explicitly imported. This error is solved by using init instead

adlonymous commented 4 weeks ago

Also, new version of create-solana-dapp requires Anchor 0.30.0. Would be incredibly useful if the tutorial had a note in the beginning stating the required versions of Anchor and Solana CLI