TRUFFLE
Truffle Script - HORA
Truffle is a popular way to deploy your smart contracts onto Ethereum, and can also be used to deploy your smart contracts onto HORA. You can update your truffle configuration file (truffle.js) with a configuration to deploy your smart contracts onto HORA.
For more information on truffle configuration files, please see Truffle's Configuration Documentation.
NOTE: To deploy your smart contracts onto HORA, the transaction needs to be signed. This code below shows how to use the truffle-hdwallet-provider package to sign the transaction with the private key of your wallet.
​
1
/*
2
* This truffle script will deploy your smart contracts to your HORA Chain.
3
*
4
* @param {String} privateKey - Provide your wallet private key.
5
* @param {String} provider - Provide your SKALE endpoint address.
6
*/
7
​
8
let HDWalletProvider = require("truffle-hdwallet-provider");
9
​
10
//https://network.horachain.com/developers/ for HORA documentation
11
//Provide your wallet private key
12
let privateKey = "[YOUR_PRIVATE_KEY]";
13
​
14
//Provide your HORA endpoint address
15
let skale = "[YOUR_HORA_CHAIN_ENDPOINT]";
16
​
17
module.exports = {
18
networks: {
19
ganache: {
20
host: "127.0.0.1",
21
port: 8545,
22
network_id: "*"
23
},
24
skale: {
25
provider: () => new HDWalletProvider(privateKey, hora),
26
gasPrice: 0,
27
network_id: "*"
28
}
29
}
30
}
Copied!
​
Copy link