Giter Site home page Giter Site logo

massa's Introduction

Massa node + Massa-guard

Last build for Massa Mainnet 2.2

alt text

[DESCRIPTION]

[FEATURES]

Build a massa-node container wich include some automation features from a community image with Massalabs agreements

This image include a script named "/massa-guard/massa-guard.sh" to:

  • [GENERAL]
    • Enable/Disable all massa-guard features (Except keys creations) with the "MASSAGUARD" setting in config.ini
    • Link node storage files to massa_mount
  • [AUTOBUY/AUTOSELL]
    • Autobuy 1 roll when your node failed and lost his "Active rolls".
    • Autobuy X rolls when your MAS amount greater than 100 MAS and if "Active rolls" dont exceed "TARGET_ROLL_AMOUNT", if value set in /massa_mount/config/config.ini.
    • Autosell X rolls when "Active rolls" exceed "TARGET_ROLL_AMOUNT", if value set in /massa_mount/config/config.ini.
  • [WATCHDOG]
    • Restart node when hang or when ram consumption exceed 90% (Value can be adjust)
    • You host your node under a dynamical IP? massa-guard will watch IP change and update your config.toml and push IP updates to massabot.
    • Logs actions over /massa_mount/logs/ and backup node logs before restart if necessary.
    • Push events over discord Webhook
  • [STARTING FROM SCRATCH]
    • Massa-guard will auto create wallet + nodekey + stacke privkey; all with default password "MassaToTheMoon2022".
    • Massa-guard auto create your config.toml with your public IP.

[RELEASE NOTES]

  • 20240622 - Mainnet - v2.2 - Mainnet - Update to mainnet 2.2
  • 20240517 - Mainnet - v2.1.1 - Mainnet - Add 0.01 MAS for buy and sell rolls action
  • 20240124 - Mainnet - v2.1.0 - Mainnet - v2.1 Ready + Add multiwallets availability + Discord webhook Push logs feature + Deport node storage to massa_mount
  • 20240110 - Mainnet - v2.0.0 - Mainnet - v2.0 Ready + Remove useless dependencies + Add multi wallet autobuy features
  • 20240105 - Mainnet - v1.0.0 - Mainnet - v1.0 Ready !!! + Change [network] label to [protocol] into new config.toml + ADD RESCUE_MAS_AMOUNT setting into config.ini
  • 20240103 - Devnet - v28.2.0 - Devnet - v28.2 Ready

[HOWTO]

[SETUP]

[PREPARE]

Just create an empty folder to mount into our container /massa_mount path and run! Or restore your wallet(s) and/or nodekey and/or config.toml into this folder if you have it:

  • wallet_%%%.dat
  • config.toml
  • node_privkey.key

/!\ If don't have this file, leave your folder empty, massa-guard will create a wallet and node key and automaticaly stake wallet for you. This files will be backup on your mount point by massa-guard.

[RUN] Usecase Example

/!\ You can define ENV values when you create your container:

  • ''MASSAGUARD'' - Set with 1 to enable all massa-guard features or with 0 to disable all features except keys creations (Enable by default without ENV value)
  • ''DYNIP'' - Set with "0" if you host under static public IP or "1" if you host under dynimic public IP to enable update IP feature
  • ''WALLETPWD'' - Set with "YourCustomPassword" if you want to use a custom wallet password.
  • ''NODEPWD'' - Set with "YourCustomPassword" if you want to use a custom node password.
  • ''IP'' - Set with "YourIPAddress" if your node have differents publics IPs and you want to set your custom selection. /!\ Please note, this ENV variables have a low priority if a previous config.ini exist in your mount point.
  • Example N°1: Container creation example with ENV variables docker argument to restart container with host:
docker run -d -v /%MY_PATH%/massa_mount:/massa_mount -p 31244-31245:31244-31245 -p 33035:33035 --restart unless-stopped --name massa-node rykcod/massa
  • Example N°2: Container creation example with ENV variables to run a basical container without massa-guard automation :
docker run -d -v /%MY_PATH%/massa_mount:/massa_mount -p 31244-31245:31244-31245 -p 33035:33035 -e "MASSAGUARD=0" --name massa-node rykcod/massa

[INTERACTION] To manually use massa-client of your container

  • To connect into your container:
docker exec -it massa-node /bin/bash
  • Connect to massa-client after container connection:
screen -x massa-client
  • Exit screen or container:
ctrl+a+d

[MAINTENANCE] After container creation

[OPTION] To enable or update features after container creation just edit /massa_mount/config/config.ini and set

  • Set your ''DYN_PUB_IP'' value to enable dynamical IP management (0=Disable 1=Enable)
  • Set your ''TARGET_ROLL_AMOUNT'' value to enable roll amount target to stake for your node (Integer value)
  • Set your ''MASSAGUARD'' value to enable or disable massa-guard features 0=Disable 1=Enable (Enable by default)
  • Set your ''NODE_LOGS'' value to disable logs files (0=Disable 1=Enable). Default value 1.
  • Set your ''RESCUE_MAS_AMOUNT'' value to save capacity to buy a roll if your node going to disqualify. Default value 0.
  • Set your ''DISCORD_WEBHOOK'' to push log events to Discord channel with webhook. Default value 0.

[HELP]

  • Massa client is running over a "screen" named "massa-client"
  • Massa node is running over a "screen" named "massa-node"

[LOGS PATH]

  • Massa-guard actions and events are logs into %MountPoint%/logs/massa-guard/%DATE%-massa_guard.txt
  • Massa-node events are archived after every restart into %MountPoint%/logs/massa-guard/%DATE%-logs.txt

[HELP - Easy beginner way for IPV6 usage]

  • Create or edit your host /etc/docker/daemon.json to add:
{
  "ipv6": true,
  "fixed-cidr-v6": "fd00::/80"
}
  • Restart docker service to reload config setting
  • Allow MASQUERADE for ipv6
ip6tables -t nat -A POSTROUTING -s fd00::/80 ! -o docker0 -j MASQUERADE
  • Create a container which dynamicaly edit your iptables rules for port redirection
docker run -d --restart=always -v /var/run/docker.sock:/var/run/docker.sock:ro --cap-drop=ALL --cap-add=NET_RAW --cap-add=NET_ADMIN --cap-add=SYS_MODULE --net=host --name ipv6nat robbertkl/ipv6nat

For more informations and sources - https://github.com/rykcod/massa/

[VIDEO TUTORIAL][FR]

https://youtu.be/IzeRq43DBSQ

[THANKS FOR YOUR SUPPORT]

MASSA Address - AU1eNMGrjLTrUoQAhGNqr1ehwhdMCg5L9T3Bjcvfh3D9pswKsDAx

massa's People

Contributors

fsidhoum avatar rykcod avatar thykof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

massa's Issues

Peers

Hallo, Ryckcod

Do you have bootstrap peers list?

Best Regards

Stuck

Mine got stuck in here ,,it didn't create anything... Any solutions ?
tail -f /massa/massa_mount/logs/massa-guard/20220624-massa_guard.txt
[20220624-18H39][INFO][LOAD]LOAD /massa_mount/config.toml as ref
[20220624-18H56][INFO][LOAD]LOAD /massa_mount/config.toml as ref
[20220624-19H19][INFO][INIT]Create your default config.toml with X.X.X.X as routable IP
[20220624-19H49][INFO][INIT]Create your default config.toml with X.X.X.X as routable IP

/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected

There seems to be a bug in massa-guard.sh.

I am running the node with Logs enabled (default).
The following line is spammed into logs when running: ```docker logs massa-node -f````

/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected
/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected
/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected
/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected
/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected
/massa-guard/massa-guard.sh: line 49: [: -eq: unary operator expected

Massa Client Not Listened TEST 16

massa-client

� command · get_status
Error: check if your node is running: error trying to connect: tcp connect error: Connection refused (os error 111)

Logs :

2022-11-01T12:24:45.940315Z  INFO massa_node: Node version : TEST.16.0
2022-11-01T12:24:46.137816Z  INFO massa_bootstrap::client: Start bootstrapping from 149.202.89.125:31245
2022-11-01T12:24:46.170269Z  WARN massa_bootstrap::client: Error received from bootstrap server: Your last bootstrap on this server was 4270.252398647s ago and you have to wait 38929.7476012s before retrying.
2022-11-01T12:24:46.170603Z  INFO massa_bootstrap::client: Bootstrap from server 149.202.89.125:31245 failed. Your node will try to bootstrap from another server in 60s.
2022-11-01T12:25:46.171770Z  INFO massa_bootstrap::client: Start bootstrapping from 158.69.120.215:31245
2022-11-01T12:25:46.362570Z  WARN massa_bootstrap::client: Error received from bootstrap server: Your last bootstrap on this server was 4040.514541526s ago and you have to wait 39159.485458428s before retrying.
2022-11-01T12:25:46.362785Z  INFO massa_bootstrap::client: Bootstrap from server 158.69.120.215:31245 failed. Your node will try to bootstrap from another server in 60s.
2022-11-01T12:26:46.364337Z  INFO massa_bootstrap::client: Start bootstrapping from 77.40.50.164:31245
2022-11-01T12:26:46.467851Z  WARN massa_bootstrap::client: Error while bootstrapping: io error: early eof
2022-11-01T12:26:46.468352Z  INFO massa_bootstrap::client: Bootstrap from server 77.40.50.164:31245 failed. Your node will try to bootstrap from another server in 60s.
2022-11-01T12:27:46.470408Z  INFO massa_bootstrap::client: Start bootstrapping from 158.69.23.120:31245
2022-11-01T12:27:46.663659Z  WARN massa_bootstrap::client: Error received from bootstrap server: Your last bootstrap on this server was 5058.663387752s ago and you have to wait 38141.336612164s before retrying.
2022-11-01T12:27:46.663944Z  INFO massa_bootstrap::client: Bootstrap from server 158.69.23.120:31245 failed. Your node will try to bootstrap from another server in 60s.
2022-11-01T12:28:46.665745Z  INFO massa_bootstrap::client: Start bootstrapping from 154.26.132.217:31245
2022-11-01T12:28:47.003563Z  WARN massa_bootstrap::client: Error while bootstrapping: io error: early eof
2022-11-01T12:28:47.004286Z  INFO massa_bootstrap::client: Bootstrap from server 154.26.132.217:31245 failed. Your node will try to bootstrap from another server in 60s.
2022-11-01T12:29:47.006050Z  INFO massa_bootstrap::client: Start bootstrapping from 149.202.86.103:31245
2022-11-01T12:29:47.051222Z  WARN massa_bootstrap::client: Error received from bootstrap server: Your last bootstrap on this server was 6454.498238812s ago and you have to wait 36745.501761098s before retrying.
2022-11-01T12:29:47.051564Z  INFO massa_bootstrap::client: Bootstrap from server 149.202.86.103:31245 failed. Your node will try to bootstrap from another server in 60s.
2022-11-01T12:30:47.053462Z  INFO massa_bootstrap::client: Start bootstrapping from 198.27.74.5:31245
2022-11-01T12:30:47.235108Z  WARN massa_bootstrap::client: Error received from bootstrap server: Your last bootstrap on this server was 4159.5918281s ago and you have to wait 39040.408171797s before retrying.
2022-11-01T12:30:47.235354Z  INFO massa_bootstrap::client: Bootstrap from server 198.27.74.5:31245 failed. Your node will try to bootstrap from another server in 60s.

Reduce log file size if log lines are the same

I'm having a problem with the log file being too large. In about 20h, about 540000 log lines were generated, it takes up about 110Mb, it keeps growing. I checked, it's because my machine has a network error and it keeps generating the INFO log about this error, I think saving the whole log I think is not necessary, we should have 1 more option for full log storage or only shortened storage, in case of log save with shortened, if the same log line is the same, but occurs continuously, can you count it and print out the number of times it occurs? This will significantly reduce the log file size for machines that often output network failures like me.
For example:
If my full log is:
2022-10-18T09:00:18.714239Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.715263Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.716025Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.717184Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.718331Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.719588Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.720694Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.721837Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.723105Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.723974Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.725580Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.726722Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.727859Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.727934Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.729078Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
2022-10-18T09:00:18.730551Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.

Then the abbreviated log would be:
2022-10-18T09:00:18.714239Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.
Counted 14 identical log lines
2022-10-18T09:00:18.730551Z INFO massa_network_worker::network_event::event_impl: Send network event failed An error occurred during channel communication: Failed to send event.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.