second-state / how_to_deploy_uniswap

Detailed instructions on how to deploy Uniswap on an Ethereum compatible blockchain
Apache License 2.0
143 stars 93 forks source link

Running uniswap with private blockchain #17

Open ByteServer opened 2 years ago

ByteServer commented 2 years ago

Hello, i can't seem to be able to get uniswap interface to work with my private Geth node, i dont quite understand the change_rpc.py file Can anyone help me, just what i'll have to do?

tpmccallum commented 2 years ago

So essentially the change_rpc.py file is just replacing the Infura RPC endpoint (in Uniswap source code) with your own RPC endpoint. All you need to do is update line 10 and then run the change_rpc.py file.

https://github.com/second-state/how_to_deploy_uniswap/blob/master/uniswap_interface/change_rpc.py#L10

You will notice that some characters like ., / and : are escaped. You must also do this so that the code runs properly.

new_rpc = "http\:\/\/your_rpc_endpoint\:your_port"
new_rpc = "http\:\/\/localhost\:8545"
ByteServer commented 2 years ago

Thanks tpmccallum, now i have another issue when i change chainid, it says: Error: undefined is not a valid address. when im trying to start could you show me how to change it properly? and i cannot find node_modules/@uniswap/sdk/dist/entities/token.d.ts are you using another uniswap version in the guide? if yes which ? :)

ByteServer commented 2 years ago

@tpmccallum Any help would be appreciated :D

tpmccallum commented 2 years ago

Hi Simon, It seems that the uniswap sdk which I used back then has since been updated and therefore this documentation will be somewhat out of date. Sorry I can not be more helpful. You may have to dig around and find some new answers which will align your installation with the newer code (which was not around when I did this task). Good luck and again sorry I can not be more helpful today. Tim

AmrAshraf commented 2 years ago

@ByteServer Did you find out how to change the "chainid" in the right way?

ByteServer commented 2 years ago

@ByteServer Did you find out how to change the "chainid" in the right way?

No.. I tried to change everything I could, but it dint work correctly.. unfortunately

turndealer commented 2 years ago

Thanks tpmccallum, now i have another issue when i change chainid, it says: Error: undefined is not a valid address. when im trying to start could you show me how to change it properly? and i cannot find node_modules/@uniswap/sdk/dist/entities/token.d.ts are you using another uniswap version in the guide? if yes which ? :)

If you changed MAINNET chainId from 1 to anything else this may come. Reason

[SupportedChainId.MAINNET]: new Token(SupportedChainId.MAINNET, UNI_ADDRESS[1], 18, 'UNI', 'Uniswap'),

Here it find element with key value 1 UNI_ADDRESS[1], If you might have changed 1 to say 57

then replace it with

UNI_ADDRESS[57] Thus [SupportedChainId.MAINNET]: new Token(SupportedChainId.MAINNET, UNI_ADDRESS[57], 18, 'UNI', 'Uniswap'),

ByteServer commented 2 years ago

Thanks tpmccallum, now i have another issue when i change chainid, it says: Error: undefined is not a valid address. when im trying to start could you show me how to change it properly? and i cannot find node_modules/@uniswap/sdk/dist/entities/token.d.ts are you using another uniswap version in the guide? if yes which ? :)

If you changed MAINNET chainId from 1 to anything else this may come. Reason

[SupportedChainId.MAINNET]: new Token(SupportedChainId.MAINNET, UNI_ADDRESS[1], 18, 'UNI', 'Uniswap'),

Here it find element with key value 1 UNI_ADDRESS[1], If you might have changed 1 to say 57

then replace it with

UNI_ADDRESS[57] Thus [SupportedChainId.MAINNET]: new Token(SupportedChainId.MAINNET, UNI_ADDRESS[57], 18, 'UNI', 'Uniswap'),

Thanks for your suggestion, will look into it whenever I have the chance 👌🏼