Quickly develop, deploy and test Solana programs from the browser.

Overview

Solana Playground

SolPg allows you to quickly develop, deploy and test Solana programs(smart contracts) from the browser.

Note

You can open an issue to request more creates.

Contributing

Anyone is welcome to contribute to Solana Playground no matter how big or small.

License

SolPg is licensed under GPL 3.0.

Comments
  • AbiExample could not find `log` in the list of imported crates

    AbiExample could not find `log` in the list of imported crates

    I got this error in vscode

    solana_frozen_abi_macro
    proc_macro AbiExample
    failed to resolve: could not find `log` in the list of imported crates
    could not find `log` in the list of imported cratesrustc[E0433](https://doc.rust-lang.org/error-index.html#E0433)
    conflicting implementations of trait `solana_frozen_abi::abi_example::AbiExample` for type `program::vote::authorized_voters::AuthorizedVoters`
    conflicting implementation in crate `solana_frozen_abi`:
    - impl<T> AbiExample for T;rustc[E0119](https://doc.rust-lang.org/error-index.html#E0119)
    

    and also this error while build solana-client

    fox:solana-client katopz$ cargo build
       Compiling rand v0.7.3
       Compiling zeroize v1.3.0
       Compiling sha2 v0.9.9
       Compiling borsh v0.9.3
       Compiling curve25519-dalek v3.2.1
       Compiling libsecp256k1 v0.6.0
       Compiling ed25519-dalek v1.0.1
       Compiling ed25519-dalek-bip32 v0.2.0
       Compiling solana-program v1.11.0
       Compiling solana-sdk v1.11.0
       Compiling solana-extra-wasm v1.11.0-alpha (/Users/katopz/git/katopz/solana-playground/wasm/utils/solana-extra)
    error[E0433]: failed to resolve: could not find `log` in the list of imported crates
     --> utils/solana-extra/src/program/vote/authorized_voters.rs:7:72
      |
    7 | #[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample)]
      |                                                                        ^^^^^^^^^^ could not find `log` in the list of imported crates
      |
      = note: this error originates in the derive macro `AbiExample` (in Nightly builds, run with -Z macro-backtrace for more info)
    

    not sure what i miss, anyway what's rust version you have there?

    wasm 
    opened by katopz 7
  • UI & UX improvement to provide `Deploy Program Tx Hash` and `Upgrade Program Tx Hash`

    UI & UX improvement to provide `Deploy Program Tx Hash` and `Upgrade Program Tx Hash`

    Currently, the UI Console only displays Deployment Successful once the program is deployed and Deploy Program Tx Hash: in the Developer Console.

    It will be great to have the Tx Hash displayed on the UI Console as well, making it easy to spot the Tx on the explorer for the dev.

    terminal deploy 
    opened by mryalamanchi 5
  • Deployement Error

    Deployement Error

    failed to send transaction: Transaction simulation failed: Error processing Instruction 0: account data too small for instruction

    let clock = clock::Clock::get()?; msg!("clock: {:#?}", clock);

    Program deployed successfully, when i remove the above lines of code.

    It works in localhost, problem with devnet.

    deploy 
    opened by vijay-kesanakurthi 4
  • Tiny adventure two

    Tiny adventure two

    Second tutorial which lets the developer give out sol to reward the players.

    Would be super cool, if you or some anchor developer you know could review the program so that I am not teaching something wrong.

    I asked a few people I know already and they said it makes sense how it is. But just to be sure.

    Also do you think this is still easy or rather medium?

    opened by Woody4618 4
  • Docker for api

    Docker for api

    Did we have Docker for api for local implement?

    I think we can add Run capability for simple client/helloworld.rs rust client that interact with program we already deploy. I know this may be out of scope of this project but what we have here is pretty close to rust's playground+solana create already.

    FYI: I just having fun playing around here so feel free to say no. :)

    opened by katopz 4
  • [Feature Request] Code snippet sharing

    [Feature Request] Code snippet sharing

    Just riffing with the idea of code snippet sharing on SolPg.

    • Share code snippets with a shortened URL, makes sharing small PoCs easier for devs.
    • Have an option to import the code from a git repo like GitHub (May cause an issue with Anchor.toml, Cargo.toml file imports)
    • Have an option to export the files from SolPg into a compressed package.
    explorer 
    opened by mryalamanchi 4
  • This account may not be used to pay transaction fees

    This account may not be used to pay transaction fees

    This account may not be used to pay transaction fees image

    use anchor_lang::prelude::*; use anchor_lang::solana_program::entrypoint::ProgramResult;

    declare_id!("CLvLTsZ8seZ6E19b2FSA4B1BrumUatXiSe2RmDvbtG41");

    #[program] pub mod crowdfunding { use super::*; pub fn create(ctx: Context, name: String, description: String) -> ProgramResult { let campaign = &mut ctx.accounts.campaign; campaign.name = name; campaign.description = description; campaign.amount_donated = 0; campaign.current_balance = 0; campaign.admin = *ctx.accounts.user.key; Ok(()) } pub fn withdraw(ctx: Context, amount: u64) -> ProgramResult { let campaign = &mut ctx.accounts.campaign; let user = &mut ctx.accounts.user; if campaign.admin != *user.key { return Err(ProgramError::IncorrectProgramId); } let rent_balance = Rent::get()?.minimum_balance(campaign.to_account_info().data_len());

        if **campaign.to_account_info().lamports.borrow() - rent_balance < amount {
            println!("Not enough funds");
            return Err(ProgramError::InsufficientFunds);
        }
    
        **campaign.to_account_info().try_borrow_mut_lamports()? -= amount;
        campaign.current_balance -= amount;
    
        **user.to_account_info().try_borrow_mut_lamports()? += amount;
        println!(
            "Current balance {}",
            **campaign.to_account_info().try_borrow_mut_lamports()?
        );
        Ok(())
    }
    
    pub fn donate(ctx: Context<Donate>, amount: u64) -> ProgramResult {
        let ix = anchor_lang::solana_program::system_instruction::transfer(
            &ctx.accounts.user.key(),
            &ctx.accounts.campaign.key(),
            amount,
        );
    
        anchor_lang::solana_program::program::invoke(
            &ix,
            &[
                ctx.accounts.user.to_account_info(),
                ctx.accounts.campaign.to_account_info(),
            ],
        );
        (&mut ctx.accounts.campaign).amount_donated += amount;
        (&mut ctx.accounts.campaign).current_balance += amount;
        Ok(())
    }
    

    } #[derive(Accounts)] pub struct Create<'info> { #[account( init, payer=user, space=9000, seeds =[b"CAMPAIGN_DEMO".as_ref(), user.key().as_ref()], bump )] pub campaign: Account<'info, Campaign>, #[account(mut)] pub user: Signer<'info>, pub system_program: Program<'info, System>, } #[derive(Accounts)] pub struct Withdraw<'info> { #[account(mut)] pub campaign: Account<'info, Campaign>, #[account(mut)] pub user: Signer<'info>, } #[derive(Accounts)] pub struct Donate<'info> { #[account(mut)] pub campaign: Account<'info, Campaign>, #[account(mut)] pub user: Signer<'info>, pub system_program: Program<'info, System>, } #[account] pub struct Campaign { pub admin: Pubkey, pub name: String, pub description: String, pub amount_donated: u64, pub current_balance: u64, } //3S9nB8j5Jod3tP74uWXKcyn1UeTSF2qykqsrTpEDNonf

    image

    Instruction index: 0 Reason: Cross-program invocation with unauthorized signer or writable account.

    test 
    opened by lingfan 3
  • Add Counter PDA Tutorial - Easy

    Add Counter PDA Tutorial - Easy

    I have created a Counter PDA Tutorial for the Solana Playground. This will be an easy tutorial to get a better understanding of accounts, PDAs, and how basic operations work on Solana Anchor Programs.

    Is designed to be an introductory tutorial, where the user will have to fill the gaps in functions following the instructions from the pages of the tutorial.

    opened by cleon30 3
  • Add Alchemy Devnet RPC Endpoint

    Add Alchemy Devnet RPC Endpoint

    Hey there! Ajay from the Alchemy team. Given our new Solana support, I added the latest Alchemy devnet public RPC Url for Solana. Pls let me know if there are any questions, appreciate what you guys are doing at SOL Playground :) I'm definitely using your product for our tutorials!

    opened by avasisht23 3
  • Update seahorse to latest commit, which includes a wasm fix

    Update seahorse to latest commit, which includes a wasm fix

    • Update Seahorse to the latest current commit. This is pre-release, but fixes the issue that stopped it compiling in wasm
    • Slight change to lib.rs because the compile signature has changed a bit. We pass a PathBuf in, it's optional but defaults to finding the current directory - which is a runtime error in wasm
    • I've bumped the toolchain version. I was getting an error that 2022-06-27 doesn't exist, and it doesn't seem to be in releases. Not sure what's going on there, but I've bumped to the latest version

    Note that this still doesn't give us the multi-file python imports feature that seahorse now has. We're still using compile which will only work with a single Python source file. But it brings us up to date with the latest seahorse features/fixes within that existing constraint.

    Fixes #75, #86

    opened by mcintyre94 2
  • Keep getting

    Keep getting "This account may not be used to pay transaction fees"

    Hi, thanks for the awesome tool!

    I may be wrong in the way that I use the playground but after one or two deployments/upgrades, I started to get this error.

    Create buffer error: failed to send transaction: Transaction simulation failed: This account may not be used to pay transaction fees

    My workaround is to create a new wallet every time I hit this error and re-deploy the program again or to create a new program credentials before deploying again.

    Thanks!

    opened by syrafs 2
  • Add popular program ids

    Add popular program ids

    It would be nice to have all popular program ids in a constant that's globally available in playground client.

    For example: PROGRAM_ID.SPL_MEMO to access spl-memo's program id.

    opened by acheroncrypto 0
  • Airdrop Commandline  issue

    Airdrop Commandline issue

    Commandline for airdropping is "solana airdrop 2" or any value replacing 2.

    But if we give any other value than integer (invalid input) , terminal gets stuck. Even clean button doesnt work since it cleans everything else other than the invalid input line.

    No error message is dropped. Neither backspace , ctrl+c or enter button works.

    Error :- image

    After cleaning terminal :- image

    (As you can see,there is no way to get rid of that buggy line. )

    bug 
    opened by SabariGanesh-K 0
  • Add support for cargo features to playground server

    Add support for cargo features to playground server

    In Seahorse when using Pyth, it is an optional dependency that is enabled using anchor build -- --features pyth-sdk-solana

    This enables code in the generated src/lib.rs:

        #[cfg(feature = "pyth-sdk-solana")]
        pub use pyth_sdk_solana::{load_price_feed_from_account_info, PriceFeed};
    

    I think for Playground to compile this code we'd need to have it pass the feature flag.

    I think ideally we should be able to pass features: ["pyth-sdk-solana"] to the /build server, alongside rust files + uuid, and then have the build server include this feature flag when building

    One thing I'm not sure about is how dependencies work in the build server, because we don't pass cargo.toml in. I guess the build server would need to detect the pyth dependency only if that feature flag is passed in?

    opened by mcintyre94 0
  • Automatically fetch on-chain IDL

    Automatically fetch on-chain IDL

    Playground already generates UI for interacting with programs that have Anchor IDL(either built inside playground or uploaded the file manually) but it doesn't fetch on-chain IDLs.

    Playground should check the program id to see if there is an Anchor IDL on-chain. This not only would allow anyone to easily interact with all programs with on-chain IDL without manually uploading it to playground, but since playground also works with localhost, it would also make the local development experience smoother.

    enhancement good first issue 
    opened by acheroncrypto 2
  • Add copy button for Markdown code blocks

    Add copy button for Markdown code blocks

    It would be good to have a copy button for the markdown code blocks. We are using React Markdown and the default functionality can be extended by their plugins.

    enhancement good first issue 
    opened by acheroncrypto 0
Owner
solana-playground
solana-playground
A hardhat solidity template with necessary libraries that support to develop, compile, test, deploy, upgrade, verify solidity smart contract

solidity-hardhat-template A solidity hardhat template with necessary libraries that support to develop, compile, test, deploy, upgrade, verify solidit

ChimGoKien 4 Oct 16, 2022
A professional truffle solidity template with all necessary libraries that support developer to develop, debug, test, deploy solidity smart contract

solidity-truffle-template A professional truffle solidity template with necessary libraries that support to develop, compile, test, deploy, upgrade, v

ChimGoKien 6 Nov 4, 2022
solana-base-app is a base level, including most of the common features and wallet connectivity, try using `npx solana-base-app react my-app`

solana-base-app solana-base-app is for Solana beginners to get them up and running fast. To start run : run npx solana-base-app react my-app change th

UjjwalGupta49 33 Dec 27, 2022
A comprehensive collection of useful tools developed with the help of Ethers.js to interact with the Ethereum Blockchain to develop great DeFi apps as quickly and easily as possible.

hudi-packages-ethersfactory How to install Installing with npm For more information on using npm check out the docs here. npm i @humandataincome/ether

HUDI 6 Mar 30, 2022
🛠 Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

?? Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

Holaplex 30 May 21, 2022
ToolJet an open-source low-code framework to build and deploy internal tools quickly without much effort from the engineering teams

ToolJet is an open-source low-code framework to build and deploy internal tools quickly without much effort from the engineering teams. You can connect to your data sources, such as databases (like PostgreSQL, MongoDB, Elasticsearch, etc), API endpoints (ToolJet supports importing OpenAPI spec & OAuth2 authorization), and external services (like Stripe, Slack, Google Sheets, Airtable) and use our pre-built UI widgets to build internal tools.

ToolJet 15.6k Jan 3, 2023
Toolkit for development, test and deploy smart-contracts on Waves Enterprise ecosystem.

JS Contract SDK Toolkit for development, test and deploy smart-contracts on Waves Enterprise ecosystem. Quickstart The fastest way to get started with

Waves Enterprise 20 Dec 15, 2022
Learn GraphQL by building a blogging engine. Create resolvers, write schemas, write queries, design the database, test and also deploy.

GraphQL Blog graphqlblog.com Learn GraphQL by building a blogging engine. Create resolvers, write schemas, write queries, design the database, test an

GraphQLApps 6 Aug 17, 2022
A decentralised portal that aims to help Government Educational organisations to track student and colleges data to provide them with fellowships and programs.

DeSIDB A decentralised database built on Ethereum & Solidity. Introduction - India is a country with a population of 6.8 crore students graduating eac

Sachin Pandey 14 Jul 10, 2022
Command-line toolkit for parsing, compiling, transpiling, optimizing, linking, dataizing, and running EOLANG programs

First, you install npm and Java SE. Then, you install eolang package: $ npm install eolang Then, you write a simple EO program in hello.eo file in th

objectionary 17 Nov 17, 2022
A simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games and web applications.

gameroom.js Overview gameroom.js is a simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games

Jackson Bierfeldt 3 Nov 3, 2022
Jaxit is an easy-to-use library that makes an interactive terminal for your programs.

Jaxit Jaxit is an easy-to-use library that makes an interactive terminal for your programs. Jaxit was made by Codeverse, so check on Codeverse's Profi

null 3 Dec 11, 2022
Contribute some nodejs programs here ;)

Nodejs Programs Showcase Table Of Contents Prerequisites Contributing Prerequisites In God we trust. All others must bring data. Need to be courageous

koderDev 3 Oct 9, 2022
The repository shows the compiler (simulator) of the Little Man Computer, which also contains some programs in the LMC programming language for implementing different functions.

Little Man Computer The repository shows the compiler (simulator) of the Little Man Computer, which also contains some programs in the LMC programming

Cow Cheng 2 Nov 17, 2022
Cookbook Method is the process of learning a programming language by building up a repository of small programs that implement specific programming concepts.

CookBook - Hacktoberfest Find the book you want to read next! PRESENTED BY What is CookBook? A cookbook in the programming context is collection of ti

GDSC-NITH 16 Nov 17, 2022
Jester is a test-generation tool to create integration test code.

Code Generator for Integration Tests Introduction Welcome to Jester: An easy-to-use web application that helps you create and implement integration te

OSLabs Beta 54 Dec 12, 2022
SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end tests written with wdi5. Take part in the challenge and develop an app that passes the tests.

SAP Community Code Challenge - UI5 The change log describes notable changes in this package. Description This repository is the starting point for the

SAP Samples 8 Oct 24, 2022
It is an app that allows you to create lists of books and authors made in the course of Microverse. This project was develop using JavaScript, HTML and CSS.

AWESOME BOOKS This is an Awesome book store project that add store and diplay books on the UI. Built With HTML,CSS, JavaScript Frameworks Github, Lint

JUSTINE IMASIKU 5 Jul 28, 2022
This monorepo stores all code and assets of all projects with which we develop regels.overheid.nl

Welcome Introduction In 2021 Utrecht started developing the Virtual Income Desk with Open Rules. An initiative with the aim for citizens to always and

Ministerie van Binnenlandse Zaken en Koninkrijksrelaties 5 Dec 8, 2022