how_to_deploy_uniswap icon indicating copy to clipboard operation
how_to_deploy_uniswap copied to clipboard

Running uniswap with private blockchain

Open ByteServer opened this issue 3 years ago • 8 comments

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?

ByteServer avatar Nov 20 '21 14:11 ByteServer

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"

tpmccallum avatar Nov 20 '21 20:11 tpmccallum

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 avatar Nov 21 '21 07:11 ByteServer

@tpmccallum Any help would be appreciated :D

ByteServer avatar Nov 27 '21 17:11 ByteServer

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

tpmccallum avatar Nov 28 '21 00:11 tpmccallum

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

AmrAshraf avatar Jan 11 '22 12:01 AmrAshraf

@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

ByteServer avatar Jan 11 '22 12:01 ByteServer

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'),

turndealer avatar Jan 20 '22 12:01 turndealer

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 👌🏼

ByteServer avatar Jan 20 '22 21:01 ByteServer