Skip to content

0xweb-org/examples-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain-as-a-Backend

This repository demonstrates how a smart contract can function as a REST-like endpoint for frontend applications. It also serves as a CI pipeline for publishing the 0xweb package, streamlining the development and deployment process.

Further reading https://dev.kit.eco/blockchain-as-a-backend


CircleCI


# Create account
npx 0xweb accounts new -n tester --pin test --login

# Fund tester
npx 0xweb hardhat setBalance tester 2ether --pin test

# Deploy contract or check if the bytecode has not been not changed
npx 0xweb deploy ./contracts/AppVersionManager.sol --chain hardhat --pin test


# Update title
npx 0xweb c write AppVersionManager updateInfo --newTitle MySuperApp --pin test


# Update package
npx 0xweb c write AppVersionManager updatePackage --arg0 'load(./data/package.json)' --pin test

# Read title
npx 0xweb c read AppVersionManager title


# Execute TypesScript test script
npx ts-node test/check.ts --pin test


# Change generation to JavaScript
npx 0xweb config --set settings.generate.target=js


# Create contracts JavaScript client
npx 0xweb install ./contracts/AppVersionManager.sol --name AppVersionManager --chain hardhat


# Execute JavaScript test script
npx node test/check.mjs --pin test


# Execute CJS script to get block
npx node test/check.js --pin test

🏁 0xweb.org

About

Blockchain-as-a-Backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published