velas / velas-chain

Other
70 stars 35 forks source link

how to local velas network connect metamask? #429

Open mikewang68 opened 1 year ago

mikewang68 commented 1 year ago

Problem

I setup a local velas network , step follow ./setup.sh ./faucet.sh ./bootstrap-validator --allow-private-address

then run: evm-bridge ~/my-wallet/my-keypair.json http://192.168.1.167:8899 192.168.1.167:8545 57005

metamask config: network: local new rpc: http://192.168.1.167:8545 chainID: 57005

when i run: velas evm transfer-to-evm 0x245656B176b487524AA5639164f2322f29131C50 1 (0x2456.... is my metamask address)

output: Transaction signature = mhyP3fxoeezVWALs7Nd49X5a6aRCmTUwkvePiLsvENuhttu1Fs7u8KM1G4F4vR7Dg7raMiNx1oHjni5Loy9mea2 Ok

that means transcation is successful

so run: curl --data '{"method":"eth_getBalance","params":["0x245656B176b487524AA5639164f2322f29131C50"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST 192.168.1.167:8545

output: {"jsonrpc":"2.0","result":"0xae56f730e6d840000","id":1}

but metamask account 0x2456.... is nothing , value is 0 .

i want to know why ? how to resolve ?

Is there something wrong between evm-bridge and metamask ?

Thank you

Proposed Solution

vldm commented 1 year ago

Hi, Sorry for delay.

Maybe your browser disallow you to process http requests from extensions? https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content

Check network inspector for your metamask extension. You also can check bridge logs, for example you can start bridge with environment variable RUST_LOG=info,rpc=trace

To easy check https vs http you can use ngrok to create tunnel from your server to https subdomain.

wombatlabs commented 1 year ago

@mikewang68 How did you get the transfer to EVM to work? I keep getting this issue:

Error: RPC response error -32002: Transaction simulation failed: Blockhash not found 
mikewang68 commented 1 year ago

@mikewang68 How did you get the transfer to EVM to work? I keep getting this issue:

Error: RPC response error -32002: Transaction simulation failed: Blockhash not found 

set rpc: http://192.168.1.167:8545 in metamask , then velas evm-transfer

0xSiXx commented 1 year ago

@mikewang68 could I pay you to assist me with this I am having the same error:

Error: RPC response error -32002: Transaction simulation failed: Blockhash not found

Have tried everything.

wombatlabs commented 1 year ago

@mikewang68 did you figure out the connection issue to metamask?