Skip to content

Instantly share code, notes, and snippets.

@ilblackdragon
Created February 14, 2020 06:33
Show Gist options
  • Save ilblackdragon/e709f18fea7faa55f090ac2cc1ec4c9d to your computer and use it in GitHub Desktop.
Save ilblackdragon/e709f18fea7faa55f090ac2cc1ec4c9d to your computer and use it in GitHub Desktop.
Truffle example
const { NearProvider, nearlib } = require('near-web3-provider');
const web3 = require('web3');
ACCOUNT_ID = 'illia'
const fileKeyStore = new nearlib.keyStores.UnencryptedFileSystemKeyStore('neardev');
const networkId = 'default';
const defaultAccount = web3.utils.keccak256(ACCOUNT_ID).slice(26, 66);
module.exports = {
networks: {
near: {
network_id: '99',
provider: function() {
return new NearProvider('https://rpc.nearprotocol.com', fileKeyStore, ACCOUNT_ID, networkId, 'denver-evm');
},
from: defaultAccount,
skipDryRun: true
},
development: {
host: '127.0.0.1',
port: 7545,
network_id: '*' // Match any network id
}
},
// Configure your compilers
compilers: {
solc: {
version: '0.5.12', // Fetch exact version from solc-bin (default: truffle's version)
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment