- Notifications
You must be signed in to change notification settings - Fork78
A Scala based client for Ethereum-like Blockchains.
License
input-output-hk/mantis
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Ethereum-like Blockchain Scala client built by IOHK's for Ethereum Classic (ETC) network
The lastest ETC hard-fork supported by the client isMagneto hard-fork
You can check the latest build results of the current branch by clicking the status icon in the header of the Github file browser.
The latest release can be downloaded fromhere
In thebin directory, you can find the generic launcher. To connect to a pre-configured network just pass the network name as a parameter.
Example:
./bin/mantis-launcher etc- for joining Ethereum Classic network
Possible networks:etc,eth,mordor,testnet-internal
cli is a tool that can be used to:
- generate a new private key
./bin/mantis cli generate-private-key- derive an address from private key
./bin/mantis cli derive-address 00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d0- generate genesis allocs (using private keys and/or addresses)
`./bin/mantis cli generate-allocs --balance=42 --address=8b196738d90cf3d9fc299e0ec28e15ebdcbb0bdcb281d9d5084182c9c66d5d12 --key=00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d1`- generate multiple key-pairs (following example generate 5 key-pairs)
./bin/mantis cli generate-key-pairs 5- encrypt private key (default passphrase is empty string)
./bin/mantis cli encrypt-key --passphrase=pass 00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d0The command output uses the same format as the keystore so it could be used ex. to setup 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", "kdfparams":{ "salt":"cdcc875e116e2824ab02f387210c2f4ad7fd6fa1a4fc791cc92b981e3062a23e", "n":262144, "r":8, "p":1, "dklen":32 }, "mac":"8388ae431198d31d57e4c17f44335c2f15959b0d08d1145234d82f0d253fa593" }}As an alternative to downloading the client, build the client from source.
- JDK 1.8 (download fromjava.com)
- sbt (download sbt)
- python 2.7.15 (download frompython.org)
In the root of the project:
git submodule update --recursive --initsbt distThis updates all submodules and creates a distribution zip in~/target/universal/.
Note: building indev mode allows faster and incremental compilation, for this:
- set environment variable
MANTIS_DEVtotrue, or - use the system property
-DmantisDev=true
In the root of the project:
nix-buildThis project uses Nix for CI, deployment and, optionally, local development.Some of the dependencies are not available for Darwin (macOS) however. To workwith Nix on a Mac you can instead use Docker via thenix-in-docker/run script,which will start anix-shell with the same environment as CI.
When updating project dependencies, the nix fixed-output-derivationwill need to be updated so that it includes the new dependency state.
To do so, please run:
./update-nix.shgit add ./nix/overlay.nixgit commit -m "Update nix-sbt sha"For this command to work you'll need theFlakes feature enabled in yournix environment.
NOTE: This should only be necessary when updating dependencies(For example, edits to build.sbt or project/plugins.sbt will likely need to be regenerated)
A docker-compose setup using Prometheus and Grafana, and a preconfigured dashboard, is available.As a precondition you need to have docker and sbt installed.Before running the script, you need to enable metrics by editing the filemetrics.conf and settingmantis.metrics.enabled=true
To build the monitoring, run the following script at./docker/mantis/build.sh.This script builds a docker image of mantis using the local sources and starts the docker-compose.
Grafana will be available athttp://localhost:3000 (using user and password: admin and admin) with a dashboard calledMantis.
Both the JSON RPC (on the node and faucet) can be additionally protected using TLS.The development environment it already properly configured with a development certificate.
If a new certificate is required, create a new keystore with a certificate by running./tls/gen-cert.sh
Configure the certificate and password file to be used at
mantis.network.rpc.http.certificatekey on theapplication.conffile:keystore-path: path to the keystore storing the certificates (if generated through our script they are by default located in "./tls/mantisCA.p12")
keystore-type: type of certificate keystore being used (if generated through our script use "pkcs12")
password-file: path to the file with the password used for accessing the certificate keystore (if generated through our script they are by default located in "./tls/password")
Enable TLS in specific config:
- For JSON RPC:
mantis.network.rpc.http.mode=https
- For JSON RPC:
Configure the certificate and password file to be used at
mantis.network.rpc.http.certificatekey on thefaucet.conffile:keystore-path: path to the keystore storing the certificates (if generated through our script they are by default located in "./tls/mantisCA.p12")
keystore-type: type of certificate keystore being used (if generated through our script use "pkcs12")
password-file: path to the file with the password used for accessing the certificate keystore (if generated through our script they are by default located in "./tls/password")
Enable TLS in specific config:
- For JSON RPC:
mantis.network.rpc.http.mode=https
- For JSON RPC:
Configure the certificate used from RpcClient to connect with the node. Necessary if the node uses http secure.This certificate and password file to be used at
faucet.rpc-client.certificatekey on thefaucet.conffile:keystore-path: path to the keystore storing the certificateskeystore-type: type of certificate keystore being used (if generated through our script use "pkcs12")password-file: path to the file with the password used for accessing the certificate keystore
- First start a client node using the docker-compose, by running the script found at
./docker/mantis/build.shModify the script before running it by adding thevolumesandcommandsections to mantis configuration:
mantis:image: mantis:latestports:- 8546:8546- 13798:13798- 9095:9095networks:- mantis-netvolumes:- $HOME/.mantis:/home/demiourgos728/.mantis/command: -Dconfig.file=./conf/sagano.conf- Create a wallet address. Run the following curl command, replacing
<password>by 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": ["<password>"], "id": 1}'You will receive a response like this:
{"jsonrpc":"2.0","result":"<address>","id":1}- Modify
src/universal/conf/faucet.conffile, config your account address created in the previous step. with the password choosen by you:
wallet-address = "<address>"wallet-password = "<password>"- Now check the
keystorefolder in~/.mantis/testnet-internal-nomad/keystore.Inside you will find a key generate with the curl request sent in step2.. Copy that file to~/.mantis-faucet/keystore/:
cp UTC--<date>--<key> ~/.mantis-faucet/keystore/- Start the faucet in command line:
sbt -Dconfig.file=src/universal/conf/faucet.conf "run faucet"- 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": ["<address>"], "id": 1}'Happy transfer!
Note: In order for the transfer transaction be persisted, a faucet needs sufficient founds in its account and in this testcase a new faucet, without ETC tokens, is being created.
Feedback gratefully received through the Ethereum Classic Forum (http://forum.ethereumclassic.org/)
There is a list of known issues in the 'RELEASE' file located in the root of the installation.
About
A Scala based client for Ethereum-like Blockchains.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.