Actively push offchain data to xDAIChain
This project is built with truffle init
.
Basic Structure:
- contracts
- migrations
- test
- truffle-config.js
After truffle compile
or truffle migrate
, it will generate a directory which is called build
and it is used for storing the ABI files of contracts.
I add the directory of client
which stores the Node.js script to interact with contracts on xDAIChain and ethereum mainnet or testnet.
Get offchain data from Chainlink. Specifically, collect ETHUSD price from Chainlink PriceFeed.
npm install @truffle/hdwallet-provider
sokol: {
provider: () => new HDWalletProvider(privateKey, `https://sokol.poa.network`),
network_id: 77,
gas: 500000,
gasPrice: 1000000000
},
xdai: {
provider: function () {
return new HDWalletProvider(
privateKey,
"https://dai.poa.network")
},
network_id: 100,
gas: 500000,
gasPrice: 1000000000
},
xDAI Faucet xDAI Official Docs JSON Multiple Lines to One Line Tool