All Projects → kadena-io → pact-todomvc

kadena-io / pact-todomvc

Licence: other
Demo of integrating a JS webapp with the Pact smart contract langauge

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to pact-todomvc

hypermint
Tendermint-based blockchain that supports WebAssembly smart contract
Stars: ✭ 55 (+175%)
Mutual labels:  smart-contracts
idex-sdk-js
IDEX v3 SDK built with TypeScript, supporting both web and Node environments.
Stars: ✭ 35 (+75%)
Mutual labels:  smart-contracts
starter-kit-gsn
An OpenZeppelin starter kit focused on GSN.
Stars: ✭ 39 (+95%)
Mutual labels:  smart-contracts
solidity-contracts
📦 Resources for the Ethereum Smart Contract Development tutorial series.
Stars: ✭ 64 (+220%)
Mutual labels:  smart-contracts
bytecode-verifier
Compile Solidity source code and verify its bytecode matches the blockchain
Stars: ✭ 78 (+290%)
Mutual labels:  smart-contracts
quipuswap-core
🧙‍♂️ Repository containing QuipuSwap liquidity protocol smart-contracts written in Ligo language
Stars: ✭ 48 (+140%)
Mutual labels:  smart-contracts
AirdropCentral
An AirdropCentral where anyone can submit tokens to be distributed among users
Stars: ✭ 62 (+210%)
Mutual labels:  smart-contracts
blockchain-development
A complimentary course for an understanding of blockchain and its development like custom blockchain, dapps, etc.
Stars: ✭ 71 (+255%)
Mutual labels:  smart-contracts
create-truffle-dapp
Create and deploy Truffle projects with no configuration.
Stars: ✭ 17 (-15%)
Mutual labels:  smart-contracts
proof-of-existence
Ethereum Smart Contract to prove a document's existence at some point by storing and verifying its hash.
Stars: ✭ 22 (+10%)
Mutual labels:  smart-contracts
Simple-Game-ERC-721-Token-Template
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮
Stars: ✭ 83 (+315%)
Mutual labels:  smart-contracts
soldoc
A solidity documentation generator, based in NatSpec format. 📃 with standalone HTML, pdf, gitbook and docsify output ✏️ just plug and play.
Stars: ✭ 54 (+170%)
Mutual labels:  smart-contracts
heimdall
Ethereum Smart Contracts Security Monitoring
Stars: ✭ 18 (-10%)
Mutual labels:  smart-contracts
starter-kit-tutorial
An OpenZeppelin starter kit tutorial containing React, OpenZeppelin SDK & OpenZeppelin Contracts.
Stars: ✭ 34 (+70%)
Mutual labels:  smart-contracts
bcdhub
Better Call Dev backend
Stars: ✭ 30 (+50%)
Mutual labels:  smart-contracts
archethic-node
Official Archethic Blockchain node, written in Elixir
Stars: ✭ 42 (+110%)
Mutual labels:  smart-contracts
haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (+380%)
Mutual labels:  smart-contracts
TZComet
Contract Metadata Viewer on Tezos
Stars: ✭ 24 (+20%)
Mutual labels:  smart-contracts
create-ether-dapp
A template for building Full-Stack Blockchain Dapps using Next.js (React), TypeScript, Tailwind CSS, Hardhat, Solidity, and many more!
Stars: ✭ 100 (+400%)
Mutual labels:  smart-contracts
mStable-contracts
📃 Smart Contracts that make up the core of the mStable protocol
Stars: ✭ 277 (+1285%)
Mutual labels:  smart-contracts

Pact Smart Contract Language TodoMVC demo

Setup

  • Install Pact >= 3.0.0
    • brew install kadena-io/pact/pact
  • Install Node >= 8.11.4
  • Install All Dependencies. The dependencies include Pact Lang API.
    • npm install
  • Navigate into pact-todomvc and create a log folder in the top-level folder mkdir log

Scripts

npm run start:pact: Start the Pact Server

npm run pact:seed: Seed the blockchain

npm start: Start the Web Application

Starting the Project

  1. npm run start:pact
  2. npm run pact:seed
  3. npm start
  4. http://localhost:3000

Using the Pact Dev Server

Configuration File

The pact dev server (pact-serve) requires a configuration Yaml file (e.g. server.conf) to operate. The documentation for it is:

➜  pact git:(feat/dev-server) pact --serve --help
Config file is YAML format with the following properties:
port       - HTTP server port
persistDir - Directory for database files.
             If ommitted, runs in-memory only.
logDir     - Directory for HTTP logs
pragmas    - SQLite pragmas to use with persistence DBs
verbose    - [True|False] Provide extra logging information

Initializing the server

When running pact-serve with persistence enabled the development server will automatically replay from disk when it starts. In this demo, we are persisting to log/ which causes pact-serve to create or use log/commands.sqlite to store Commands and CommandResults.

The first time you run pact-serve the SQLite DBs will be created empty (as no commands have been run yet). To upload todos.pact, which the front end needs loaded to interact with, you run initialize-todos.sh. The important thing to note is that until you delete log/commands.sqlite (or run pact-serve in memory) pact-serve will replay every command (e.g. load todos.pact -> UI interactions) on start up.

If you think of it like a blockchain, deleting the commands.sqlite file or running in memory gives Pact a "fresh" chain to work with.

Credit

The front-end of this app was built on React TodoMVC example.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].