The go implementation for the MultiversX protocol
In order to join the network as an observer or as a validator, the required steps to build from source and setup explicitly are explained below.
The installation of go should proceed as shown in official golang installation guide https://golang.org/doc/install . In order to run the node, minimum golang version should be 1.17.6.
The main branch that will be used is the master branch. Alternatively, an older release tag can be used.
# set $GOPATH if not set and export to ~/.profile along with Go binary path
$ if [[ $GOPATH=="" ]]; then GOPATH="$HOME/go" fi
$ mkdir -p $GOPATH/src/github.com/multiversx
$ cd $GOPATH/src/github.com/multiversx
$ git clone https://github.com/multiversx/mx-chain-go
$ cd mx-chain-go && git checkout master
$ cd cmd/node && go build
The node depends on the Wasm Virtual Machine, which is automatically managed by the node.
In order to be registered in the MultiversX Network, a node must possess 2 types of (secret key, public key) pairs. One is used to identify the node’s credential used to generate transactions (having the sender field its account address) and the other is used in the process of the block signing. Please note that this is a preliminary mechanism, in the next releases the first (private, public key) pair will be dropped when the staking mechanism will be fully implemented. To build and run the keygenerator, the following commands will need to be run:
$ cd $GOPATH/src/github.com/multiversx/mx-chain-go/cmd/keygenerator
$ go build
$ ./keygenerator
Follow the steps outlined here. This is because in order to join the testnet you need a specific node configuration.
OR
The previous generated .pem file needs to be copied in the same directory where the node binary resides in order to start the node.
$ cp validatorKey.pem ./../node/config/
$ cd ../node && ./node
The node binary has some flags defined (for a brief description, the user can use --help flag). Those flags can be used to directly alter the configuration values defined in .toml/.json files and can be used when launching more than one instance of the binary.
$ go test ./...
sudo cp -r google /usr/include
sudo cp protoc /usr/bin
cd protoc-gen-gogoslick
go build
sudo cp protoc-gen-gogoslick /usr/bin/
Done
--p2p-prometheus-metrics
flag. This exposes a metrics collection at http://localhost:8080/debug/metrics/prometheus (port defined by -rest-api-interface flag, default 8080)git clone https://github.com/libp2p/go-libp2p
cd go-libp2p/dasboards/swarm
and under the
"templating": {
"list": [
section, add the following lines:
{
"hide": 0,
"label": "datasource",
"name": "DS_PROMETHEUS",
"options": [],
"query": "prometheus",
"refresh": 1,
"regex": "",
"type": "datasource"
},
(this step will be removed once it will be fixed on libp2p)
cd ..
to dashboards directory and update the port of host.docker.internal
from prometheus.yml
to node's Rest API port(default 8080
)sudo docker compose -f docker-compose.base.yml -f docker-compose-linux.yml up --force-recreate
Note: If you choose to install the new Docker version manually, please make sure that installation is done for all users of the system. Otherwise, the docker command will fail because it needs the super-user privileges.
Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes to MultiversX!
If you'd like to contribute to MultiversX, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core developers first here on GitHub, to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.
Please make sure your contributions adhere to our coding guidelines:
Please see the documentation for more details on the MultiversX protocol.