Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created October 28, 2020 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuyasugano/d066954002e579cad390a6eb052e611a to your computer and use it in GitHub Desktop.
Save yuyasugano/d066954002e579cad390a6eb052e611a to your computer and use it in GitHub Desktop.
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