Closed mahesh471978 closed 2 years ago
Thanks! This was super helpful
Thanks that's awesome! I'll leave this open until I get the chance to update the articles as well otherwise I'll forget haha. But thanks again that's much appreciated! 🍺
Hey Loris, it is me who should say thanks for this awesome article you wrote, I gone through many documentations to learn solana development, and I am sure this is best of all.
This article is better than anchor's own documentation. (Actually, I think solana people should pay you for this, as I am sure this article is starting point for atleast 100 solana developer).
And I am glad you replied. 🙂
@lorisleiva I was trying both implementations but I get some errors. I went to the new docs and I did this:
require!(topic.chars().count() <= 50, ErrorCode::TopicTooLong);
require!(content.chars().count() <= 280, ErrorCode::ContentTooLong);
Now I can retrieve the messages in the test and frontend. No idea why this is working and the solution above it doesn't.
Thanks so much for this tutorial, is the best I found to learn Anchor/Solana. :)
I added this implementation and I can't run the test for just send tweet.
When running the test for just the send tweet test (with no asserts) I get the error:
"Error: 4100: The declared program id does not match the actual program id"
I'm on a new mac and have two terminals open: Terminal 1: solana-test-validator --no-bpf-jit --reset Terminal 2: anchor test --skip-local-validator
I added this implementation and I can't run the test for just send tweet.
When running the test for just the send tweet test (with no asserts) I get the error:
"Error: 4100: The declared program id does not match the actual program id"
I'm on a new mac and have two terminals open: Terminal 1: solana-test-validator --no-bpf-jit --reset Terminal 2: anchor test --skip-local-validator
Ignore this comment I wrote earlier.
I found the issue. I accidentally copied the lib.rs file from the github link because I had a bunch of compile errors since Solana made some changes. I then applied what was in the github diff.
Through this I kept the program_id aka the "declare_id" from the original github link via the article instead of switching it with my own.
As a reminder, you get this program_id from the article: https://lorisleiva.com/create-a-solana-dapp-from-scratch/getting-started-with-solana-and-anchor
More precisely, in the article you get the program_id via: solana address -k target/deploy/solana_twitter-keypair.json
@silvestrevivo I had some issues with errors once when upgrading Anchor too. It was due to Anchor changing the index in which custom errors start. If your Anchor version on the Rust program didn't match the Anchor version used on the frontend then you'd have a mismatch. Not sure if this is what happened to you but hopefully that helps. 😊
Articles updated, thank you! ❤️
@lorisleiva ah thanks so much! that's something that I should test.
Hi Loris, few anchor attributes are changed since you wrote this article, reference of which are given below.