DEV Community

Cover image for Accelerated Guide to Fullstack Web3 with ASS (Anchor, Solana, and Svelte) 🍑

Accelerated Guide to Fullstack Web3 with ASS (Anchor, Solana, and Svelte) 🍑

0xMuse on January 20, 2022

In this tutorial, you'll learn how to build from scratch a fullstack Web3 dApp with the ASS stack - the hottest Solana tech stack! You do not need...
Collapse
 
proto133 profile image
Peter Roto

Thank you for taking the time to write this, I am trying to get more familiar with Solana developing and I feel like this is helping.

That being said, for some reason everything works great on localhost, until I go to post a 3rd 'gm' message. In the console I get:

Transaction simulation failed: Error processing Instruction 0: custom program error: 0xbbc
 Program <ADDRESS> invoke [1]
    Program log: Instruction: SayGm
    Program log: Custom program error: 0xbbc
    Program <ADDRESS> consumed 7067 of 200000 compute units
    Program <ADDRESS> failed: custom program error: 0xbbc
Enter fullscreen mode Exit fullscreen mode

Any ideas what's going on here?

Collapse
 
0xmuse profile image
0xMuse

Hi, yes, the space allocated for the base account in the original exampe was too small, I updated it to 64+1024. Thanks for pointing this out.

Collapse
 
chidam333 profile image
Chidam

Yeah lol i was doing 64+64+64+64+64

Collapse
 
chidam333 profile image
Chidam • Edited

I think the problem is that we are not allocating enough space to the new wallet ! i.e 64+64 i think I am facing similar issue

Collapse
 
tuncatunc profile image
tuncatunc

Hi All,
it is really usefull using @project-serum/anchor in a web app.
I also need to interact with tokens using, @solana/spl-token.
to get the account info

import { TOKEN_PROGRAM_ID, getAssociatedTokenAddress, getAccount } from "@solana/spl-token";

...

const tokenAccountInfo = await getAccount(
      connection,
      tokenAccount
    )
Enter fullscreen mode Exit fullscreen mode

I got following error

D5Nh1z3zUSRZpMRe8Sug26oBJYZ3G5kocBs7qqwMNnZC
bigint.mjs:10 Uncaught (in promise) ReferenceError: Buffer is not defined
    at Blob.bigIntLayout.decode (bigint.mjs:10:27)
    at Structure.decode (Layout.js:1067:40)
    at getAccount (account.mjs:46:38)
    at async swapTokens (App.svelte:91:44)
Enter fullscreen mode Exit fullscreen mode

I tried to polyfill using rollup-plugin-node-polyfills in rollup.config.js without success.

Thank you!

Collapse
 
chidam333 profile image
Chidam

vartalap-dapp.vercel.app
This is an amazing tutorial do follow it !

Collapse
 
coreystevens profile image
Corey

Good stuff! Really good at explaining it!!

Collapse
 
0xmuse profile image
0xMuse

Glad you like it! :D

Collapse
 
ramgariaz profile image
Manpreet Singh • Edited

Thanks for this tutorial, I have learnt alot from this, but what to add in existing account input (a program account or a payer account), what if I want to use the existing program on the solana blockchain, how can I achieve that. I am new to this I have implemented it successfully, but now I want to use the existing program from the solana blockchain on the devnet.

If I use program account of existing program from devnet, it gives me this error:
"Uncaught (in promise) Error: Invalid account discriminator"

I am using ReactJs as frontend.
Thanks

Collapse
 
blockdev1 profile image
block-dev1 • Edited

Hey thanks for this awesome tutorial. But I ran in to error. "Provider' only refers to a type, but is being used as a value here." but I have imported the Provider from @project-serum/anchor, any suggestions?

Collapse
 
sokirill profile image
Kirill

Thanks for this, I reposted it in official Svelte reddit with attribution to this article. Hope its oke!

Collapse
 
0xmuse profile image
0xMuse

Hi, cool! Could you link me to it?

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀

After the colapse of FTX project serum should not be trusted thus you can follow the instructions here to setup anchor
anchor-lang.com/docs/installation