go install github.com/aviate-labs/agent-go/cmd/goic
goic version
# 0.0.1
To generate an agent you will need the .did
file. Some interface specifications can be fetched directly from a
canister through the __get_candid_interface_tmp_hack
endpoint (this gets exposed by default w/ Motoko). Based on this
file an agent can be generated.
The generate
command can be customized by defining a custom output
or packageName
flag.
goic generate did {PATH_TO_DID} {NAME}
goic fetch ryjl3-tyaaa-aaaaa-aaaba-cai --output=ledger.did
goic generate did ledger.did ledger --output=ledger.go --packageName=main
go fmt ledger.go
OR
goic generate remote {CANISTER_ID} {NAME}
goic generate remote ryjl3-tyaaa-aaaaa-aaaba-cai ledger --output=ledger.go --packageName=main
go fmt ledger.go