Ultimate magazine theme for WordPress.

input-output-hk/mantis: A Scala-based client for Ethereum-like blockchains.

Ethereum-like blockchain Scala client developed by IOHK for the Ethereum Classic (ETC) network

Status – Not Maintained

The latest customer supported ETC hard fork is the Magneto hard fork

You can check the latest build results of the current branch by clicking the status icon in the Github file browser header.

Download the client

The latest version can be downloaded here

command line version

In the bin directory you will find the generic launcher. To connect to a preconfigured network, simply pass the network name as a parameter.

Example:

  • ./bin/mantis-launcher etc – for joining the Ethereum Classic network

Possible networks: etc, eth, mordor, testnet-internal

command line interface

cli is a tool that can be used:

  • generate a new private key

./bin/mantis cli-generate-private-key

  • Derive an address from the private key

./bin/mantis cli derive-address 00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d0

  • Generate Genesis Allocations (using private keys and/or addresses)

`./bin/mantis cli generic-allocs –balance=42 –address=8b196738d90cf3d9fc299e0ec28e15ebdcbb0bdcb281d9d5084182c9c66d5d12 –key=00b11c32957057651d56cd83085ef3b25 93 19057e0e887bd0fdaee657e6f75d1`

  • generate several key pairs (in the following example 5 key pairs are generated)

./bin/mantis cli generic-key-pairs 5

  • Encrypt private key (default passphrase is an empty string)

./bin/mantis cli encrypt-key –passphrase=pass 00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d0

The command output uses the same format as the keystore, so it can be used for example. to set up a private faucet

ex.

{ “id”: “3038d914-c4cd-43b7-9e91-3391ea443f95”, “address”: “c28e15ebdcbb0bdcb281d9d5084182c9c66d5d12”, “version”:3, “crypto”:{ “cipher”: “aes-128-ctr”, “ciphertext “:”6ecdb74b2a33dc3c016b460dccc96843d9d050aea3df27a3ae5348e85b3adc3e”, “cipherparams”:{ “iv”: “096b6490fe29e42e68e2db902920cad6” }, “kdf”: “scrypt”, “kdf para ms”:{ “salt”: “cdcc875e116e2824ab02f387210c2f4ad7fd6fa1a4fc791cc92b981e3062a23e”, “n”:262144, “r “ :8, “p”:1, “dklen”:32 }, “mac”:8388ae431198d31d57e4c17f44335c2f15959b0d08d1145234d82f0d253fa593″ } }

Structure of the client

As an alternative to downloading the client, you can also build the client from source code.

With SBT

Requirements for building
Build the client

In the root of the project:

Git submodule update –recursive –init sbt dist

This will update all submodules and create a distribution zip file in ~/target/universal/.

Note: Building in Dev mode allows faster and incremental compilation. For this reason:

  • Set the MANTIS_DEV environment variable to true, or
  • Use the system property -DmantisDev=true

With nothing

In the root of the project:

Build the client
On a Mac

This project uses Nix for CI, deployment and optional local development. However, some of the dependencies are not available for Darwin (macOS). To work with Nix on a Mac, you can instead use Docker via the nix-in-docker/run script, which launches a Nix shell with the same environment as CI.

Update sbt+nix dependencies

When updating project dependencies, the Nix hard output derivation must be updated to include the new dependency status.

To do this, please do the following:

./update-nix.sh git add ./nix/overlay.nix git commit -m “Update nix-sbt sha”

For this command to work, the Flakes feature must be enabled in your Nix environment.

NOTE: This should only be required when updating dependencies (e.g. changes to build.sbt or project/plugins.sbt will likely need to be regenerated).

monitoring

Create and run a monitoring client locally

A Docker Compose setup with Prometheus and Grafana and a preconfigured dashboard are available. As a prerequisite, Docker and SBT must be installed. Before running the script, you must enable metrics by editing the metrics.conf file and setting mantis.metrics.enabled=true

To build the monitor, run the following script from ./docker/mantis/build.sh. This script builds a Mantis Docker image using the local sources and starts Docker-Compose.

Grafana will be available at http://localhost:3000 (with username and password: admin and admin) with a dashboard called Mantis.

TLS setup

Both the JSON RPC (on the node and on the faucet) can be additionally protected with TLS. The development environment is already properly configured with a development certificate.

Generating a new certificate

If a new certificate is required, create a new keystore with a certificate by running ./tls/gen-cert.sh

Configure the node

  1. Configure the certificate and password file to be used in the mantis.network.rpc.http.certificate key in the application.conf file:

    Keystore Path: Path to the keystore where the certificates are stored (if generated via our script, they are located in “./tls/mantisCA.p12” by default).

    Keystore Type: Type of certificate keystore used (if generated by our script, use “pkcs12”).

    Password file: path to the file containing the password used to access the certificate keystore (when generated via our script, they are located in “./tls/password” by default).

  2. Enable TLS in a specific configuration:

    • For JSON RPC: mantis.network.rpc.http.mode=https

Configure faucet

  1. Configure the certificate and password file to be used in the mantis.network.rpc.http.certificate key in the Faucet.conf file:

    Keystore Path: Path to the keystore where the certificates are stored (if generated via our script, they are located in “./tls/mantisCA.p12” by default).

    Keystore Type: Type of certificate keystore used (if generated by our script, use “pkcs12”).

    Password file: path to the file containing the password used to access the certificate keystore (when generated via our script, they are located in “./tls/password” by default).

  2. Enable TLS in a specific configuration:

    • For JSON RPC: mantis.network.rpc.http.mode=https
  3. Configure the certificate used by RpcClient to connect to the node. Required if the node uses HTTP Secure. This certificate and password file is used in the Faucet.rpc-client.certificate key in the Faucet.conf file:

    Keystore Path: Path to the keystore where the certificates are stored. Keystore Type: Type of certificate keystore used (if generated by our script, use “pkcs12”). Password File: Path to the file containing the password used to access the certificate keystore

Setup and testing of the faucet

  1. First, start a client node with Docker-Compose by running the script at ./docker/mantis/build.sh. Modify the script before running it by adding the volumes and command sections to the Mantis configuration:

mantis: Image: mantis:latest ports: – 8546:8546 – 13798:13798 – 9095:9095 Networks: – Mantis Net Volumes: – $HOME/.mantis:/home/demiourgos728/.mantis/ Command: -Dconfig. file=./conf/sagano.conf

  1. Create a wallet address. Run and replace the following curl command with a password of your choice:

curl –request POST –url http://127.0.0.1:8546/ –header ‘Cache-Control: no-cache’ –header ‘Content-Type: application/json’ –data ‘ { “jsonrpc”: “2.0”, “method”: “personal_newAccount”, “params”: [““]”id”: 1 }’

You will get a response like this:

{“jsonrpc”: “2.0”, “result”:

“”,”id”:1}

  1. Modify the src/universal/conf/faucet.conf file and configure your account address created in the previous step. with your chosen password:

wallet-address = “

” wallet-password = “

  1. Now check the keystore folder in ~/.mantis/testnet-internal-nomad/keystore. Inside you will find a key generated with the curl request sent in step 2. Copy this file to ~/.mantis-faucet/keystore/:

cp UTC– ~/.mantis-faucet/keystore/

  1. Start the faucet in the command line:

sbt -Dconfig.file=src/universal/conf/faucet.conf “run faucet”

  1. Run the following curl command to send tokens from your faucet to a wallet address:

curl –request POST –url http://127.0.0.1:8099/ –header ‘Content-Type: application/json’ –data ‘{ “jsonrpc”: “2.0”, “method”: “faucet_sendFunds”, “params”: [“

“]”id”: 1 }’

Have fun with the transfer!

Note: In order for the transfer transaction to persist, a faucet needs enough funds on its account and in this test case a new faucet will be created without ETC tokens.

Return message

Feedback was gratefully received via the Ethereum Classic Forum (http://forum.ethereumclassic.org/).

known problems

The RELEASE file in the root of the installation contains a list of known issues.

Learn Crypto Trading, Yield Farms, Income strategies and more at CrytoAnswers
https://nov.link/cryptoanswers

Comments are closed.

%d bloggers like this: