Hello Module

Author: Accord Project

hellomodule@0.7.0 Clause ^0.21.0 968fc9a3b8bb693eccf523fc166f1fc92547967e99925b672dfbe5d0ea60772e

This is the Hello World of Accord Project Templates, with two Ergo modules.

Download Archive Download Compiled Archive Open in Template Studio Open in VSCode Web

Hello Module

This is the Hello World of Accord Project Templates, with two Ergo modules.

Template Text

Name of the person to greet: "Fred Blogs". Thank you!

Name of the person to greet: "Fred Blogs".
Thank you!
Name of the person to greet: {{name}}.
Thank you!
{
    "$class": "org.accordproject.hellomodule.HelloModuleClause",
    "name": "Fred Blogs",
    "clauseId": "84b4259d-44e5-4e96-af5e-74b50b5ec322"
}

Template Model

namespace org.accordproject.hellomodule

import org.accordproject.cicero.contract.* from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.runtime.* from https://models.accordproject.org/cicero/runtime.cto

transaction MyRequest extends Request {
  o String input
}

transaction MyResponse extends Response {
  o String output
}

/**
 * The template model
 */
asset HelloModuleClause extends AccordClause {
  /**
   * The name for the clause
   */
  o String name
}

// this is a change!

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "6ad5bec0-cd1d-11ea-920c-ade26666d144"
}

Request Types

Type Sample JSON
org.accordproject.hellomodule.MyRequest
{
    "$class": "org.accordproject.hellomodule.MyRequest",
    "input": "Excepteur cillum.",
    "transactionId": "6ad597b0-cd1d-11ea-920c-ade26666d144",
    "timestamp": "2020-07-23T15:48:01.835-04:00"
}

Response Types

Type Sample JSON
org.accordproject.hellomodule.MyResponse
{
    "$class": "org.accordproject.hellomodule.MyResponse",
    "output": "Quis.",
    "transactionId": "6ad597b1-cd1d-11ea-920c-ade26666d144",
    "timestamp": "2020-07-23T15:48:01.835-04:00"
}

Events Types

Type Sample JSON
org.accordproject.base.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

Please refer to the Cicero documentation for details and examples of how to integrate a call to a Cicero template into your application.

View the Latest code for this template on GitHub.