Overview

Prerequisites

Go

Match is built using Go version 1.19+. Check your version with:

go version

Once you have installed the right version, confirm that your GOPATH is correctly configured by running the following command and adding it to your shell startup script:

export PATH=$PATH:$(go env GOPATH)/bin

jq

Match scripts are using jq version 1.6+. Check your version with:

jq --version

Installation

You can build and install the matchd binaries from source or using Docker.

Build From Source

Clone and build the Match from source using git. The <tag> refers to a release tag on Github. The latest Match version is :

git clone https://github.com/matchain/match.git
cd match
git fetch
git checkout <tag>
make install

After installation is done, check that the matchd binaries have been successfully installed:

matchd version

Run an Match node

To become familiar with Match, you can run a local blockchain node that produces blocks and exposes EVM and Cosmos endpoints. This allows you to deploy and interact with smart contracts locally or test core protocol functionality.

Run the local node by executing the local_node.sh script in the base directory of the repository:

./local_node.sh

The script stores the node configuration including the local default endpoints under ~/.tmp-matchd/config/config.toml. If you have previously run the script, the script allows you to overwrite the existing configuration and start a new local node.

Once your node is running you will see it validating and producing blocks in your local Match blockchai

12:59PM INF executed block height=1 module=state num_invalid_txs=0 num_valid_txs=0 server=node
# ...
1:00PM INF indexed block exents height=7 module=txindex server=node

For more information on how to customize a local node, head over to the Single Node page.

Using matchd

After installing the matchd binary, you can run commands using:

matchd [command]

There is also a -h, --help command available

matchd -h

It is possible to maintain multiple node configurations at the same time. To specify a configuration use the --home flag. In the following examples we will be using the default config for a local node, located at ~/.tmp-matchd.

Manage wallets

You can manage your wallets using the matchd binary to store private keys and sign transactions over CLI. To view all keys use:

matchd keys list \
--home ~/.tmp-matchd \
--keyring-backend test

# Example Output:
# - address: match19xnmslvl0pcmydu4m52h2gf0std5ee5pfgpyuf
#   name: dev0
#   pubkey: '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"AzKouyoUL0UUS1qRUZdqyVsTPkCAFWwxx3+BTOw36nKp"}'
#   type: local

You can generate a new key/mnemonic with a $NAME with:

matchd keys add [name] \
--home ~/.tmp-matchd \
--keyring-backend test

To export your match key as an Ethereum private key (for use with Metamask for example):

matchd keys unsafe-export-eth-key [name] \
--home ~/.tmp-matchd \
--keyring-backend test

For more about the available key commands, use the --help flag

matchd keys -h

For more information about the Keyring and its backend options, click here.

Interact with a Network

You can use matchd to query information or submit transactions on the blockchain. Queries and transactions are requests that you send to a Match node through the Tendermint RPC.

To use the CLI, you will need to provide a Tendermint RPC address for the --node flag.

Set Network Config

In the local setup the node is set to tcp://localhost:26657. You can view your node configuration with:

matchd config \
--home ~/.tmp-matchd
# Example Output
# {
# 	"chain-id": "match_9000-1",
# 	"keyring-backend": "test",
# 	"output": "text",
# 	"node": "tcp://localhost:26657",
# 	"broadcast-mode": "sync"
# }

You can set your node configuration to send requests to a different network by changing the endpoint with:

matchd config node [tendermint-rpc-endpoint] \
--home ~/.tmp-matchd

Learn about more node configurations here.

Queries

You can query information on the blockchain using matchd query (short matchd q). To view the account balances by its address stored in the bank module, use:

matchd q bank balances [adress] \
--home ~/.tmp-matchd
# # Example Output:
# balances:
# - amount: "99999000000000000000002500"
#   denom: amatch

To view other available query commands, use:

# for all Queries
matchd q

# for querying commands in the bank module
matchd q bank

Transactions

You can submit transactions to the network using matchd tx. This creates, signs and broadcasts a tx in one command.

To view other available transaction commands, use:

# for all transaction commands
matchd tx

# for Evm transaction subcommands
matchd tx evm

Now that you've learned the basics of how to run and interact with a Match network, head over to configurations for further customization.

Last updated