API example for talking with a smart-contract deployed on polygon
Copy example.env
to app.env
and config the private key
cp example.env app.env
First compile
go build
Then run
./basic-contract-interaction
curl http://localhost:8080/product/17
{
"Name": "newprod",
"Status": 1,
"Owner": "0x08f5f9a336aae6a72c795ddf307864b13d13f0aa",
"NewOwner": "0x08f5f9a336aae6a72c795ddf307864b13d13f0aa"
}
curl http://localhost:8080/products/0xCF6380c9B128941d20d9F812dA406A79424b4B7B
{
"address": "0xCF6380c9B128941d20d9F812dA406A79424b4B7B",
"products": [
"34",
"35",
"37"
]
}