MEM
WebsiteLabsGuides
  • โš—๏ธMolecular Execution Machine
  • ๐Ÿ‘‹Introduction
    • What is MEM?
    • MEM features
    • MEM vs alternatives
    • Technical architecture
    • Use-case examples
  • โšกQuickstart
    • Quickstart guide
  • ๐Ÿ“–MEM Specifications
    • Function syntax
    • Function specs
    • Transaction specs
    • Supported languages
    • About MIPs
  • โš›๏ธMolecules
    • Overview
    • Multichain authentication
    • Using APIs
    • API reference
  • ๐ŸงชMEM IDE
    • Overview
    • Function ABI
  • โš’๏ธMEM Carbon Testnet
    • Overview
    • Deploy to testnet
    • Interact with testnet functions
  • โš™๏ธMEM SDK
    • SDK Usage
  • ๐Ÿ–ฅ๏ธMEM CLI
    • Function deployment
    • Function interaction
  • ๐Ÿ—๏ธMEM API
    • Overview
    • Write operations
    • Read operations
  • โš›๏ธ3EM-MEM
    • Overview
    • EXM API
    • Key-Value Storage (KVS)
  • ๐ŸงฉExamples
    • Pastebin clone
    • Query onchain data
Powered by GitBook

mem.tech ยฉ 2023

On this page
  • Option A: Testnet interaction with the CLI
  • Option B: Testnet interaction with a script
  1. MEM Carbon Testnet

Interact with testnet functions

There are two options to interact with a function to the MEM Carbon Testnet -- with the CLI or with a custom script.

Option A: Testnet interaction with the CLI

Install the MEM CLI

npm i -g mem-cli-js

Deploy a function

mem write --function-id [MEM function ID] --inputs [the function interaction stringified inputs object]

Read more in the CLI docs

Option B: Testnet interaction with a script

import axios from 'axios';

const TESTNET_ENDPOINT = "https://mem-testnet.xyz/write";

async function write() {
  try {
    const input = '{"function": "something"}'; // example: '{"function": "increment"}'
    const function_id = "your_function_id";

    const body = {
      input,
      function_id,
    };
    const result = (await axios.post(TESTNET_ENDPOINT, body))?.data;
    console.log(result);
    return result;
  } catch (error) {
    console.log(error);
  }
}
PreviousDeploy to testnetNextSDK Usage

Last updated 1 year ago

โš’๏ธ