solana-playground / solana-playground Goto Github PK
View Code? Open in Web Editor NEWQuickly develop, deploy and test Solana programs from browsers
Home Page: https://beta.solpg.io
License: Apache License 2.0
Quickly develop, deploy and test Solana programs from browsers
Home Page: https://beta.solpg.io
License: Apache License 2.0
Currently the wallet is sort of hidden in the bottom left corner. User should be able to connect when doing their task without looking for where the wallet is. Users should also receive auto-airdrop when they first connect so that they can deploy without effort.
Users should be able to:
Hello,
I am new to Solana development. I am using Solana Playground IDE to implement the Tic-Tac-Toe implementation guide.
I have run the setupGame function and can fetch the game details using the address for the game.
I have also implemented the play function which takes game address key, player address key and tile input (tile is a struct implementation with row and column values in it). I am facing issue in inputting the struct value "{0,1}" into the play function and run the function as the second player. But I am able to run the play function as first player and "{}" value for Tile input.
Can you kindly help how should I input the tile struct value "{0,1}" into play function?
Posting here as I do not see any other forum for discussion (hopefully that will change in future :))
Kindly add cargo.toml in the src folder, So packages can be get easily, Which would make things easier for getting stuff thats custom and not supported here. e.g: access_control.
Would be awesome if you could push back to a git repo if you imported it into the workspace
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.
Monaco editor uses Monarch grammars by default which results in faster performance but worse syntax highlighting.
VSCode is using TextMate grammars which many people are familiar with. We can add support for it by looking at the example implementation here.
This would not only allow for much better syntax highlighting but also would make it much easier to integrate VSCode themes.
We should implement basic linting for easier error spotting.
Im trying to use System::now() with UNIX_EPOCH to get the time stamp but seems to be giving error on it. kindly fix asap
Users should be able to use the following commands to interact with the terminal(ctrl = cmd):
Currently, users see the home page if all tabs are closed.
I want to know that how to sign and make program calls without approving with wallet like yours ?
failed to send transaction: Transaction simulation failed: Error processing Instruction 1: invalid account data for instruction
Its showing during deployment to devnet.
Just riffing with the idea of code snippet sharing on SolPg.
It would be convenient to have a download IDL button for the people who want to use the IDL in their frontend or do local testing.
We should allow users to import their .so
file and deploy from playground because many people have deployment problems with the solana-cli.
I think the test UI would be even more useful if there was a way to fetch the account data from the deployed program and view it in the playground.
I think a way to do program.account.newAccount.fetch(publicKey)
and program.account.newAccount.all()
would add a huge amount of value. This would let us test an instruction and immediately see its effect on-chain.
I expect the UI for this would allow selecting an account (parsed from the IDL), either selecting all or optionally entering a specific address, and it'd then display the fetched data as nicely formatted JSON.
Users should be able to format their code.
See comment: #39 (review)
We should inform the user of any errors that happen when fetching account data. Probably using a toast and/or printing something in the console?
@acheroncrypto happy for this to be assigned to me :)
Some users might want to load their existing wallets into Playground Wallet. We should have an option to do so both when user first connects to Playground Wallet and also in the wallet menu(bottom left). Users should also be able to export their keypairs, ideally download as a json file.
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?
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. :)
Common error messages like "custom program error: 0x1" should be converted to a readable error.
Hi, I also wanted to create my playground, mainly for rust. However, since this project exists, I would like to leave you with an idea.
It is worth adding support for multiple anchor versions by creating a template for each version. The compilation of the versions can be done by the docker project serum which is updated every version by the serum.
https://hub.docker.com/r/projectserum/build/tags
With this setup, you would be able to automatically add support for the new anchor version thanks to github actions.
Hi , Add a bump field in the interface, So it'll be easy to bump accounts. Cheers ๐บ
We should give more details about what Playground Wallet is and what it does when users try to connect the first time.
Every endpoint should show the airdrop option based on the current network. Currently we only show default endpoints on localhost
devnet
and testnet
.
Could Solpg be updated to anchor-lang 0.25.0 to enable building with anchor realloc feature
https://docs.rs/anchor-lang/latest/anchor_lang/derive.Accounts.html
We should add color highlighting to output in order to differentiate output messages (i.e error: red)
This would be a lot more useful if I could create Repos or create code in the IDE and save it to Github
Would be great to have ts/js
tests directly integrated in the playground like mentioned in #53.
web3.js
and anchor
Please Add this dependency because it's too important for selling/Auctioning of Tokens.
What happened:
I was editing in this browser, and all to quickly hit the 'delete' key while focused on the wrong part of the page. I was already about to type 'Enter', and so I deleted my entire lib.rs
file with no way of recovery.
What would help:
An "Undo Delete" feature would improve the usability of this project by helping users avoid painful losses from a mistroke of the keyboard.
Possible Implementation, High-Level:
All files and folders could be deleted "softly", so that if the user focuses the sidebar and presses 'Crl+Z', or clicks an 'Undo' icon, they can restore their file. This would likely require storing the file data in either localStorage, or not really removing it from state and instead moving it to a 'deleted' state, that can be recovered.
We should add basic autocomplete to the editor and improve it over time.
#[access_control())]
access control macro doesn't work, Kindly add this, Then pre-validation becomes easier to test.
Thanks for making solana-playground, it is super helpful, especially for people new to Rust and Solana development!
I want to try and make a GET call to an API inside of my solana program, and I see that I need reqwest in order to do that. I don't see reqwest as a supported crate in your list of supported crates.
I apologize if this is actually an unreasonable request, I am new to Rust and Solana and I am not sure what is possible.
Compile one of the Python code formatters into WASM to format code natively in the browser.
I want to import both Solana programs on https://github.com/cardinal-labs/cardinal-staking/tree/main/programs.
I import it via Github so I have two Projects titled with:
When trying to use the anchor build
it shows:
Building...
$ error[E0432]: unresolved import `cardinal_token_manager`
--> /src/instructions/claim_receipt_mint.rs:9:9
|
9 | self,
| ^^^^ no external crate `cardinal_token_manager`
error[E0433]: failed to resolve: use of undeclared crate or module `cardinal_token_manager`
--> /src/instructions/return_receipt_mint.rs:5:5
|
5 | cardinal_token_manager::{program::CardinalTokenManager, state::TokenManager},
| ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `cardinal_token_manager`
error[E0432]: unresolved import `cardinal_token_manager`
--> /src/instructions/init_stake_mint.rs:13:30
|
13 | cardinal_token_manager::{self, program::CardinalTokenManager},
| ^^^^ no external crate `cardinal_token_manager`
error[E0433]: failed to resolve: use of undeclared type `TokenManagerKind`
--> /src/instructions/claim_receipt_mint.rs:72:30
|
72 | token_manager_kind = TokenManagerKind::Edition;
| ^^^^^^^^^^^^^^^^ use of undeclared type `TokenManagerKind`
error[E0433]: failed to resolve: use of undeclared type `TokenManagerKind`
--> /src/instructions/claim_receipt_mint.rs:75:30
|
75 | token_manager_kind = TokenManagerKind::Managed;
| ^^^^^^^^^^^^^^^^ use of undeclared type `TokenManagerKind`
error[E0433]: failed to resolve: use of undeclared type `InvalidationType`
--> /src/instructions/claim_receipt_mint.rs:84:28
|
84 | invalidation_type: InvalidationType::Return as u8,
| ^^^^^^^^^^^^^^^^ use of undeclared type `InvalidationType`
error[E0433]: failed to resolve: use of undeclared crate or module `cardinal_token_manager`
--> /src/instructions/return_receipt_mint.rs:47:28
|
47 | let cpi_accounts = cardinal_token_manager::cpi::accounts::InvalidateCtx {
| ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `cardinal_token_manager`
error[E0433]: failed to resolve: use of undeclared crate or module `cardinal_token_manager`
--> /src/instructions/return_receipt_mint.rs:58:9
|
58 | cardinal_token_manager::cpi::invalidate(cpi_ctx)?;
| ^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `cardinal_token_manager`
error[E0412]: cannot find type `CardinalTokenManager` in this scope
--> /src/instructions/claim_receipt_mint.rs:53:43
|
16 | pub struct ClaimReceiptMintCtx<'info> {
| - help: you might be missing a type parameter: `, CardinalTokenManager`
...
53 | token_manager_program: Program<'info, CardinalTokenManager>,
| ^^^^^^^^^^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `CardinalTokenManager` in this scope
--> /src/instructions/init_stake_mint.rs:53:43
|
27 | pub struct InitStakeMintCtx<'info> {
| - help: you might be missing a type parameter: `, CardinalTokenManager`
...
53 | token_manager_program: Program<'info, CardinalTokenManager>,
| ^^^^^^^^^^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `TokenManager` in this scope
--> /src/instructions/return_receipt_mint.rs:16:39
|
9 | pub struct ReturnReceiptMintCtx<'info> {
| - help: you might be missing a type parameter: `, TokenManager`
...
16 | token_manager: Box<Account<'info, TokenManager>>,
| ^^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `CardinalTokenManager` in this scope
--> /src/instructions/return_receipt_mint.rs:30:43
|
9 | pub struct ReturnReceiptMintCtx<'info> {
| - help: you might be missing a type parameter: `, CardinalTokenManager`
...
30 | token_manager_program: Program<'info, CardinalTokenManager>,
| ^^^^^^^^^^^^^^^^^^^^ not found in this scope
Some errors have detailed explanations: E0412, E0432, E0433.
error: could not compile `solpg` due to 12 previous errors
I compile it in my Visual Studio and deploy it successfully. I think this can be solved via several methods:
What do you think?
We check and confirm every deploy transaction because we want to guarantee the deployment. This process could be slow depending on network conditions. Users should be able to see some kind of progress indicator for better UX.
Would love to look at how I could contribute to this!
Specific questions:
wasm
things locally and how do you do so?yarn
and then yarn start
, and I'm getting some TS errors:Compiled with problems:X
ERROR in src/components/Panels/Side/Right/Test/Function.tsx:62:5
TS2322: Type 'never[]' is not assignable to type 'KV'.
Index signature for type 'string' is missing in type 'never[]'.
60 | const [txVals, setTxVals] = useState<TxVals>({
61 | name: ixs.name,
> 62 | additionalSigners: [],
| ^^^^^^^^^^^^^^^^^
63 | });
64 | const [errors, setErrors] = useState<{ [key: string]: number }>({});
65 | const [loading, setLoading] = useState(false);
ERROR in src/utils/pg/test.ts:298:54
TS2345: Argument of type '(string | number | PublicKey | Signer | BN)[]' is not assignable to parameter of type 'Signer[]'.
Type 'string | number | PublicKey | Signer | BN' is not assignable to type 'Signer'.
Type 'string' is not assignable to type 'Signer'.
296 | }
297 |
> 298 | const txHash = await PgTx.send(tx, conn, wallet, additionalSigners);
| ^^^^^^^^^^^^^^^^^
299 | return txHash;
300 | }
301 | }
Is there something else I need to do/some specific config I could be missing to get it running locally? I'm using Node v16.16.0
(latest LTS).
Users should be able to drag and drop files to move them into different directories.
There can be memory leak if a user changes explorer pages during an async request. We should check to see if the component is still mounted at the end of the request before updating the state.
Users should be able to use Solana-CLI and common UNIX commands(i.e mkdir).
Current version of deployment process doesn't expect Solana to be congested. This is not an issue with the localhost
but it's a potential issue with devnet
, testnet
and mainnet-beta
If a transaction gets dropped or deployment doesn't finish in a short period of time, the deployment could fail.
We can make sure the deployment succeeds if we implement a custom logic like solana-deployer.
Users should be able to resize the sidebar. It especially helps during tests.
Hi thanks for awesome work.
Can you help to add spl-token crate ๐.
Thanks you ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.