Coder Social home page Coder Social logo

michaelnetbiz / contractpen_node_client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from contractpendev/contractpen-work-client

0.0 1.0 0.0 279 KB

NodeJS Client for ContractPen

Home Page: https://contractpen.com/

License: Apache License 2.0

Batchfile 3.66% CoffeeScript 80.19% HTML 16.15%

contractpen_node_client's Introduction

ContractPen Node Service

Client programs calls across to api.contractpen.com. This program allows programmers using NodeJS to deploy ContractPen contracts to the accord project specification and will later allow for deploying the contract to the blockchain.

To compile coffeescript

npm run compile

ContractPen

ContractPen is a simple web user interface designed to allow people eventually to deploy legal contracts to the blockchain. The current goal is to integrate ContractPen.com with the Accord Project https://www.accordproject.org/ as this project allows legal contract clauses to execute on the blockchain.

Open Source

Although ContractPen.com is currently closed source, it may become open source in the future. So in that spirit it is useful to encourage open source around the ContractPen API's and integration with other open source projects such as Accord Project.

I encourage you to build open source software around the legaltech software and integration with ContractPen data API's and to learn the Accord Project.

Required software

  1. NodeJS v10.7.0 is the version I am using.

  2. Accord Cicero and Accord Ergo by installing.

npm install -g @accordproject/cicero-cli
npm install -g @accordproject/ergo-cli

From these packages

https://www.npmjs.com/package/@accordproject/cicero-cli

https://www.npmjs.com/package/@accordproject/ergo-cli

  1. Coffeescript as the coffee command https://coffeescript.org/

Creating a Cicero NodeJS program

Here the data in the ContractPen contract is transformed into a Cicero NodeJS program in a folder. The ContractPen contract in use is this one https://contractpen.com/share/b03d0879-1545-4ce9-bd08-7915457ce92c

Cicero project is a Accord Project library, the purpose of this client contractpen_node_client is to allow a ContractPen.com Contracts data to be deployed to a Cicero NodeJS project.

This will take the data models as defined in the ContractPen contract and generate the Cicero data models as files with the extension of .cto in the models directory. Models are defined in the Models menu section of a ContractPen contract.

To run On Windows to deploy a ContractPen contract to a Cicero folder. This first parameter is the GUID of the contract at ContractPen, you can find that in the URL of the contract itself. There is a run.bat batch file.

run deploy b03d0879-1545-4ce9-bd08-7915457ce92c cicerofolder

This will create a folder called cicerofolder and generates a NodeJS project inside this folder. cicerofolder can be any folder name. The project will be similar to the Cicero HelloWorld project here https://github.com/accordproject/cicero-template-library/tree/master/src/helloworld

cd cicerofolder

In this folder you should be able to execute the following without errors.

npm install
cicero parse --template . --dsl sample.txt
cicero execute

About the code

The main class is SetupClient.coffee in src/services directory.

You can see it is referenced in EntryPoint.coffee as

start = ->
  setupServer = Setup.container.resolve 'SetupClient'
  setupServer.setup()

Libraries used

Some libraries are in use to try to help development within NodeJS.

Dependency injection

https://github.com/jeffijoe/awilix

Graph library which is not really used in this project but is added

https://github.com/dagrejs/graphlib/wiki

contractpen_node_client's People

Contributors

contractpendev avatar philandrew avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.