Skip to main content

GLOs

A Generic Ledger Operation (GLO) defines a standard, language-agnostic interface to define operations that can be performed on any Distributed Ledger Technology (DLT).

GLOs insulate developers from the nitty gritty details of interacting with blockchain, allowing developers to focus on the application business logic and less on going through steep learning curves and specifics for each DLTs in use.

To dive deeper into how GLOs are defined, refer to the GLO specification.

Supported operations

With MARCO, you can execute the following operations on any supported DLTs:

  • transfer: Transfer of native currency funds.
  • contract_call: Call a method of a deployed smart contract.
  • contract_deploy: Deploy a smart contract.

GLO translation process

The endpoint Send Operation accepts GLOs, transforms them into Ledger Specific Operations (LSO), and runs them on the underlying DLT network.

graph LR MARCO(GLO Resolver) GLO(GLO) ETHLSO(Eth LSO) HLFLSO(HLF LSO) LSO(LSO) ETH(Ethereum) HLF(HyperLedger Fabric) OTHERS(Others) GLO --> MARCO MARCO --> ETHLSO MARCO --> HLFLSO MARCO --> LSO ETHLSO --> ETH HLFLSO --> HLF LSO --> OTHERS

GLO translation process

Examples

Transfer operation

Transfer operation using MARCO resolvable attribute WAL-62EPFgDCGOM on the resource field. This operation transfers 66 native tokens to the address resolved. Since it is an Ethereum operation, it also sets the native attribute gasPrice to 0.

{ 
"version": "0.1.0",
"type": "transfer",
"options": {
"recipient": {
"lookup_service": {
"type": "marco",
"value": "marco"
},
"resource": "WAL-62EPFgDCGOM"
},
"amount": 66
},
"meta": {
"ledger": {
"ethereum": {
"version": "0.0.1",
"native_transaction_content": {
"gasPrice": 0
}
}
}
}
}

Transfer operation using Ethereum's native attribute 0xfea8e07b145bb611a4b5ab5c015f3cc3644c083a on resource field.

{ 
"version": "0.1.0",
"type": "transfer",
"options": {
"recipient": {
"lookup_service": {
"type": "ledger",
"value": "ethereum"
},
"resource": "0xfea8e07b145bb611a4b5ab5c015f3cc3644c083a"
},
"amount": 0
}
}

Contract call operation

Contract call operation using MARCO resolvable attribute SCI-8FbUlJFG-VY on resource field. This operation calls the method mint of the contract with the argument my-nft.

{
"version":"0.1.0",
"type":"contract_call",
"options":{
"contract_instance":{
"lookup_service":{
"type":"marco",
"value":"marco"
},
"resource":"SCI-8FbUlJFG-VY"
},
"method_name":"mint",
"args":[
"my-nft"
]
},
"meta":{

}
}

Contract deploy operation

Contract deploy operation using MARCO resolvable attribute SCT-oNO0BYzLnho:0.0.1 on resource field.

{ 
"version": "0.1.0",
"type": "contract_deploy",
"options": {
"contract_source": {
"lookup_service": {
"type": "marco",
"value": "marco"
},
"resource": "SCT-oNO0BYzLnho:0.0.1"
},
},
"args": [
"Hello World!"
]
}

See also