# IC-Go: go agent for internet computer

**URL:** <https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286>\
**Category:** Developers\
**Tags:** Functional-Programming\
**Created:** [January 14, 2022, 11:07am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286 "2022-01-14T11:07:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyd](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pyd](https://forum.dfinity.org/u/pyd)\
**Post date:** [January 14, 2022, 11:07am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/1 "2022-01-14T11:07:38Z")

</div>

Hi~We have built the Go agent for IC: [IC-Go](https://github.com/mix-labs/IC-Go)

Here is the beta version of go agent for IC

Welcome to use our codes to do more explores by Golang on IC

Please send us the issues you found, thanks!

---

<div class="post-metadata">

**Author:** ![pyd](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pyd](https://forum.dfinity.org/u/pyd)\
**Post date:** [January 25, 2022, 2:50am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/2 "2022-01-25T02:50:31Z")

</div>

We update some functions:

1. Decode candid bytes directly to go structure;
2. Add get canister info function;

---

<div class="post-metadata">

**Author:** ![0x000000000000000](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/0x000000000000000/32/6292_2.png) [@0x000000000000000](https://forum.dfinity.org/u/0x000000000000000)\
**Post date:** [February 11, 2022, 6:49am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/3 "2022-02-11T06:49:18Z")

</div>

Coding problem：

> <https://github.com/mix-labs/IC-Go/issues/3>
>
> For example, code such a structure:
> 
> type Transaction = record{
> to: pr…incipal;
> amount: nat;
> token\_canister: principal;
> };
> 
> type Block = record {
> propose\_id: nat;
> transactions: vec Transaction;
> };
> 
> When using rust encode! When encoding, the result is：
> 4449444c036c02d581cdb40c01bccbd5d00e786d026c03fbca0168eddeb5e10468d8a38ca80d7d010001011deb201ef87230c51f33f64b191e8f336f36f6f7119da10f1b6d1e989f02010a00000000000000050101904e0700000000000000
> 
> When encoding with golang encode, the result is：
> 4449444c036c03fbca0168eddeb5e10468d8a38ca80d7d6d006c02d581cdb40c01bccbd5d00e7d010201011deb201ef87230c51f33f64b191e8f336f36f6f7119da10f1b6d1e989f02010a00000000000000050101904e07
> 
> Golang code：
> \<img width="650" alt="截屏2022-02-11 下午2 41 41" src="https://user-images.githubusercontent.com/92365829/153547876-db54f4d6-c8e3-4484-a684-a3fd61e67afa.png"\>

---

<div class="post-metadata">

**Author:** ![pyd](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pyd](https://forum.dfinity.org/u/pyd)\
**Post date:** [February 14, 2022, 5:23am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/4 "2022-02-14T05:23:49Z")

</div>

can you query canister successfully? sometimes the same struct may be encode into different bytes

---

<div class="post-metadata">

**Author:** ![0x000000000000000](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/0x000000000000000/32/6292_2.png) [@0x000000000000000](https://forum.dfinity.org/u/0x000000000000000)\
**Post date:** [February 14, 2022, 5:47am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/5 "2022-02-14T05:47:59Z")

</div>

Canisters cannot be called. Error reason: call poll fail with status rejected

---

<div class="post-metadata">

**Author:** ![pyd](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pyd](https://forum.dfinity.org/u/pyd)\
**Post date:** [February 14, 2022, 6:03am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/6 "2022-02-14T06:03:34Z")

</div>

can you provide candid file and the function you called. i

---

<div class="post-metadata">

**Author:** ![0x000000000000000](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/0x000000000000000/32/6292_2.png) [@0x000000000000000](https://forum.dfinity.org/u/0x000000000000000)\
**Post date:** [February 14, 2022, 6:17am UTC](https://forum.dfinity.org/t/ic-go-go-agent-for-internet-computer/10286/7 "2022-02-14T06:17:44Z")

</div>

candid:

type Transaction = record{  
to: principal;  
amount: nat;  
token\_canister: principal;  
};

type Block = record {  
propose\_id: nat;  
transactions: vec Transaction;  
};

service:{  
“propose”:(Block) -\>(nat);  
}
