1

I am planning to make a blog using solidity. I've made a contract. Here it is.

pragma solidity ^0.4.0;

contract Post{
    address author;
    uint _id;
    struct UserDetails{
     string title;
     string description;
     address owner;
}

mapping (uint => UserDetails) postDetails;

function Post() public{
    author = msg.sender;
}

function addPost(string title, string description) public returns (uint){
    _id += 1;
    postDetails[_id] = UserDetails(title, description, author);
    return _id;
}

function getPost(uint id) constant returns (string title, string description, address owner){
    return (postDetails[id].title, postDetails[id].description, postDetails[id].owner);
}


function getPostCount() constant returns (uint){
    return _id;
}

}

now I want to call addPost function from another pc of my network which has different etherbase accounts and both pcs are running in same private-net. Is it possible? Or how can this be done on another approach.

4
  • What you are asking is not very clear. And your question title and content doesn't seem to match. May be that's only for me Commented Oct 17, 2017 at 14:27
  • @AchalaDissanayake i have 2 pcs in a network. I've deployed this contract from a pc, and want to access the addPost function from another pc Commented Oct 18, 2017 at 5:03
  • will this be useful ?ethereum.stackexchange.com/questions/28200/… Commented Oct 18, 2017 at 6:01
  • if not specify what you need to know except from what's there Commented Oct 18, 2017 at 6:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.