Running a node

This document contains step-by-step instructions for running a geth node in MemeCore Network.

Hardware Requirements

The following are the minimum hardware requirements:

  • CPU with 2+ cores

  • 4GB RAM

  • 200GB free storage space

  • 8 MBit/sec download Internet service

1. Building Geth Binary

Build the source

Get memecore-geth source.

TBD

Building geth requires both a Go (version 1.19 or later) and a C compiler. Feel free to install them with the package manager of your choice.

Once the dependencies are installed, run

make geth

or, build the full suite of utilities:

make all

2. Initializing Geth Database

Download the genesis.json

  • Formicarium Testnet genesis.json

To create a blockchain node that uses this genesis block, first use geth init to import and set the canonical genesis block for the new chain. This requires the path to the configuration file to be passed as an argument.

--datadir is the target destination for the node database. Here we use ./nodes/node1:

./build/bin/geth init --datadir ./nodes/node1 ./genesis.json

3. Initializing Node Account

You can create a new account or import an existing account for your node operation, if you need. RPC nodes don't need node account.

Create a new account

Create your node account with the following command. A password is required to be entered during the process. The resulting account is placed in the specified --datadir under the keystore path.

./geth --datadir ./nodes/node1 account new

Import your existing account

Import your existing account with the private key and remember to replace the ./your/privateKey.txt parameter.

./geth account import --datadir ./nodes/node1 ./your/privateKey.txt

4. Running RPC Node

A RPC node is a network member that does not participate in the consensus process. This node can be used to interact with the MimNetwork, including: creating accounts, transferring funds, deploying and interacting with contracts, and querying node APIs.

You may need to change the P2P/HTTP/RPC/WS ports to avoid conflicts. Please note that the port configuration for the JSON-RPC interface should be set to httpport, not rpcport. You can refer to https://geth.ethereum.org/docs/fundamentals/command-line-options for more details about start options.

This script expects node DB directory to be ./node/node1.

Formicarium Testnet:

#!/bin/bash
​​
./build/bin/geth \
--networkid 43521 \
--gcmode archive \
--datadir ./nodes/node1 \
--bootnodes "enode://d511b4562fbf87ccf864bf8bf0536632594d5838fc2223cecdb35b30c3b281172c96201a8f9835164b1d8ec1e4d6b7542af917fab7aca891654dae50ce515bc0@18.138.235.45:30303,enode://9b5ae242c202d74db9ba8406d2e225f97bb79487eedba576f20fcf8d770488d6e5d0110b45bcaf01b107d4a429b6cfcb7dea4e07f8dbc9816e8409b0b147036e@18.143.193.46:30303" \
--port 30303 \
--http.api eth,net,web3 \
--http \
--http.port 8545 \
--http.addr 0.0.0.0 \
--http.vhosts "*" \
--ws \
--ws.port 8546 \
--ws.addr 0.0.0.0 \
--ws.api eth,net,web3

5. Running Validator Node

A validator node participates in the PoSA consensus. If you want to register as a candidate for PoSA validators, you need to run a miner node.

You may need to change the P2P/HTTP/RPC/WS ports to avoid conflicts. Please note that the port configuration for the JSON-RPC interface should be set to httpport, not rpcport. You can refer to https://geth.ethereum.org/docs/fundamentals/command-line-options for more details about start options.

This script expects node DB directory to be ./node/node1.

Formicarium Testnet:

#!/bin/bash

./build/bin/geth \
--mine --miner.etherbase=<Your Validator Account Address> \
--unlock <Your Validator Account Address> \
--password <Your Validator Account Password File> \
--networkid 43521 \
--gcmode archive \
--datadir ./nodes/node1 \
--bootnodes "enode://d511b4562fbf87ccf864bf8bf0536632594d5838fc2223cecdb35b30c3b281172c96201a8f9835164b1d8ec1e4d6b7542af917fab7aca891654dae50ce515bc0@18.138.235.45:30303,enode://9b5ae242c202d74db9ba8406d2e225f97bb79487eedba576f20fcf8d770488d6e5d0110b45bcaf01b107d4a429b6cfcb7dea4e07f8dbc9816e8409b0b147036e@18.143.193.46:30303" \
--port 30303 \
--http.api eth,net,web3 \
--http \
--http.port 8545 \
--http.addr 0.0.0.0 \
--http.vhosts "*" \
--ws \
--ws.port 8546 \
--ws.addr 0.0.0.0 \
--ws.api eth,net,web3

After launch geth client, you need to register your validator account to our system contract (0x1234000000000000000000000000000000000002) with 7,000,000 M. (Validator registering is locked yet.)

Last updated