Skip to content

gipsh/basic-contract-interaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basic-contract-interaction

API example for talking with a smart-contract deployed on polygon

Config

Copy example.env to app.env and config the private key

cp example.env app.env

Run

First compile

go  build

Then run

./basic-contract-interaction

Test

Get product by id

curl http://localhost:8080/product/17
{
  "Name": "newprod",
  "Status": 1,
  "Owner": "0x08f5f9a336aae6a72c795ddf307864b13d13f0aa",
  "NewOwner": "0x08f5f9a336aae6a72c795ddf307864b13d13f0aa"
}

Get delegated products from a wallet

curl http://localhost:8080/products/0xCF6380c9B128941d20d9F812dA406A79424b4B7B
{
    "address": "0xCF6380c9B128941d20d9F812dA406A79424b4B7B",
    "products": [
        "34",
        "35",
        "37"
    ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published