{"id":15285763,"url":"https://github.com/matrixainetwork/go-matrix","last_synced_at":"2025-04-06T04:11:21.177Z","repository":{"id":48017792,"uuid":"150822759","full_name":"MatrixAINetwork/go-matrix","owner":"MatrixAINetwork","description":"First version of go-MATRIX, especially for TPS optimization and AI","archived":false,"fork":false,"pushed_at":"2023-03-26T16:40:53.000Z","size":115133,"stargazers_count":203,"open_issues_count":26,"forks_count":147,"subscribers_count":120,"default_branch":"master","last_synced_at":"2025-04-06T04:11:10.361Z","etag":null,"topics":["ai","artificial-intelligence","blockchain","golang","intelligent-contract","ipfs","ipfs-blockchain","smart-contracts","tps"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatrixAINetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-09-29T03:57:10.000Z","updated_at":"2025-02-06T08:05:21.000Z","dependencies_parsed_at":"2023-01-24T19:19:00.695Z","dependency_job_id":"c6807767-57f4-43db-b657-835fc4874a3f","html_url":"https://github.com/MatrixAINetwork/go-matrix","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAINetwork%2Fgo-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAINetwork%2Fgo-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAINetwork%2Fgo-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAINetwork%2Fgo-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatrixAINetwork","download_url":"https://codeload.github.com/MatrixAINetwork/go-matrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430871,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","blockchain","golang","intelligent-contract","ipfs","ipfs-blockchain","smart-contracts","tps"],"created_at":"2024-09-30T15:07:32.382Z","updated_at":"2025-04-06T04:11:21.151Z","avatar_url":"https://github.com/MatrixAINetwork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-matrix\n------\n\nMatrix Mainnet Update Notice\n\n\n## Successful updates\nThis patch will bring the following changes to Matrix AI Network:\n1. Adjustments to the penalty policy;\n2. Adjustments to the difficulty algorithm;\n3. More search space for POW mining;\n4. Bug fixes\n\n\n### Penalty Policy\nIn the current version, mining nodes that are elected but fail to report their base compute will get\nblacklisted and lose all rewards for that round.\nThe new patch will raise the penalty for backlisted mining nodes. If blacklisted, your node is also\nunable to become a candidate mining Masternode for the next election cycle\n\n\n### Difficulty Adjustment Algorithm\n\nWe have found two flaws in the current version:\n-   Difficulty level drops when a new validation leader is elected.\nIf there is a new validation leader in one mining cycle (the time for generating 3 blocks), this\nmining cycle will take longer to finish, and difficulty for mining the following block will lower\ndown. (The validators take turns to generate blocks, and a validator which has generated a block\nis considered the validation leader of that block.) Therefore, the increase in mining time caused\nin this way has nothing to do with the actual computing power. (In fact, a problem with one\nvalidator can cause this to happen repeatedly to the point where difficulty adjustment fails. As a\nresult, the difficulty level will be too low for miners to make full use of their computing power.)\nWhen this happens, it is impossible to know a miner’s actual mining time. Therefore, when\ncalculating the difficulty level, we’ll use “expected block-generation time” as the intermediate\nsolution in place of the actual time.\n-   In the quick setup and the tracking stages, mining difficulty is slow to stabilise due to lack of\nsynergy.\nCurrently, the difficulty adjustment algorithm on the mainnet goes through two stages：\n(1) Quick setup: Quickly establish an algorithm for the first n mining cycles. Adjust difficulty\nlevel exponentially to increase the estimation accuracy.\n(2) Tracking: Use exponential weighted moving average to track compute change through the\nmainnet.\nIn the current version, when calculating an exponential weighted moving average, the block\ninformation (difficulty level and time) of the quick setup stage will be used at the beginning.\nThis information is not an accurate reflection of computing power. But since the last block of the\nquick setup stage contains relatively accurate information, in the new version, we’ll use this\ninformation instead of trying to get the difficulty level in other ways, when the calculating\nexponential weighted moving average.\n\n\n#### More search space for POW mining\n\nIn the current version, the search space for POW mining is only 4 bytes large. When the difficulty\nlevel is too high, an ideal target value may not be found after searching the entire space. In the\nnew version, we’ll add a 12-byte space, at the initial 12 bytes of the mixDigest field of a block\nhead\n\n## Bug fixes\nThe new version will introduce the following bug fixes.\n1. In the current version, validators in the mainnet only accept mining results that are one\nblock higher than the local height. When the POW mining difficulty is too low, this can\ncause mining results to arrive two blocks earlier. In consequence, miners with greater\ncomputing power may not see their mining results accepted. This bug will get fixed with the\npatch.\n2. In the current version, the nonce cannot be 0 for CPU mining. This bug will get fixed with\nthe patch.\n3. In the current version, the P2P module does not lock up visits to the map using certain codes,\ncausing the system to crash sometimes when there are too many connected nodes. This issue\nwill get fixed with the patch\n\n\n### Blockchain Explorer\n\n[http://tom.matrix.io/home](http://tom.matrix.io/home)\n\n### MATRIX WEB WALLET\n\n[https://wallet.matrix.io/](https://wallet.matrix.io/)\n\n### Getting Started\nWelcome! This guide is intended to get you running on the MATRIX network. To ensure your client behaves gracefully throughout the setup process, please check your system meets the following requirements:\n\n\n| OS        | Windows, Linux                               |   |\n|-----------|----------------------------------------------|---|\n| CPU       | 8 Core (Intel(R) Xeon(R) CPU X5670 @2.93GHz) |   |\n| RAM       | 16G                                          |   |\n| Free HD   | 300G                                         |   |\n| Bandwidth | 20M                                          |   |\n|           |                                              |   |\n\n### Build from Source\n\nFirst of all, you need to clone the source code from MATRIX repository:\n\nGit clone https://github.com/MatrixAINetwork/go-matrix.git, or\n\nwget https://github.com/MatrixAINetwork/go-matrix/archive/master.zip\n\n- Branch: Master\n\n- Tag: v1.1.7\n\nBuilding gman requires both a Go (version 1.7 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run your 'make gman' command \n\nYou can also obtain our compiled gman from github [https://github.com/MatrixAINetwork/GMAN_CLIENT/tree/master/MAINNET/20200520]https://github.com/MatrixAINetwork/GMAN_CLIENT/tree/master/MAINNET/20200520)\n\n\n\n### Starting up your member nodes (Linux \u0026 Mac) - for deposited users\n\nStep 1: Check out what you need to prepare (most of them can be obtaind from go-matrix repository)\n\n    /gman: exe file\n\n    /MANGenesis.json: genesis file\n\n    /chaindata: a folder which you should create\n\n    man.json: common profile which shall be put under /chaindata\n\tpicstore：a folder which shall be put under /chaindata\n\nStep 2: Run Initiate command\n\n    ./gman  --datadir  ./chaindata/   init    ./MANGenesis.json\n\nStep 3: Visit our web wallet to create a new wallet address, and save your keystore file as well as password.\n\nPlease refer to [['Guide to Web Wallet']](https://github.com/MatrixAINetwork/MATRIX_docs/blob/master/ENGLISH_DOCS/MATRIX_Web_Wallet/MATRIX%20Online%20Wallet%20Manual.pdf)\n\nCarry out your deposit actions if you want to run for a miner or validator node (you can find steps on the above guide)\n\nStep 4: Copy your keystore file to folder keystore which is generated at Step 2 (/chaindata/keystore)\n\nStep 5: Create a file named signAccount.json under root, and its content is like:\n\n    [\n      {\n        \"Address\":\" MAN.gQAAHUeTBxvgbzf8tFgUtavDceJP \",\n        \"Password\":\" pass123456\"\n      }\n\n    ]\nThen, run: \n\n    ./gman --datadir ./chaindata aes --aesin ./signAccount.json --aesout entrust.json\n\nUpon the window prompt, you will be asked to set a password (which should contain upper-case letter[s], lower-case letter[s], number[s] and special character[s])\n\nStep 6: Copy the generated entrust.json to root\n\nStep 7: Start gman\n\n    ./gman --datadir ./chaindata --networkid 1 --debug --verbosity 5  --manAddress [your man.address here] --entrust ./entrust.json --gcmode archive --outputinfo 1 --syncmode full \n\n    for example, \n\n./gman --datadir ./chaindata --networkid 1 --debug --verbosity 5 --manAddress MAN.gQAAHUeTBxvgbzf8tFgUtavDceJP --entrust ./entrust.json --gcmode archive --outputinfo 1 --syncmode full\n\nIn this step, you will need to input the password set in step 5.\n\nStep 8: Run 'Attach': ./gman attach /chaindata/gman.ipc (gman.ipc is generated under /chaindata when starting gman)\n\n\n### Starting up your member nodes (Linux \u0026 Mac) - for non-deposited users\n\nStep 1: Check out what you need to prepare (most of them can be obtaind from go-matrix repository)\n\n    /gman: exe file\n\n    /MANGenesis.json: genesis file\n\n    /chaindata: a folder which you should create\n\n    man.json: common profile which shall be put under /chaindata\n\tpicstore：a folder which shall be put under /chaindata\n\nStep 2: Run Initiate command\n\n    ./gman  --datadir  ./chaindata/   init    ./MANGenesis.json\n\nStep 3: Start\n    ./gman --datadir ./chaindata --networkid 1  --outputinfo 1 --syncmode 'full'\n\n### Starting up your member nodes (Windows) - for deposited users\nStep 1: Check out what you need to prepare (most of them can be obtaind from go-matrix repository)\n\n    /gman: exe file\n\n    /MANGenesis.json: genesis file\n\n    /chaindata: a folder which you should create\n\n    man.json: common profile which shall be put under /chaindata\n\tpicstore：a folder which shall be put under /chaindata\n\nStep 2: Run Initiate command\n\n    gman.exe --datadir chaindata\\ init MANGenesis.json\n\nStep 3: Create a file named signAccount.json, whose contents are:\n\n    [\n      {\n        \"Address\":\"MAN.2skMrkoEkecKjJLPz6qTdi8B3NgjU \",\n        \"Password\":\"haolin0123\"\n      }\n\n    ]\n\nStep 4: Run:\n\n    gman.exe --datadir chaindata aes --aesin signAccount.json --aesout entrust.json\n\nUpon the window prompt, you will be asked to set a password (which should contain upper-case letter[s], lower-case letter[s], number[s] and special character[s])\n\nStep 5: Start gman\n\n    gman --datadir chaindata  --networkid 1 --debug --verbosity 5  --manAddress  MAN.2skMrkoEkecKjJLPz6qTdi8B3NgjU --entrust entrust.json --gcmode archive --outputinfo 1 --syncmode full\n\nIn this step, you will need to input the password set in step 5.\n\nStep 8: Open another window\n\n    gman attach ipc:\\\\.\\pipe\\gman.ipc \n\ngman.ipc is generated under /chaindata when starting gman)\n\n### Starting up your member nodes (Windows) - for non-deposited users\n\nStep 1: Check out what you need to prepare (most of them can be obtaind from go-matrix repository)\n\n    /gman: exe file\n\n    /MANGenesis.json: genesis file\n\n    /chaindata: a folder which you should create\n\n    man.json: common profile which shall be put under /chaindata\n\tpicstore：a folder which shall be put under /chaindata\n\nStep 2: Run Initiate command\n\n    gman.exe --datadir chaindata\\ init MANGenesis.json\n\nStep 3: Start gman\n\n    gman --datadir chaindata  --networkid 1 --outputinfo 1 -- syncmode full\n\n### License\nCopyright 2018-2020 The MATRIX Authors\n\nThe go-matrix library is licensed under MIT.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixainetwork%2Fgo-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixainetwork%2Fgo-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixainetwork%2Fgo-matrix/lists"}