
{"id":57863,"date":"2025-04-09T06:28:22","date_gmt":"2025-04-09T06:28:22","guid":{"rendered":"https:\/\/mycryptomania.com\/?p=57863"},"modified":"2025-04-09T06:28:22","modified_gmt":"2025-04-09T06:28:22","slug":"learning-solana-as-a-seasoned-ethereum-developer-part-2","status":"publish","type":"post","link":"https:\/\/mycryptomania.com\/?p=57863","title":{"rendered":"Learning Solana as a Seasoned Ethereum Developer (Part 2)"},"content":{"rendered":"<p>Gather round the campfire as I regale you with part 2 of my series about learning Solana with many years of Ethereum development under my\u00a0belt.<\/p>\n<p>In <a href=\"https:\/\/medium.com\/p\/527cb9e0372d\"><strong>Part 1<\/strong><\/a> we had a high-level discussion about the rationale behind upskilling in Solana, the difference between the two ecosystems as a new dev, and some first impressions (both good and bad). I didn\u2019t get too deep into anything technical, and it was really intended as a jumping off\u00a0point<\/p>\n<p>In this article, I\u2019ll discuss the dev environment in more detail and some things that feel different when coming from the Ethereum perspective. The purpose of these articles is to give Eth devs an idea of what to expect if they\u2019re considering making the\u00a0jump.<\/p>\n<p>Photo by <a href=\"https:\/\/unsplash.com\/@waguluz_?utm_source=medium&amp;utm_medium=referral\">Andreas Wagner<\/a> on\u00a0<a href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\">Unsplash<\/a><\/p>\n<h3>Local Setup<\/h3>\n<p>There are a few options when it comes to Eth dev tools and environment, but for me I like to use <a href=\"https:\/\/www.npmjs.com\/package\/ganache\"><strong>Ganache<\/strong><\/a> for my local chain when doing frontend stuff and <a href=\"https:\/\/hardhat.org\/\"><strong>Hardhat<\/strong><\/a><strong> <\/strong>for my dev framework. Any machine with nodejs installed can get these up in no time, and then I can dive straight into the contract\u00a0code.<\/p>\n<p>I mention my specific setup because my experiences with Solana will naturally be compared to\u00a0it.<\/p>\n<p>From the solana.com <a href=\"https:\/\/solana.com\/docs\/intro\/installation\"><strong>getting started page<\/strong><\/a>, the Solana dev environment has a couple more dependencies, but all are pretty simple to install\u00a0too.<\/p>\n<p>Rust, Solana CLI and Anchor CLI, as well as NodeJS and Yarn which you may already have installed. There\u2019s a few extra steps if you\u2019re on Windows, but blindly following the instructions here should at least get your dev environment up and\u00a0running.<\/p>\n<h4>Networks<\/h4>\n<p>The first thing that stood out to me is the choice of different networks (or lack thereof!). In Eth we are generally accustomed to being able to arbitrarily hook up any network to whatever we are working with as long as we have the RPC url. This includes various L2s, testnets, or even multiple instances of our local\u00a0chain.<\/p>\n<p>Everything in the Solana ecosystem seems to be built around only their Mainnet, the two testnets, and occasionally a <em>single <\/em>instance of a local network, without the expectation that anything else is possible. In practice for me this doesn\u2019t really matter, as I\u2019m not intending on building an L2 and the only projects I\u2019ve needed multiple Ganache instances for was when I was developing multi-chain stuff, but it was a bit of a shift in perspective to something that felt a bit <em>on-rails<\/em>.<\/p>\n<p>There are a few other little quirks of the Solana CLI which felt slightly off in the same way that browsing a supermarket in a foreign country can be slightly uncanny, but overall you get used to it pretty\u00a0quick.<\/p>\n<p>I will say that getting testnet SOL is a breath of fresh air after the hoops required to get any sort of EVM testnet ETH. For the latter you usually need to have some sort of Mainnet balance and create some sort of account\/make a social media post just to use a faucet. There may be reasons for this but its just an extra frustrating hurdle especially for those of us who keep our dev accounts and our real accounts well separated.<\/p>\n<p>To get SOL on a testnet, you just point the CLI at the network you want to use, then type solana airdrop X (where X is the amount you want). So much\u00a0simpler.<\/p>\n<p>No more annoying faucets for me\u00a0:\u00a0)<\/p>\n<h3>Accounts<\/h3>\n<p>One of the biggest brain stretches you are going to need to do moving from Eth to Solana is around accounts. I could probably write a whole article about the differences in the way accounts and data are managed between the two and the impacts that has on design considerations, but I think for this article we can cover most of the technical differences.<\/p>\n<p>Firstly, to an extent, <em>everything<\/em> is an account. There is of course the normal relationship between private keys and accounts that you are familiar with. However, it gets a little weird because accounts with keys can also hold data or smart contract (<em>program<\/em>) code.<\/p>\n<p>In ETH, when you deploy a contract, the address of the deployed contract is either derived from the deployer address or deterministically derived from certain parameters. In Solana, you actually generate a private key and deploy the contract to the address associated with that private key. Perhaps even stranger is that you can change code that has already been deployed, (the holy grail of the smart contract dev who doesn\u2019t unit test properly!).<\/p>\n<p>There is much more to be said on accounts but I will save this for a future article as this one is just supposed to be about the differences in dev environments. But like everything, this is something you get used\u00a0to.<\/p>\n<h3>Rust<\/h3>\n<p>Of course, in an article about the Solana dev environment, we need to at least mention Rust. You are most likely aware that unlike Eth smart contracts, Solana programs are written in Rust (or C apparently, but I have no experience with the latter). I don\u2019t really consider myself an expert in evaluating the pros and cons of one language vs another, and beyond the natural biases of preferring a language I have close to a decade of experience working with, Rust was pretty easy to adapt\u00a0to.<\/p>\n<p>I did find certain restrictions around naming with regard to case-systems a little annoying to deal with, however I\u2019m not actually sure if this is a constraint of Rust or just my compiler settings. But there are a <em>lot<\/em> of Rust fans out there, and I\u2019m sure they exist for a\u00a0reason.<\/p>\n<p>I should note that when initially coming to Solana dev, I briefly looked into <a href=\"https:\/\/solana.com\/news\/solang-solana-solidity-evm\">Solang<\/a>, a compiler that lets you write programs in Solidity and converts them to Rust, but given that it still compiles down to Rust, everything else in the ecosystem is Rust-based, and even the rest of your stack will be biased towards Rust-based programs unless you really wanna customise it, it seemed like just upskilling in Rust was the move. To be honest, I don\u2019t regret\u00a0it.<\/p>\n<h3>Anchor<\/h3>\n<p>The last big-picture part of the environment that needs to be mentioned is Anchor. To a certain extent, Anchor is analogous to Hardhat. It gives you a nice little framework to write, compile and test programs easily. However, unlike Hardhat, it also adds additional functionality within your Rust programs, as well as giving us the Solana equivalent of the ABI (the\u00a0IDL).<\/p>\n<p>I\u2019m not actually sure what Solana dev would look like without Anchor, so I can\u2019t say for sure how much heavy lifting it has done, but it seems like it\u2019s doing some critical\u00a0work.<\/p>\n<p>I mentioned in the previous article that when I first started Solidity dev, nothing like this existed. In a time before Hardhat and Truffle we kinda had to hack our own stuff together, and despite giving a baptism by fire which forced you to have a little more familiarity with things like the Solidity compiler you were using, it was really more of a barrier to development than a blessing.<\/p>\n<p>So Anchor is definitely a testament to the more well developed sides of the Solana dev ecosystem. There are some concerning issues regarding tests and the local test network, but we won\u2019t be touching that\u00a0today.<\/p>\n<h3>Front-end<\/h3>\n<p>I won\u2019t go into too much detail on this now, but one thing that I found very lacking was the ecosystem regarding the frontend of our programs. As a full-stack web3 dev, I can\u2019t just write nice contract code and then sling it off to some other dev and hope it comes out okay, it\u2019s important that from top-to-bottom everything comes together. I don\u2019t even like web dev, but a job worth doing is worth doing\u00a0well.<\/p>\n<p>That\u2019s why it was disappointing to see how React-centric some of the Solana frontend dev ecosystem is. I will probably say this many times in this series, but React is a terrible framework to use for web3 projects. Yes, it\u2019s basically too-big-to-fail at this point, but please do yourself a favour and use something like <a href=\"https:\/\/svelte.dev\/\"><strong>Svelte<\/strong><\/a>. Do not make the first decision you make (ie picking a framework) be the one that saddles you with the most unappreciated tech debt for your\u00a0project.<\/p>\n<p>We will litigate this further in a future article, but every time I see someone fighting against their own code to make a web3 project work \u201cwell\u201d in React I die a little\u00a0inside.<\/p>\n<h3>Next Steps<\/h3>\n<p>If I have piqued your interest thus far, I\u2019d probably direct you to the quick-start page of the <a href=\"https:\/\/solana.com\/docs\/intro\/quick-start\"><strong>Solana.com docs<\/strong><\/a>. If you have a conscious or implicit Eth dev preference you may have to push through a few moments of \u201cWTF? This is dumb.\u201d but I\u2019d say it\u2019s worth indulging your curiosity.<\/p>\n<p>I\u2019m not sure exactly what the next article in this series will focus on, but the next logical step feels like digging into some actual code and design pattern differences.<\/p>\n<p>I guess you\u2019ll have to stay tuned to find\u00a0out.<\/p>\n<p>Photo by <a href=\"https:\/\/unsplash.com\/@sunnystate?utm_source=medium&amp;utm_medium=referral\">Reuben Juarez<\/a> on\u00a0<a href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\">Unsplash<\/a><\/p>\n<p>Find me\u00a0on:<\/p>\n<p><a href=\"https:\/\/bsky.app\/profile\/anallergytoanalogy.bsky.social\"><strong>Bluesky<\/strong><\/a><a href=\"https:\/\/x.com\/cashtagyolo\"><strong>Twitter<\/strong><\/a><a href=\"https:\/\/github.com\/AnAllergyToAnalogy\"><strong>GitHub<\/strong><\/a><\/p>\n<p><a href=\"https:\/\/medium.com\/coinmonks\/learning-solana-as-a-seasoned-ethereum-developer-part-2-42fb49706c90\">Learning Solana as a Seasoned Ethereum Developer (Part 2)<\/a> was originally published in <a href=\"https:\/\/medium.com\/coinmonks\">Coinmonks<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>","protected":false},"excerpt":{"rendered":"<p>Gather round the campfire as I regale you with part 2 of my series about learning Solana with many years of Ethereum development under my\u00a0belt. In Part 1 we had a high-level discussion about the rationale behind upskilling in Solana, the difference between the two ecosystems as a new dev, and some first impressions (both [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-57863","post","type-post","status-publish","format-standard","hentry","category-interesting"],"_links":{"self":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/57863"}],"collection":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57863"}],"version-history":[{"count":0,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/57863\/revisions"}],"wp:attachment":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}