solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.05k stars 4.21k forks source link

explorer: Use anchor links for subsections #13295

Closed oJshua closed 7 months ago

oJshua commented 3 years ago

Problem

Explorer doesn't provide anchor links for the various sections displayed. For example, on the transaction page, it would be nice if you could link someone directly to the "Account Inputs" section.

Proposed Solution

oJshua commented 3 years ago

There is a library to update the anchor as a user scrolls, but it seems too invasive (https://pvoznyuk.github.io/react-update-url-on-scroll). I think just adding anchors to sections should be fine.

KitanGarcia commented 2 years ago

Hello, @oJshua ! I know it's been a while, but if this still needs to be done, I'd be happy to help! I'm quite new to solana, but would love to give it a go. To clarify, do we only want these anchors on the Transaction page? And I assume we'd want them for each of the major headings, ie. Account Input(s), Token Balances, Instruction(s), and Program Logs. Would we also want an anchor for each instruction?

oJshua commented 2 years ago

@KitanGarcia thanks for offering to take this on! I think we want anchors Explorer-wide on the major headings. An anchor for each instruction would be helpful.

KitanGarcia commented 2 years ago

@oJshua Awesome, sounds good! I've been looking here for guidelines. But didn't find a description of branch naming conventions. For the future, is there a convention I should follow when naming this branch?

Another question: Following the documentation to set up the repo, I'm unable to proceed past Step 3: running cargo build
My computer freezes at 826/834 when it tries to build solana-bench-tps(bin), solana-test-validator(bin), solana-dos(bin), solana-replica-node(bin), solana-banking-bench(bin), solana-ledge...

Basically my CPU usage goes through the roof, everything freezes, and then I get logged out of my account. I'm running Arch Linux and followed the step below to install the equivalents of: libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang make

KitanGarcia commented 2 years ago

@oJshua Got another question for you. I cloned the solana repo and have been trying to get set up by following the ReadMe. Is there any way to just work with Explorer? After running cargo build and cargo test on the repo, this project is taking over 90 GB and my computer ran out of storage.

oJshua commented 2 years ago

@KitanGarcia how much ram does your machine have? I've noticed even machines with 16GB struggle building the full project. Fortunately, for working on Explorer you don't need to run a full build, you can just operate out of the explorer directory.

npm install and npm run start will get you running, assuming you have a working Node installation. Let me know if that helps! As for branch naming conventions, I usually use the github issue ID + dash + a short title of the task.

KitanGarcia commented 2 years ago

@oJshua It has 16GB! I was able to get passed that issue with a combination of installing packages individually and using cargo build -j 3 Somehow I missed that little detail! Thanks! I can't believe it was that simple. One more question I have is regarding the RPC. After running npm install and npm run start, I'm unable to receive any data. For example, the price and supply data, cluster stats, and transaction stats have failed API calls. The message I receive back is:

Error: 403 Forbidden:  {"jsonrpc":"2.0","error":{"code": 403, "message":"Access forbidden, contact your app developer or support@rpcpool.com."}, "id": "..." }

I asked on the Solana Discord and they mentioned to use another provider's RPC node. Is that the correct course of action, and if so, how can I accomplish that. I'm super new to Solana and blockchain, so I apologize for these basic questions.

oJshua commented 2 years ago

@KitanGarcia thanks for your patience on this. I'm working with ops to find a solution. Stay tuned.

oJshua commented 2 years ago

@KitanGarcia Give this another try and it should work fine!

KitanGarcia commented 2 years ago

@oJshua Thanks for looking into this! I'll give it another go as soon as I can. I was able to get things working for testing by using the custom URL option along with https://api.metaplex.solana.com/ for the API calls. I'm not sure if it's been seen yet, but I've made a PR here. Would love any feedback!

oJshua commented 2 years ago

Perfect, thanks for the heads up @KitanGarcia !

KitanGarcia commented 2 years ago

@oJshua Just saw that the run failed because I didn't run prettier! Apologies for that amateur mistake, somehow I didn't see that. I ran prettier on the two problematic files, did npm run build and npm run test and everything looks to be passing and in order. Just updated the PR. Please let me know if there are any other issues. Thanks for your patience!

CriesofCarrots commented 7 months ago

Explorer code is here now: https://github.com/solana-labs/explorer