Categories
Cryptocurrency Ethereum Mastering Development

MetaMask custom RPC connection error with private ganache-cli, EC2

Currently I am trying to build private dapp using ganache-cli as a blockchain backend with aws ec2 instance. I get the expected result from terminal. request: curl -X POST –data ‘{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}’ localhost:8545 response: {"id":67,"jsonrpc":"2.0","result":"EthereumJS TestRPC/v2.10.2/ethereum-js"} However, I get following error when I set up MetaMask’s custom rpc like: {MY_PUBLIC_IP}:8545 even though my ganache docker (and […]

Categories
Cryptocurrency Ethereum Mastering Development

MetaMask – RPC Error: Error: [ethjs-rpc] rpc error with payload [obejct Object

I am trying to sign transactions using certify_send() function to a smart contract deployed to my private ethereum blockchain but I keep getting this error after I approve in MetaMask MetaMask – RPC Error: Error: [ethjs-rpc] rpc error with payload { “id”: 6657017249622, “jsonrpc”: “2.0”, “params”: [“<a long hex string>”], “method”: “eth_sendRawTransaction” } [object Object] […]

Categories
Cryptocurrency Ethereum Mastering Development

How to debug a “rpc error with payload”

Debugging smart contract errors can be surprisingly hard. There is one particular kind of error that annoys me the most: the infamous rpc error with payload. For instance, just a few hours ago, while deploying a smart contract from the front-end using new web3.eth.Contract().deploy() into ganache-cli, I got the following in the browser’s console: MetaMask […]

Categories
Cryptocurrency Ethereum Mastering Development

revert ERC20: transfer amount exceeds balance

I try to send from ERC-20 to other ERC-20 via interledger in ganache , but get this error: { < “id”: 3451, < “jsonrpc”: “2.0”, < “error”: { < “message”: “VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance”, < “code”: -32000, < “data”: { < “stack”: “c: VM Exception while processing transaction: […]

Categories
Cryptocurrency Ethereum Mastering Development

revert ERC20: transfer amount exceeds balance

I try to send from ERC-20 to other ERC-20 via interledger in ganache , but get this error: { < “id”: 3451, < “jsonrpc”: “2.0”, < “error”: { < “message”: “VM Exception while processing transaction: revert ERC20: transfer amount exceeds balance”, < “code”: -32000, < “data”: { < “stack”: “c: VM Exception while processing transaction: […]

Categories
Cryptocurrency Development Ethereum

Receiving unexpected JSONRPC requests on my website

I have a production website (nothing about blockchain or related) and I a received hundreds of POST request to “/” with these params. Obviously my server raise an error because it doesn’t know how to handle it, but i am curious. What are these request? Is it something bad? POST “/” { “id” => 0, […]

Categories
Development

How do I flatten JSON nested objects while retaining the internal {} in Nodejs?

This is the original response from the API. { result: [ { activeFrom: ‘2018-02-15T16:02:20.003Z’, activeTo: ‘2018-02-15T16:02:20.003Z’, distance: 0, duration: ’00:00:00′, rule: [Object], device: [Object], diagnostic: [Object], driver: ‘UnknownDriverId’, version: ‘00000000000061b9’, id: ‘a30M9pPNZSEq7DgUdYrF8xw’ }, { activeFrom: ‘2018-02-15T16:06:03.003Z’, activeTo: ‘2018-02-15T16:06:03.003Z’, distance: 0, duration: ’00:00:00′, rule: [Object], device: [Object], diagnostic: [Object], driver: ‘UnknownDriverId’, version: ‘00000000000061bb’, id: ‘apk5czda9o06cwRzkSl4_dQ’ } […]

Categories
Development

Making a WebSocket call with Rust

I’m trying to use ws-rs to create a WebSocket connection with my server in Rust. My setup works with JavaScript but I’m unsure how to replicate the same calls with ws-rs. I have implemented it with JS using the following logic and it works fine: var websocket_connection = websocket.connect({ url: ‘ws://localhost:3401’, }); function set_price() { […]