Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
147 lines (113 sloc) 3.46 KB
id title
setup
Install

Marmo library is available in Java, Javascript and Python, the library has pre-loaded the configuration to interact with Marmo in the Ropsten testnet and Ethereum Mainnet.

Javascript

pip install marmopy
npm install marmojs

Gradle

compile ('network.marmoj:core:0.1.0')

Maven

<dependency>
    <groupId>network.marmoj</groupId>
    <artifactId>core</artifactId>
    <version>0.1.0</version>
</dependency>

Configuration

In order to use Marmo in different networks and different versions of Marmo, is required to specify a configuration to use. The Marmo-SDK already contains configurations ready to roll on different networks.

Global configuration

If the client only needs to interact with a single Marmo configuration in the whole project, the configuration can be defined as default.

from marmopy import DefaultConf

# Select the Ropsten testnet configuration
DefaultConf.ROPSTEN.as_default()
import { DefaultConf } from "marmojs";

// Select the Ropsten testnet configuration
DefaulltConf.ROPSTEN.asDefault();
import network.marmoj.config.DefaultConf;

// Select the Ropsten testnet configuration
DefaultConf.ROPSTEN.asDefault();

An example on how to use local configuration is available, Local configuration

Provider

The provider is the combination of services that are going to be used to talk with the Ethereum network.

Relayer

The Relayer is in charge of wrapping and broadcasting all the signed Intents, is going to be responsible for paying the fees to the Ethereum network.

Ethereum node

The Ethereum node is going to be providing all information about the status of the intents; this node has to be operating in the same network where is deployed the chosen Marmo configuration.

from marmopy import Provider

provider = Provider(
    '<url of the ethereum node>',
    '<url of the relayer>'
)

provider.as_default()
import { Provider } from "marmojs"

provider = new Provider(
    '<url of the ethereum node>',
    '<url of the relayer>'
);
import network.marmoj.config.Provider;

Provider provider = new Provider(
        "<url of the ethereum node>", 
        "<url of the relayer>"
);

The provider can be defined as the global provider,

Sandbox provider

We provide a Relayer and Ethereum Node intended to be used by developers on the Ethereum Ropsten network.

from marmopy import Provider

eth_node = "https://ropsten-node.rcn.loans/"
relayer = "https://marmo-relayer-ropsten.rcn.loans/"

provider = Provider(eth_node, relayer)
import { Provider } from "marmojs";

const ethNode = "https://ropsten-node.rcn.loans/";
const relayer = "https://marmo-relayer-ropsten.rcn.loans/";

provider = new Provider(ethNode, relayer);
import network.marmoj.config.Provider;

String ethNode = "https://ropsten-node.rcn.loans/";
String relayer = "https://marmo-relayer-ropsten.rcn.loans/";

Provider provider = new Provider(ethNode, relayer);
You can’t perform that action at this time.