Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Orbs Client SDK Go

Client SDK for the Orbs blockchain in golang


  1. Create a few end user accounts:

    sender, err := orbs.CreateAccount()
    receiver, err := orbs.CreateAccount()
  2. Create a client instance:

    const virtualChainId = 42
    client := orbs.NewClient("", virtualChainId, codec.NETWORK_TYPE_TEST_NET)
  3. Send a transaction:

    tx, txId, err := client.CreateTransaction(
        uint64(10), receiver.AddressAsBytes())
    response, err := client.SendTransaction(tx)
  4. Check the transaction status:

    response, err := client.GetTransactionStatus(txId)
  5. Call a smart contract method:

    query, err = client.CreateQuery(
    response, err := client.SendQuery(query)


  1. Make sure Go is installed (version 1.10 or later).

    Verify with go version

  2. Get the library into your Go workspace:

    go get -u
  3. Import the client in your project:

    import "" 


  1. Run end to end test together with Gamma server:

    go test ./test/e2e
  2. Run all tests:

    go test ./...
  3. Run codec contract test (generate output.json as this is the reference implementation):

    cd ./test/codec/
    go run main.go

Alternative Client SDK Implementations

Creating alternative client SDK implementations is highly encouraged, particularly in languages not supported by the core team. To make sure your client implementation is compliant to the Orbs protocol specificiations, we've created a set of compliance tests.

Codec contract test

The codec is the part that encodes and decodes protocol messages. The contract is created by the reference implementation (this repo) and embodied into an input JSON file and an output JSON file.

To run the contract test in your own implementation, encode/decode the messages according to input.json and compare your results to output.json. You can generate the JSON files from code by running

cd ./test/codec/
go run main.go

End to end test with Gamma server

Gamma server is a local development server for the Orbs network that can run on your own machine and be used for testing. This server can process smart contract deployments and transactions. The server is accessed via HTTP (just like a regular node) which makes it excellent for testing clients.

Take a look at the example e2e test implemented in this repo.

Example compliant implementation

The JavaScript alternative implementation is a great source for inspiration. It contains both a codec contract test and an end-to-end test.