-
Notifications
You must be signed in to change notification settings - Fork 3
/
truffle-config.js
33 lines (28 loc) · 913 Bytes
/
truffle-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const ContractKit = require('@celo/contractkit');
const Web3 = require('web3');
require('dotenv').config({path: '.env'});
// Create connection to DataHub Celo Network node
const web3 = new Web3(process.env.REST_URL);
const client = ContractKit.newKitFromWeb3(web3);
// Initialize account from our private key
const account = web3.eth.accounts.privateKeyToAccount(process.env.PRIVATE_KEY);
// We need to add private key to ContractKit in order to sign transactions
client.addAccount(account.privateKey);
module.exports = {
compilers: {
solc: {
version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's version)
}
},
networks: {
test: {
host: "127.0.0.1",
port: 7545,
network_id: "*"
},
alfajores: {
provider: client.connection.web3.currentProvider, // CeloProvider
network_id: 44787 // latest Alfajores network id
}
}
};