ttytm
anchor-solana-twitter
TypeScript

Web3 application on the Solana blockchain written in Rust (Anchor). A Twitter like, decentralized communication platform.

Last updated Jul 11, 2024
11
Stars
2
Forks
1
Issues
0
Stars/day
Attention Score
2
Language breakdown
TypeScript 53.5%
Rust 46.5%
โ–ธ Files click to expand
README

anchor-solana-twitter

Extends and refactors the [v1-branch][10].

Changes

  • Votings are their own accounts using PDAs, instead of just updating a counter on an existing tweet
- enables to filter votings for a user - less costs for sending a vote - the rating counter on tweets becomes obsolete, which results in slimmer tweet accounts
  • Direct messages are separate accounts instead of being a tweet
- less cost on for dms - recipient on tweet account becomes obsolete
  • Comment functionality
  • Users can create aliases
  • New api syntax for tests
- abandon deprecated .rpc in favor of .methods syntax

Running

The installation of the prerequisites to run an anchor program is nicely explained in the [anchor book][20].

With the prerequisites out of the way, npm i installs the rest of the dependencies.

Then building and running the tests can be done with anchor test.

To use the tests while working on a frontend run the localnet with anchor localnet.
In another terminal airdrop your wallet some SOL and load the test solana airdrop 1000 <YourPhantomWalletPubKey> && anchor run test.

Tested Functionalities

โฏ anchor test

tweets โœ” can send and update tweets โœ” can send a tweet without a tag โœ” cannot send a tweet without content โœ” cannot send a tweet with a tag > 50 or content > 280 characters โœ” cannot update a tweet without changes โœ” can delete own tweets โœ” can fetch and filter tweets

comments โœ” can comment and update comments โœ” can delete comments

votings โœ” can vote and update votings โœ” can derive tweets from votings

direct messages โœ” can send and update dms โœ” can delete dms โœ” can fetch and filter dms

user alias โœ” can create and update a user alias โœ” can delete a user alias

status โœ” can set a status message with up to 50 characters โœ” can delete a status message

reactions โœ” can react on tweets and update and delete reactions โœ” cannot send other then predefined reactions

Frontend Showcase

To showcase the functionalities of this app you can check out a frontend implementation using SvelteKit on https://twitter-with-ass.vercel.app/ - WIP

[10]: https://github.com/tobealive/anchor-solana-twitter/tree/v1 [20]: https://book.anchor-lang.com/getting_started/installation.html

ยฉ 2026 GitRepoTrend ยท ttytm/anchor-solana-twitter ยท Updated daily from GitHub