create-web3-provider
Create a web3 provider from scratch, with minimal to no configuration.
You can then pass the created provider directly into the Web3 constructor.
Installation
npm install create-web3-provider
yarn install create-web3-provider
Example Usage
const cw3p = require('create-web3-provider');
let provider = cw3p();
provider = cw3p({network: 'ropsten'});
provider = cw3p({ws: true, network: 'ropsten'});
provider = cw3p({infuraKey: 'MySecretInfuraKey'});
provider = cw3p({uri: 'http://localhost:8545'});
provider = cw3p({uri: 'ws://mydomain.com/path'});
provider = cw3p({uri: '/path/to/provider.ipc', net: require('net')});
cw3p({
network: String,
infuraKey: String,
ws: Boolean,
uri: String,
net: Object,
headers: Array,
timeout: Number
});