providers documentation
This commit is contained in:
@ -33,13 +33,16 @@ if (process.env.NODE_ENV !== 'build') {
|
||||
var web3 = require('./web3'); // jshint ignore:line
|
||||
}
|
||||
|
||||
/// Automatically tries to setup correct provider
|
||||
/// First it checkes if we are ethereum browser (if navigator.qt object is available)
|
||||
/// if yes, we are using QtProvider
|
||||
/// if no, we check if it is possible to establish websockets connection with ethereum (ws://localhost:40404/eth is default)
|
||||
/// if it's not possible, we are using httprpc provider (http://localhost:8080)
|
||||
/// The constructor allows you to specify uris on which we are trying to connect over http or websockets
|
||||
/// You can do that by passing objects with fields httrpc and websockets
|
||||
/**
|
||||
* AutoProvider object prototype is implementing 'provider protocol'
|
||||
* Automatically tries to setup correct provider(Qt, WebSockets or HttpRpc)
|
||||
* First it checkes if we are ethereum browser (if navigator.qt object is available)
|
||||
* if yes, we are using QtProvider
|
||||
* if no, we check if it is possible to establish websockets connection with ethereum (ws://localhost:40404/eth is default)
|
||||
* if it's not possible, we are using httprpc provider (http://localhost:8080)
|
||||
* The constructor allows you to specify uris on which we are trying to connect over http or websockets
|
||||
* You can do that by passing objects with fields httrpc and websockets
|
||||
*/
|
||||
var AutoProvider = function (userOptions) {
|
||||
if (web3.haveProvider()) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user