Skip to content

Latest commit

 

History

History
200 lines (150 loc) · 5.27 KB

DOCS.md

File metadata and controls

200 lines (150 loc) · 5.27 KB

Alumi - @pocinnovation/alumi

  • Node Version: v20.11.1

Resource

Important

Each resources need an accountEnvName variable that specify the environment variable name. This environment variable will be used to interact with aleph.

The format of this variable must be PROVIDER_NAME:METHOD:VALUE

Provider Method Value
AVALANCHE PRIVATEKEY privatekey
TEZOS PRIVATEKEY privatekey
ETHERUM MNEMONIK passphrase
ETHERUM PRIVATEKEY privatekey
COSMOS MNEMONIK passphrase
COSMOS PRIVATEKEY privatekey
NULS2 MNEMONIK passphrase
NULS2 PRIVATEKEY privatekey
SUBSTRATE MNEMONIK passphrase
SUBSTRATE PRIVATEKEY privatekey

Note

Only ETHERUM with MNEMONIK has been tested.

Post

Post content to aleph

import { Post } from "@pocinnovation/alumi";
import { ItemType } from "aleph-sdk-ts/dist/messages/types";

export const messageTest = new Post('messageTest', {
  content: {
    body: 'Hello world! (updated)',
    tags: 'Test',
  },
  postType: 'alumi-test',
  channel: 'pulumi-test-channel',
  accountEnvName: 'ETH_ACCOUNT_MNEMONIC',
  storageEngine: ItemType.inline,
  ref: '',
});
export const messageTestExplorer = messageTest.aleph_explorer_url;
Links

StoreString

Store a String as a File to aleph

import { StoreString } from "@pocinnovation/alumi";
import { ItemType } from "aleph-sdk-ts/dist/messages/types";

export const stringStored = StoreString("stringStored", {
    stringContent: "Hello World",
    stringContentMimeType: "text/plain",
    storageEngine: ItemType.storage,
    channel: "pulumi-test-channel",
    accountEnvName: "ETH_ACCOUNT_MNEMONIC",
});
export const stringStoredUrl = stringStored.raw_file_url;
Links

StoreFile

Store File to aleph

import { StoreFile } from "@pocinnovation/alumi";
import { ItemType } from "aleph-sdk-ts/dist/messages/types";

export const fileIndexJs = new StoreFile('indexJs', {
  filePath: './src/index.ts',
  channel: 'pulumi-test-channel',
  accountEnvName: 'ETH_ACCOUNT_MNEMONIC',
  storageEngine: ItemType.storage,
});
export const fileIndexUrl = fileIndexJs.raw_file_url;
Links

Aggregate

Store Key-Value pair

import { Aggregate } from "@pocinnovation/alumi";
import { ItemType } from "aleph-sdk-ts/dist/messages/types";

export const keyValue = new Aggregate('keyValue', {
  key: 'abc',
  content: {
    test: 'def',
    ooo: 'ooo',
  },
  channel: 'pulumi-test-channel',
  storageEngine: ItemType.inline,
  accountEnvName: 'ETH_ACCOUNT_MNEMONIC',
});
export const keyValueExplorer = keyValue.aleph_explorer_url;
Links

securityKey

It is wrapper around Aggregate

import { securityKey } from "@pocinnovation/alumi";
import { ItemType } from "aleph-sdk-ts/dist/messages/types";

export const secuKey = securityKey('key', {
  authorizations: [
    {
      address: process.env.ADDRESS_SECU_GIVE || '',
      types: ['POST'],
      post_types: ['alumi-test'],
      channels: ['pulumi-test-channel'],
    },
  ],
  storageEngine: ItemType.inline,
  accountEnvName: 'ETH_ACCOUNT_MNEMONIC',
});
export const secuKeyExplorer = secuKey.aleph_explorer_url;
Links

See also links from Aggregate.

Program (Aleph VM)

program = new Program('program-basic', {
  channel: 'pulumi-test-channel',
  path: './basicprogram/main.py',
  entryPoint: 'main:app',
  memory: 128,
  runtime: getDefaultRuntime(),
  volumes: [],
  storageEngine: ItemType.storage,
  accountEnvName: 'ETH_ACC_PERSO',
});
programVmUrl = program.aleph_vm_url;
programExplorer = program.aleph_explorer_url;
Links

Instance

In development.

It is still beta.

Some code is present for when it will be possible.