MultiversX Tracker is Live!

Error: *** Deployment Failed *** "IdentityVerification" -- unknown account. Migrating a smart contract on Truffle connecting to Geth nodes

Etherum Reddit

More / Etherum Reddit 84 Views

I have created a test blockchain network and created a smart contract for validators to verify members, which I am trying to deploy with truffle.

A bootnode serves as the Host on the main network:

sudo geth --datadir ./bootnode --networkid 3129 --port 30305 --ipcpath geth-bootstrap.ipc --http --http.addr "192.168.2.103" --http.port 8545 --http.api "admin,eth,net,web3,personal" --http.corsdomain "*" --http.vhosts "*"

I run the validator through docker: docker run -d --name validator0 -v ~/Documents/Geth/validator0:/root/.ethereum -p 8547:8547 -p 30304:30304 ethereum/client-go:alltools-v1.10.26 geth --datadir /root/.ethereum --networkid 3129 --ipcpath /root/.ethereum/geth-validator0.ipc --bootnodes "enode://8b34ba634272ed781d64ea6c75e60b8948c14bb7e2188611951120805d46bec6a2fa691c29e8b4efe82bcee687648a717244c4d4802685e1f7ecbaa0efd12dca@192.168.0.223:30305" --syncmode "full" --port 30304 --http --http.addr "0.0.0.0" --http.port 8547 --http.api "admin,eth,net,web3,personal" --allow-insecure-unlock

This P2P connection is successful

My smart contract:

pragma solidity ^0.8.0; contract IdentityVerification { address public owner; mapping(address => bool) public validators; mapping(address => bool) public verifiedMembers; event MemberVerified(address member); modifier onlyOwner() { require(msg.sender == owner, "Only owner can call this function"); _; } modifier onlyValidator() { require(validators[msg.sender], "Only validators can call this function"); _; } constructor() { owner = msg.sender; } function addValidator(address _validator) public onlyOwner { validators[_validator] = true; } function verifyMember(address _member) public onlyValidator { verifiedMembers[_member] = true; emit MemberVerified(_member); } function isMemberVerified(address _member) public view returns (bool) { return verifiedMembers[_member]; } }``` Truffle Configuration ```module.exports = { networks: { development: { host: "192.168.2.103", // Bootnode's IP address port: 8545, // Geth HTTP RPC port network_id: "*", // Match any network id from: "0x4dA2472eDDe765C406035C813912108955BdF33B", gas: 4500000, // Gas limit gasPrice: 20000000000, // 20 Gwei networkCheckTimeout: 20000 }, }, compilers: { solc: { version: "0.8.0", }, }, };``` Migrations ```const IdentityVerification = artifacts.require("IdentityVerification"); module.exports = function (deployer) { deployer.deploy(IdentityVerification) .then(instance => { console.log(`Contract deployed at address: ${instance.address}`); }); };``` I unlock my validator account in the console and start mining, which I can view in bootnode. The contract compiles but when I run ```truffle migrate --network development``` I recieve an error: ```Starting migrations... ====================== > Network name: 'development' > Network id: 3129 > Block gas limit: 30000000 (0x1c9c380) 2_deploy_identity_verification.js ================================= Deploying 'IdentityVerification' -------------------------------- *** Deployment Failed *** "IdentityVerification" -- unknown account. Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan. Error: *** Deployment Failed *** "IdentityVerification" -- unknown account. at /usr/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:330:1 at processTicksAndRejections (node:internal/process/task_queues:95:5) 

Running (await web3.eth.getAccounts()) returns the address of the bootnode, and await web3.eth.getBalance("0x4dA2472eDDe765C406035C813912108955BdF33B")) '100000000000000000000000' successfully returns the account balance of validator0. Therefore it must be recognised in some capacity by truffle and I'm unsure of how to successfully route traffic through bootnode or understand how to configure the system so that truffle can recognise validator0.

submitted by /u/Bales_wages
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments