Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
truffle.js example for Rinkeby network
const HDWalletProvider = require("truffle-hdwallet-provider");
const privKey = "";
const rinkebyApi = "https://rinkeby.infura.io/v3/<endpoint>";
const youraddress = "";
module.exports = {
networks: {
// Useful for testing. The `development` name is special - truffle uses it by default
// if it's defined here and no other network is specified at the command line.
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
//
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
rinkeby: {
provider: function() {
return new HDWalletProvider(
[privKey], rinkebyApi, 0, 1
);
},
network_id: 4,
gas: 500000,
gasPrice: 10000000000,
from: youraddress
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment