Safe Remote Purchase - Solidity by Example Help.

papouyispapouyis Member Posts: 1
Hello guys, I need some guidance. I have deployed the 'Solidity by example Safe Remote Purchase' contract on my geth console and now I can interact with the contract itself.

What commands should I use?
What I mean by that is, what parameters are accepted to make a 'valid' purchase? Any guidance is really appreciated.

console output:
Contract mined! address: 0xef0c9636135fa59539b54f244d23b42d0730b1f9 transactionHash: 0xd6954a82df700184661513b3625d3e0c717e5e18dea3d89de00d5250a88553e9

purchaseTest = eth.contract([{"constant":true,"inputs":[],"name":"seller","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"abort","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"value","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"buyer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"confirmReceived","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"state","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"confirmPurchase","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[],"payable":true,"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"Aborted","type":"event"},{"anonymous":false,"inputs":[],"name":"PurchaseConfirmed","type":"event"},{"anonymous":false,"inputs":[],"name":"ItemReceived","type":"event"}]).at('0xef0c9636135fa59539b54f244d23b42d0730b1f9')
{
abi: [{
constant: true,
inputs: [],
name: "seller",
outputs: [{...}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [],
name: "abort",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [],
name: "value",
outputs: [{...}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: true,
inputs: [],
name: "buyer",
outputs: [{...}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [],
name: "confirmReceived",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [],
name: "state",
outputs: [{...}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [],
name: "confirmPurchase",
outputs: [],
payable: true,
stateMutability: "payable",
type: "function"
}, {
inputs: [],
payable: true,
stateMutability: "payable",
type: "constructor"
}, {
anonymous: false,
inputs: [],
name: "Aborted",
type: "event"
}, {
anonymous: false,
inputs: [],
name: "PurchaseConfirmed",
type: "event"
}, {
anonymous: false,
inputs: [],
name: "ItemReceived",
type: "event"
}],
address: "0xef0c9636135fa59539b54f244d23b42d0730b1f9",
transactionHash: null,
Aborted: function(),
ItemReceived: function(),
PurchaseConfirmed: function(),
abort: function(),
allEvents: function(),
buyer: function(),
confirmPurchase: function(),
confirmReceived: function(),
seller: function(),
state: function(),
value: function()
}

I can call the functions by: purchaseTest.xfunction()
what should I include for example in the buyer() function?

I have setup a private testnet with 10 nodes. Node 1 is the seller using the default wallet account. Nodes 2-10 will be the buyers. How can I do that by the deployed contract? Which functions should I call and what parameters are accepted?

Nodes 2-10 are already peers of node 1 and have the synced blockchain already.

Apologies for the long message, any help is greatly appreciated. Thank you very much.


Sign In or Register to comment.