I have problem with smart contract development using Remix solidity in private blockchain by Geth. I have two smart contracts such as Factory contract and Contract contract.
I create the Factory contract and then I call the createContract and getContract function, it works normally but when i call the getNum function I can not get the number.
I run this code in Remix solidity by JavaScript VM and Test network by Ganache or TestRPC work fine but when i use it with Private blockchain using Geth it has this problem
Here is my code.
contract Factory {
address[] newContracts;
function createContract(uint num) {
address newContract = new Contract(num);
newContracts.push(newContract);
}
function getContract() view public returns(address[]) {
return newContracts;
}
function getNum(address _add) view public returns(uint) {
return Contract(_add).getNum();
}
}
contract Contract {
uint public Num;
function Contract(uint num) {
Num = num;
}
function getNum() public returns(uint) {
return Num;
}
}