Getting started

This guide explains how to set up ACTUS Protocol and develop with it. It's the ACTUS Protocol "Hello World" equivalent.

The provided instructions have been tested on macOS and Ubuntu. If you run into any issues with your setup - let us now on Discord.

This guide uses the current version of ACTUS Protocol smart contracts deployed on Goerli Testnet. To see a full working example of the Typescript SDK check out our example repository.

Install prerequisites

You should be on a linux compatible shell with basic dev tools like git installed. The ACTUS Protocol dev environment is most easily setup with yarn.

  • Install node e.g. via nvm (tested on version 10.16.0)

  • Install yarn e.g. as a global npm package via npm install yarn --global

Create a new project

If you've configured everything correctly you should be able to create a new project and install the package via the following commands.

mkdir ap-tutorial && cd ap-tutorial
yarn init -y # initalize a default project
yarn add @atpar/protocol

Getting started with the Typescript SDK

To initialize the project, set your web3 provider (e.g. Infura, or a local Ethereum node) and the default account which should be used for signing transactions and orders.

import Web3 from 'web3.js'; 
import { AP } from '@atpar/protocol';

// connecting to Rinkeby Testnet via infura
const web3 = new Web3(new Web3.providers.Web3SocketProvider('wss://rinkeby.infura.io/ws/v3/<PROJECT_ID>'));

const defaultAccount = (await web3.eth.getAccounts())[0];

const ap = await AP.init(web3, ADDRESS_BOOK);

Last updated