Hello Module

Author: Accord Project

hellomodule@0.6.1 Clause ^0.20.10 57ba4a5c3a961841ea82d4007eb71b4ff0996fadc220153d143273732c8b65bc

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

Download Archive Open in Template Studio

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",
    "clauseId": "616560f3-5d88-401d-9c47-bcbe52945f63",
    "name": "Fred Blogs"
}

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": "e209ed80-7b6b-11ea-b280-c173749a9e96"
}

Request Types

Type Sample JSON
org.accordproject.hellomodule.MyRequest
{
    "$class": "org.accordproject.hellomodule.MyRequest",
    "input": "Nulla.",
    "transactionId": "e209c670-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:07.223-04:00"
}

Response Types

Type Sample JSON
org.accordproject.hellomodule.MyResponse
{
    "$class": "org.accordproject.hellomodule.MyResponse",
    "output": "Deserunt adipisicing.",
    "transactionId": "e209c671-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:07.223-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.