Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/7i7o/warp-example

Basic Warp Contract example
https://github.com/7i7o/warp-example

Last synced: about 1 month ago
JSON representation

Basic Warp Contract example

Awesome Lists containing this project

README

        

# Basic Warp Contract example

## Install dependencies

```bash
yarn
```

## Create a throwaway wallet

```bash
node -e "require('arweave').init({}).wallets.generate().then(JSON.stringify).then(console.log.bind(console))" > wallet.json
```

## Deploy the contract

```bash
node scripts/deploy.js
```

> This displays the transaction id of the contract deployed, take note of it and paste it in the `scripts/readState.js` and `scripts/add.js`files

## Read the state of the contract

Remember to copy the contract tx id before you call `readState` or `add` !

```bash
node scripts/readState.js
```

## Call the `add` function

```bash
node scripts/add.js
```