How does MetaMask confirm transactions? - metamask

We are trying to add the eth json rpc methods to our custom blockchain so we can use Metamask.
We are able to import accounts and send transactions to the blockchain but can not seem to get them to confirm.
getTransactionReceipt is being sent to our blockchain and we are returning the required response but the transaction always stays as "pending" in metamask?
Is there any documentation on this flow? Can anyone here explain what we are doing wrong? How can we get the transactions to show as complete?

Metamask does not confirm any transaction. It is just a bridge to connect to the blockchain. It allows connectivity to the Ethereum blockchain through the infrastructure available at Infura. more here: Is there some relation between window.ethereum injected by metamask and web3.js? Can we use both?
Metamask connects you to the blockchain. Blockchain consists of blocks
of data and these blocks of data are stored on nodes. Without nodes,
you cannot access blockchain data.
If you have ever worked with ganache in development environment, to connect to ganache with your metamask, you enter information about ganache local blockchain and metemask connects you the local ganache blockchain but at the end ganache blockchain deploys and confirms transactions.
Most likely you have either something wrong with contract code or you are passing wrong parameters from the front end.

Related

Metamask is not able to execute normal transactions in private quorum blockchain

I am setting up a quorum network with two nodes from the scratch which are using the RAFT consensus mechanism. The two nodes are live, up and running. One is specified as minter and the other is verifier. I have deployed a smart contract into the private quorum chain network using the Truffle framework.
I was able to add the contract token and account info to Metamask and retrieve corresponding ETH balance and token balances.
However, when I tried sending normal Ether between two accounts using Metamask (by using the accounts connected to Quorum chain), the transaction fails with the following message
MetaMask - RPC Error: Error: [ethjs-rpc] rpc error with payload {"id":6378119053557,"jsonrpc":"2.0","params":["0xf88b17850af16b1600830f424094e8bd1fc300c3cd85bf033a13effe02226d22e76280a4c6ed8990000000000000000000000000000000000000000000000000000000000000000a82f4f5a04e31045bf76c16a594ee742be05909019bfe31b0c57cca66918b13898b3684fda023aa10926436f4eec79d2a08407a55ba35d1dad4d50d9029dc26d7d7629bfabf"],"method":"eth_sendRawTransaction"} [object Object]
I have been trying to debug this error for a while but no success whatsoever. Requesting experts for help on this!
Thanks!
This happen with me sometime.I tried a lot of things but easy one is:-
Go to:-
Setting > Advance >Reset and reset account.
Note:-Resetting your account will clear your transaction history. This will not change the balances in your accounts or require you to re-enter your seed phrase.

Does blockchain use websocket?

Im programming an application for sharding on a p2p network but p2p networks have some serious problems like forwarding port , static ips and these things get a lot of time for me and it can be so bad for marketing and users.
After all i wanna use smart contract on a blockchain to pay for it.
Does blockchain use websocket for transfer blocks and data and give miners blocks ?
No blockchain's nodes relay transactions and blocks to their neighbours node after that they participate in the validation process.
Ordinary users use wallets which connect to a node, this communication can base on socket or rest api

How to integrate internal APIs (Not accessible outside office network) to slack slash commands

I am trying to use slash commands to my one of the slack channel. I tried to do a POC using git API and it worked fine.
I first created a slash command from this link :
https://api.slack.com/censored/slash-commands
Commnad: /poc
Request URL: http://jsonplaceholder.typicode.com/posts
This worked fine when I type /opc on slack chat box of my channel. It returns some data.
But when I change the Request URL to an internal API, which is accessible only from the office domain, I get error:
Darn – that slash command didn't work (error message: Failure when
receiving data from the peer). Manage the command at .
I believe, slack is not able to access my internal URL in case. Is that possible to see the slack logs?
Can anyone please help me here.
This can not work, since the request URL needs to be accessible from the public Internet in order to work with Slack.
In general most of Slack's interactive features (Slash commands, Interactive messages, Modals, Events API, ...) require your app to provide a public endpoint that can be called by Slack via HTTP.
In order to access internal APIs with Slack you will need some kind of gateway or tunnel through the firewall of your company that exposes the request URL to Slack. There are many ways how to do that and the solution needs to be designed according to the security policy of your company.
Here are a couple of suggestions:
VPN tunnel
One approach would be to run your script for the slash command on an internal webserver (one that has access to the internal API) use a VPN tunnel to expose that web server to the Internet, e.g. with a tool like ngrok.
DMZ
Another approach would be to run your app in the DMZ of your companies network and configure the firewall on both sides to allow access to Slack form the public Internet and your app to you your internal network.
Bridge
Another approach is to host and run that part of your app that interacts with Slack on the public Internet and the part that interacts with your internal network on your internal company network. Then add a secure connection that allows the public part to communicate with the part running on the internal company network.
If opening a connection into the internal network is not an option, there is another way that can allow communication with internal services by inverting the communication direction with a queue.
To do this, you need to deploy a public endpoint that accepts the requests from Slack and puts them onto a queue (e. g. AWS Lambda + SQS, Flask + RabbitMQ) and then poll the queue from the internal network. The polling needs to happen fairly often (at least once a second) to ensure the communication is quick enough for the users not to notice the lag too much. By doing this you can avoid exposing any endpoint of the internal network.
The drawbacks of this approach are more infrastructure complexity and slower response times, but it can be a good alternative in some corporate environments.

Anybody implemented IceLink in Xamarin?

I am going to develop an application which includes Audio/Video/Text chat.
I read IceLink documentation and demo. From that what I understood is we need to do signalling using WebSync to connect two peers.
But I couldn’t understand how to do it.
My questions are (suppose A wants to call B):
1. How A knows the address of B (whatever it may be like, ID or anything)
2. How B comes to know that A is calling him/her
We once build an App with P2P Connection via IceLink.
But we didn´t use the WebSync Component.
To establish a RTC Connection you need a non-P2P communcation to do the Handshake first.
With this Handshake all neccessary information is transmitted, and icelink can try to reach the other peer.
We used Microsoft SignalR for that since it is a serverside-javascript which can push messages to connected clients.
1.this is part of the handshake
2.Signaling via SignalR (e.g.)
I followed their example and achieved the same thing as you are intending to.
You need to handle call making on the server-side and somehow communicate the session id to another user . as simple as that.

Is it necessary to run a bitcoin node in order to interact with bitcoin blockchain?

Was looking at libraries for bitcoin node implementation like bitcoin-ruby and toshi. I guess my question is quite basic but I'm a newby here: Is it necessary to download the entire blockchain (and even set a node) in order interact with it as sending/receiving transactions, getting block data or create an address?
Things you can do offline, without syncing fully with the blockchain
Create new bitcoin addresses
Create transactions to be sent if you already have funds in some of your addresses
Things you can do with a connected, without syncing fully with the blockchain -
Send a transaction (broadcast it)
Check out implementations of SPV wallets such as breadwallet to know more.
It is possible to interact with the bitcoin network without downloading the entire blockchain.
You should check how to interact with the peers in the bitcoin developer guide p2p section.
There are also a lot of libraries that allow you to interact with the bitcoin network, for example, with bitcore p2p you can interact with a pool of peers with:
var Pool = require('bitcore-p2p').Pool;
var Networks = require('bitcore-lib').Networks;
var pool = new Pool({network: Networks.livenet});
// connect to the network
pool.connect();
// attach peer events
pool.on('peerinv', function(peer, message) {
// a new peer message has arrived
});
// Send a message, as soon as the response arrives, the pool will emit the related event.
// If your request is a getheaders message https://en.bitcoin.it/wiki/Protocol_documentation#getheaders
// you should listen for 'peerheaders'
pool.sendMessage(message)
// will disconnect all peers
pool.disconnect()
For checking an address balance, if you don't download the entire blockchain, you should download the header chain. When you want to check if an address is or not in a block, you can request a merkleblock.
Here and here you can find more about the spv clients.

Resources