raydium-io / raydium-frontend

Raydium Frontend V2
https://raydium.io
GNU General Public License v3.0
104 stars 142 forks source link

How to set up the project locally #4

Closed memochou1993 closed 2 years ago

memochou1993 commented 2 years ago

When I switched RPC endpoint to https://api.devnet.solana.com, there were some errors.

I would like to know how to set up the local development environment.

image

When I swapped, transaction alway not found.

image image
alpha-defi commented 2 years ago

Were you able to successfully able to run this in devnet?

Per Rayxury's comments in discord:

frontend may work on devnet after change the program ids in raydium-sdk, and change the tokens api endpoint to yours that return the devnet tokens.

Where do you find the devnet program IDs and tokens API endpoint?

memochou1993 commented 2 years ago

I'm considering using a mainnet-fork endpoint to develop instead of using testnet or devnet and rebuilding all the SDK...

alpha-defi commented 2 years ago

I think mainnet is likely easiest right now for testing but I suppose it could get expensive depending on your use cases

Perhaps the devs could provide more guidance but I'll likely go with mainnet as well for now.

However, in case we ever revisit this and want to attempt devnet:

Rayxury referred me to the following https://discord.com/channels/813741812598439958/813750197423308820/943043301689425961 about the program ids:

Serum dex Program Id: DESVgJVGajEgKGXhb6XmqDHGz3VjdgP7rEVESBgxmroY Amm Program Id: 9rpQHSyFVM1dkkHFQ2TtTzPEW7DVmEyPmN8wVniqJtuC Staking Program Id: EcLzTrNg9V7qhcdyXDe2qjtPkiGzDM2UbdRaeaadU5r2

Specifically for swaps, I think we would then need to update the raydium-sdk token/devnet.ts and farm/pool.ts as I believe that's where the errors were originating from.

memochou1993 commented 2 years ago

It's kinda weird to update program Ids from SDK, it makes things complicated. So maybe using mainnet or mainnet-fork endpoint is the better way to develop for now.😅