GithubHelp home page GithubHelp logo

useverto / smartweave Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arweaveteam/smartweave

0.0 2.0 0.0 390 KB

Simple, scalable smart contracts on the Arweave protocol.

JavaScript 18.81% TypeScript 81.19%

smartweave's Introduction

SmartWeave

Gitopia

Simple, scalable smart contracts on the Arweave protocol

Uses lazy-evaluation to move the burden of contract execution from network nodes to smart contract users. Currently, SmartWeave supports JavaScript, using the client's unmodified execution engine.

Version: 0.3

For information on how the contracts execute, how to write one, and the API, read the Contract Guide and check some of the examples

For information on how to create a new PST token, you can read the PST Creation Guide.

For a description of the SDK methods available, you can check here

CLI Usage

npm install -g smartweave

You can deploy a contract as follows:

smartweave create [SRC LOCATION] [INITIAL STATE FILE] --key-file [YOUR KEYFILE]

Or, using an existing contract source that is already deployed but with a new initial state and contract id:

smartweave [SRC TX] [INITIAL STATE FILE] --key-file [YOUR KEYFILE]

Check its state:

smartweave read [CONTRACT TXID]

Interact with it:

smartweave write [CONTRACT TXID] --key-file [YOUR KEYFILE] \
  --input "[CONTRACT INPUT STRING HERE]"

When interacting with the contract, the value passed to --input must be valid json. Typically an object is used:

--input '{ "function": "transfer", "qty": 1984 }'

To test a contract interaction without writing it to the network, append --dry-run to your --interact call.

License

This project is licensed under the terms of the MIT license.

smartweave's People

Contributors

cedriking avatar aidanok avatar samcamwilliams avatar artob avatar jespern avatar littledivy avatar

Watchers

James Cloos avatar  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.