matrix

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2018 License: MIT Imports: 5 Imported by: 0

README

GO-MATRIX


About

The MATRIX repository is based on go-ethereum which contains protocol changes to support the MATRIX protocol and a few other distinct features. This implements the MATRIX cryptocurrency, which maintains a separate ledger from the ETHEREUM network, for several reasons, the most immediate of which is that the consensus protocol is different.

Highlights
  • High-performace TPS

  • Highly-regulated network hierarchy

  • Support various transaction type: One2Multiple, Offline, Smartcontract, AI transactions as well as support for rich texts, images and videos

  • AI Features: Formal Verification(Trial)、Natural Language Input、AI server

  • 高性能 TPS

  • 一对多交易

  • 智慧合约

  • 人工智能支持

  • AI server

Documentation Guide

URL: BlockChain Explorer

  • If you want to know more about How to deploy MATRIX, please check out 'User Guide'

  • If you want to better understand what a specific term refers to, please check out 'glossary'

文档指引

MATRIX 区块链浏览器

Getting Started

Welcome! This guide is intended to get you running on the MATRIX testnet. To ensure your client behaves gracefully throughout the setup process, please check your system meets the following requirements:

OS Windows, Mac
CPU 6 Core (Intel(R) Xeon(R) CPU X5670 @2.93GHz)
RAM 8G
Free HD 500G
Build from Source

First of all, you need to clone the source code from MATRIX repository:

Git clone https://github.com/MatrixAINetwork/MATRIX-TESTNET.git, or

wget https://github.com/MatrixAINetwork/MATRIX-TESTNET/archive/master.zip

Building 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:

cd MATRIX-TESTNET_GO
make gman

or, to build the full suite of utilities:

make all
Docker Quick Start

One of the quickest ways to get MATRIX up and running on your machine is by using Docker:

docker build –t image_name

docker run -d  -p 8545:8545 –p 30303:30303 –p 40404:40404 imagename --fast --cache=512

This will start gman in fast-sync mode with a DB memory allowance of 1GB just as the above command does. It will also create a persistent volume in your home directory for saving your blockchain as well as map the default ports. There is also an alpine tag available for a slim version of the image.

Do not forget --rpcaddr 0.0.0.0, if you want to access RPC from other containers and/or hosts. By default, gman binds to the local interface and RPC endpoints is not accessible from the outside.

Operating a private network

Maintaining your own private network is more involved as a lot of configurations taken for granted in the official networks need to be manually set up.

Defining the private genesis state

First, you'll need to create the genesis state of your networks, which all nodes need to be aware of and agree upon. This consists of a small JSON file (e.g. name it genesis.json):

{
    "config": {
    				"chainID": 1,
    				"byzantiumBlock": 0,
    				"eip155Block": 0,
            "eip158Block": 0                        				             
    },
	
    "alloc": {
"0x000000000000000000000000000000000000000A": {
        "storage": {
"0x0000000000000000000000000000000000000000000000000000000a444e554d":"0x0000000000000000000000000000000000000000000000000000000000000014",
"0x0000000000000000000000000000000000000000000a44490000000000000000":"0x0000000000000000000000006a3217d128a76e4777403e092bde8362d4117773",
"0x0000000000000000000000000000000000000000000a44490000000000000001":"0x0000000000000000000000000ead6cdb8d214389909a535d4ccc21a393dddba9",
"0x0000000000000000000000000000000000000000000a44490000000000000002":"0x00000000000000000000000055fbba0496ef137be57d4c179a3a74c4d0c643be",
"0x0000000000000000000000000000000000000000000a44490000000000000003":"0x000000000000000000000000915b5295dde0cebb11c6cb25828b546a9b2c9369",
"0x0000000000000000000000000000000000000000000a44490000000000000004":"0x00000000000000000000000092e0fea9aba517398c2f0dd628f8cfc7e32ba984",
"0x0000000000000000000000000000000000000000000a44490000000000000005":"0x0000000000000000000000007eb0bcd103810a6bf463d6d230ebcacc85157d19",
"0x0000000000000000000000000000000000000000000a44490000000000000006":"0x000000000000000000000000cded44bd41476a69e8e68ba8286952c414d28af7",
"0x0000000000000000000000000000000000000000000a44490000000000000007":"0x0000000000000000000000009cde10b889fca53c0a560b90b3cb21c2fc965d2b",
"0x0000000000000000000000000000000000000000000a44490000000000000008":"0x0000000000000000000000007823a1bea7aca2f902b87effdd4da9a7ef1fc5fb",
"0x0000000000000000000000000000000000000000000a44490000000000000009":"0x0000000000000000000000000f96b686b2c57a0f2d571a39eae66d61a74b5870",
"0x0000000000000000000000000000000000000000000a4449000000000000000a":"0x000000000000000000000000328b4bb56a750ea86bd52329a3e368d051699bb2",
"0x0000000000000000000000000000000000000000000a4449000000000000000b":"0x000000000000000000000000b09b89893fd55223ed2d9c06cda7afef867c7449",
"0x0000000000000000000000000000000000000000000a4449000000000000000c":"0x000000000000000000000000aea37855eacb4b41ca0dbc6c744681f96fe09d94",
"0x0000000000000000000000000000000000000000000a4449000000000000000d":"0x000000000000000000000000b142159adbfc2690b45da01e49cfa2379ddc2701",
"0x0000000000000000000000000000000000000000000a4449000000000000000e":"0x000000000000000000000000b7efab17215a43983d766114feb69172587a4090",
"0x0000000000000000000000000000000000000000000a4449000000000000000f":"0x000000000000000000000000f9e18acc86179925353713a4a5d0e9bf381fbc17",
"0x0000000000000000000000000000000000000000000a44490000000000000010":"0x000000000000000000000000a121e6670439ba37e7244d4eb18e42bd6724ef0f",
"0x0000000000000000000000000000000000000000000a44490000000000000011":"0x0000000000000000000000000a3f28de9682df49f9f393931062c5204c2bc404",
"0x0000000000000000000000000000000000000000000a44490000000000000012":"0x0000000000000000000000008c3d1a9504a36d49003f1652fadb9f06c32a4408",
"0x0000000000000000000000000000000000000000000a44490000000000000013":"0x00000000000000000000000005e3c16931c6e578f948231dca609d754c18fc09",
"0x000000000000000000000005e3c16931c6e578f948231dca609d754c18fc0944":"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000",
"0x00000000000000000000000a3f28de9682df49f9f393931062c5204c2bc40444":"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000",
"0x00000000000000000000000ead6cdb8d214389909a535d4ccc21a393dddba944":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x00000000000000000000000f96b686b2c57a0f2d571a39eae66d61a74b587044":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000328b4bb56a750ea86bd52329a3e368d051699bb244":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x000000000000000000000055fbba0496ef137be57d4c179a3a74c4d0c643be44":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x00000000000000000000006a3217d128a76e4777403e092bde8362d411777344":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x00000000000000000000007823a1bea7aca2f902b87effdd4da9a7ef1fc5fb44":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x00000000000000000000007eb0bcd103810a6bf463d6d230ebcacc85157d1944":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x00000000000000000000008c3d1a9504a36d49003f1652fadb9f06c32a440844":"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000",
"0x0000000000000000000000915b5295dde0cebb11c6cb25828b546a9b2c936944":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x000000000000000000000092e0fea9aba517398c2f0dd628f8cfc7e32ba98444":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x00000000000000000000009cde10b889fca53c0a560b90b3cb21c2fc965d2b44":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000a121e6670439ba37e7244d4eb18e42bd6724ef0f44":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000aea37855eacb4b41ca0dbc6c744681f96fe09d9444":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000b09b89893fd55223ed2d9c06cda7afef867c744944":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000b142159adbfc2690b45da01e49cfa2379ddc270144":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000b7efab17215a43983d766114feb69172587a409044":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000cded44bd41476a69e8e68ba8286952c414d28af744":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000000f9e18acc86179925353713a4a5d0e9bf381fbc1744":"0x00000000000000000000000000000000000000000000152d02c7e14af6800000",
"0x0000000000000000000005e3c16931c6e578f948231dca609d754c18fc094e58":"0x43b553fae2184b25e76b69a2386bfc9a014486db7da3df75bba9fa2e3eed8aaf",
"0x0000000000000000000005e3c16931c6e578f948231dca609d754c18fc094e59":"0x063a5f1aab68488a8645fd6a230a27bfe4e8d3393232fe107ba0f68a9bf541ad",
"0x000000000000000000000a3f28de9682df49f9f393931062c5204c2bc4044e58":"0xa9f94b62067e993f3f02ada1a448c70ae90bdbe4c6b281f8ff16c6f4832e0e9a",
"0x000000000000000000000a3f28de9682df49f9f393931062c5204c2bc4044e59":"0xba1827531c260b380c776938b9975ac7170a7e822f567660333622ea3e529313",
"0x000000000000000000000ead6cdb8d214389909a535d4ccc21a393dddba94e58":"0xb624a3fb585a48b4c96e4e6327752b1ba82a90a948f258be380ba17ead7c01f6",
"0x000000000000000000000ead6cdb8d214389909a535d4ccc21a393dddba94e59":"0xd4ad43d665bb11c50475c058d3aad1ba9a35c0e0c4aa118503bf3ce79609bef6",
"0x000000000000000000000f96b686b2c57a0f2d571a39eae66d61a74b58704e58":"0x6f2d48a825fb4fb82dc1e08e2fc9fc1fd82628548d0b544df15a44a5637a642d",
"0x000000000000000000000f96b686b2c57a0f2d571a39eae66d61a74b58704e59":"0xc4be69768c105c6fc5d024c1166b6ffaae1d4d20325f988d5ef9b97e073cd7c9",
"0x00000000000000000000328b4bb56a750ea86bd52329a3e368d051699bb24e58":"0xac0eac73f5ffc009085dccfe22b9f749e9982cc416170fb0f219411049fb8b21",
"0x00000000000000000000328b4bb56a750ea86bd52329a3e368d051699bb24e59":"0xf774cccbe251d9db0437fcd0d0fefb52c7c933dfaafbabb5567ac8389ff491d1",
"0x0000000000000000000055fbba0496ef137be57d4c179a3a74c4d0c643be4e58":"0x8ce7defe2dde8297f7b55dd9ba8c5e13e0274371b716250ea0dd725974fa076c",
"0x0000000000000000000055fbba0496ef137be57d4c179a3a74c4d0c643be4e59":"0xa379fc7226789a91678f4e38f8f60f8e6405ec9539cab77d4822614e80f743cf",
"0x000000000000000000006a3217d128a76e4777403e092bde8362d41177734e58":"0xdbf8dcc4c82eb2ea2e1350b0ea94c7e29f5be609736b91f0faf334851d18f8de",
"0x000000000000000000006a3217d128a76e4777403e092bde8362d41177734e59":"0x1a518def870c774649db443fbce5f72246e1c6bc4a901ef33429fdc3244a93b3",
"0x000000000000000000007823a1bea7aca2f902b87effdd4da9a7ef1fc5fb4e58":"0xdf57387d6505d0f71d7000da9642cf16d44feb7fcaa5f3a8a7d9fa58b6cbb6d3",
"0x000000000000000000007823a1bea7aca2f902b87effdd4da9a7ef1fc5fb4e59":"0x3d145746d4fb544c049d3ff9b534bf9245a5b8052231c51695fd298032bd4a79",
"0x000000000000000000007eb0bcd103810a6bf463d6d230ebcacc85157d194e58":"0xbc5e761c9d0ba42f22433be14973b399662456763f033a4cdbb8ec37b8026652",
"0x000000000000000000007eb0bcd103810a6bf463d6d230ebcacc85157d194e59":"0x6e6c56f92d0591825c7d644e487fcee828d537c58ce583a72578309ec6ebbd39",
"0x000000000000000000008c3d1a9504a36d49003f1652fadb9f06c32a44084e58":"0x80606b6c1eecb8ce91ca8a49a5a183aa42f335eb0d8628824e715571c1f9d1d7",
"0x000000000000000000008c3d1a9504a36d49003f1652fadb9f06c32a44084e59":"0x57911b80ebc3afab06647da228f36ecf1c39cb561ef7684467c882212ce55cdb",
"0x00000000000000000000915b5295dde0cebb11c6cb25828b546a9b2c93694e58":"0x9f237f9842f70b0417d2c25ce987248c991310b2bd4034e300a6eec46b517bd8",
"0x00000000000000000000915b5295dde0cebb11c6cb25828b546a9b2c93694e59":"0xc4f7f31f157128d0732786181a481bcf725c41a655bdcce282a4bc95638d9aae",
"0x0000000000000000000092e0fea9aba517398c2f0dd628f8cfc7e32ba9844e58":"0x68315573b123b44367f9fefcce38c4d5c4d5d2caf04158a9068de2060380b81f",
"0x0000000000000000000092e0fea9aba517398c2f0dd628f8cfc7e32ba9844e59":"0x26b220543de7402745160141f932012a792722fd4dd2a7a2751771097eeef5f2",
"0x000000000000000000009cde10b889fca53c0a560b90b3cb21c2fc965d2b4e58":"0x14f62dfd8826734fe75120849e11614b0763bc584fba4135c2f32b19501525d5",
"0x000000000000000000009cde10b889fca53c0a560b90b3cb21c2fc965d2b4e59":"0x5d217742893801ecc871023fc42ed7e80196357fb5b1f762d181e827e626637d",
"0x00000000000000000000a121e6670439ba37e7244d4eb18e42bd6724ef0f4e58":"0x23353a739cc08d5d9b52809562f452e375a4ebdab142cff5369e9fe27d3b1bfe",
"0x00000000000000000000a121e6670439ba37e7244d4eb18e42bd6724ef0f4e59":"0xd4c03517f7f4815b0f22cb1e4af6bd4c08e3fc80376135f2473983336f04f0b1",
"0x00000000000000000000aea37855eacb4b41ca0dbc6c744681f96fe09d944e58":"0xb00e07027e771793bd142323570686667e8ae7770afc1db5fe249784b890f277",
"0x00000000000000000000aea37855eacb4b41ca0dbc6c744681f96fe09d944e59":"0x34517232f764af201ac04451cf314db10d5bc1eb7c50cdd035fdda7b29068ba1",
"0x00000000000000000000b09b89893fd55223ed2d9c06cda7afef867c74494e58":"0xa71a2a108f5da1fc3841d9f09b2e6a29b9720b225c65d63e97ac4c1f2f05367c",
"0x00000000000000000000b09b89893fd55223ed2d9c06cda7afef867c74494e59":"0x7bab15e05d3380d9f66cde1b0b216c2846db331de8dad9c1937105297f103427",
"0x00000000000000000000b142159adbfc2690b45da01e49cfa2379ddc27014e58":"0x139839c1a4fa6a9fef82caf050fde90cab8a3149312d40ca964d9c88713a0003",
"0x00000000000000000000b142159adbfc2690b45da01e49cfa2379ddc27014e59":"0x3ae0521a67f0c9344a6eb40d3c09c1a6344793266807b4051e8bc9c500031702",
"0x00000000000000000000b7efab17215a43983d766114feb69172587a40904e58":"0x1e5c7c07fcf6608e84c970b172b865284832a01d09e80e80a035809ed7a8aa01",
"0x00000000000000000000b7efab17215a43983d766114feb69172587a40904e59":"0xe85b2156aab81d4ba9e08e7312acc6751614a16ad0deca792572959ff74366c7",
"0x00000000000000000000cded44bd41476a69e8e68ba8286952c414d28af74e58":"0x25ea3bca7679192612aed14d5e83a4f2a30824ff2af705d2d7c6795470f9cbbc",
"0x00000000000000000000cded44bd41476a69e8e68ba8286952c414d28af74e59":"0x258d9b102a726c3982cda6c4732ba3715551b6fbf9c0ae4ddca4a6c80bc4bbe9",
"0x00000000000000000000f9e18acc86179925353713a4a5d0e9bf381fbc174e58":"0x037a7c7a2acbfbde6d2ad243c9ef929a3f782c3aff1839e7c40dba0534fbe65c",
"0x00000000000000000000f9e18acc86179925353713a4a5d0e9bf381fbc174e59":"0x5a82dba58e1f8b0dd767e87da0e9f95e3c566279    422a215e0b06ddca411ac361"
},
"balance":"3000000000000"},

"0x0ead6cdb8d214389909a535d4ccc21a393dddba9":{"balance":"30000000000000000000000000000000"},
"0x6a3217d128a76e4777403e092bde8362d4117773":{"balance":"30000000000000000000000000000000"},
"0x0a3f28de9682df49f9f393931062c5204c2bc404":{"balance":"30000000000000000000000000000000"},
"0x8c3d1a9504a36d49003f1652fadb9f06c32a4408":{"balance":"30000000000000000000000000000000"},
"0x05e3c16931c6e578f948231dca609d754c18fc09":{"balance":"30000000000000000000000000000000"},
"0x55fbba0496ef137be57d4c179a3a74c4d0c643be":{"balance":"30000000000000000000000000000000"},
"0x915b5295dde0cebb11c6cb25828b546a9b2c9369":{"balance":"30000000000000000000000000000000"},
"0x92e0fea9aba517398c2f0dd628f8cfc7e32ba984":{"balance":"30000000000000000000000000000000"},
"0x7eb0bcd103810a6bf463d6d230ebcacc85157d19":{"balance":"30000000000000000000000000000000"},
"0xcded44bd41476a69e8e68ba8286952c414d28af7":{"balance":"30000000000000000000000000000000"},
"0x9cde10b889fca53c0a560b90b3cb21c2fc965d2b":{"balance":"30000000000000000000000000000000"},
"0x7823a1bea7aca2f902b87effdd4da9a7ef1fc5fb":{"balance":"30000000000000000000000000000000"},
"0x992fcd5f39a298e58776a87441f5ee3319a101a0":{"balance":"30000000000000000000000000000000"},
"0x0f96b686b2c57a0f2d571a39eae66d61a74b5870":{"balance":"30000000000000000000000000000000"},
"0x328b4bb56a750ea86bd52329a3e368d051699bb2":{"balance":"30000000000000000000000000000000"},
"0xb09b89893fd55223ed2d9c06cda7afef867c7449":{"balance":"30000000000000000000000000000000"},
"0xaea37855eacb4b41ca0dbc6c744681f96fe09d94":{"balance":"30000000000000000000000000000000"},
"0xb142159adbfc2690b45da01e49cfa2379ddc2701":{"balance":"30000000000000000000000000000000"},
"0xb7efab17215a43983d766114feb69172587a4090":{"balance":"30000000000000000000000000000000"},
"0xd51ef175736ec808f775c6b687e5be224f1de458":{"balance":"30000000000000000000000000000000"}
},   

	"coinbase": "0x0000000000000000000000000000000000000000", 
  "leader":"0x0ead6cdb8d214389909a535d4ccc21a393dddba9", 
"difficulty": "0x400", 
"extraData": "0x1000",
   
   "elect":[
   {"Account":"0x0ead6cdb8d214389909a535d4ccc21a393dddba9","Stock":1,"Type":2},
   {"Account":"0x6a3217d128a76e4777403e092bde8362d4117773","Stock":1,"Type":2},
   {"Account":"0x8c3d1a9504a36d49003f1652fadb9f06c32a4408","Stock":1,"Type":2},
   {"Account":"0x05e3c16931c6e578f948231dca609d754c18fc09","Stock":1,"Type":2},
   {"Account":"0x55fbba0496ef137be57d4c179a3a74c4d0c643be","Stock":1,"Type":2},
   {"Account":"0x915b5295dde0cebb11c6cb25828b546a9b2c9369","Stock":1,"Type":2},
   {"Account":"0x92e0fea9aba517398c2f0dd628f8cfc7e32ba984","Stock":1,"Type":2},
   {"Account":"0x7eb0bcd103810a6bf463d6d230ebcacc85157d19","Stock":1,"Type":2},
   {"Account":"0xcded44bd41476a69e8e68ba8286952c414d28af7","Stock":1,"Type":2},
   {"Account":"0x9cde10b889fca53c0a560b90b3cb21c2fc965d2b","Stock":1,"Type":2},
   {"Account":"0x7823a1bea7aca2f902b87effdd4da9a7ef1fc5fb","Stock":1,"Type":2},
   {"Account":"0x0a3f28de9682df49f9f393931062c5204c2bc404","Stock":1,"Type":0}],
   
   "version": "0x5000", 
 "gasLimit": "0xEE00000",
   
   "nettopology":{"Type":0,
					"NetTopologyData":[
					{"Account":"0x0ead6cdb8d214389909a535d4ccc21a393dddba9","Position":8192},
					{"Account":"0x6a3217d128a76e4777403e092bde8362d4117773","Position":8193},
					{"Account":"0x8c3d1a9504a36d49003f1652fadb9f06c32a4408","Position":8194},
					{"Account":"0x05e3c16931c6e578f948231dca609d754c18fc09","Position":8195},
					{"Account":"0x55fbba0496ef137be57d4c179a3a74c4d0c643be","Position":8196},
					{"Account":"0x915b5295dde0cebb11c6cb25828b546a9b2c9369","Position":8197},
					{"Account":"0x92e0fea9aba517398c2f0dd628f8cfc7e32ba984","Position":8198},
					{"Account":"0x7eb0bcd103810a6bf463d6d230ebcacc85157d19","Position":8199},
					{"Account":"0xcded44bd41476a69e8e68ba8286952c414d28af7","Position":8200},
					{"Account":"0x9cde10b889fca53c0a560b90b3cb21c2fc965d2b","Position":8201},
					{"Account":"0x7823a1bea7aca2f902b87effdd4da9a7ef1fc5fb","Position":8202},
					{"Account":"0x0a3f28de9682df49f9f393931062c5204c2bc404","Position":0}]},
					
   "signatures":[
   [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100],
   [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100],
   [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100]
   ],
   "nonce": "0x0000000000000050",
   "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
   "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
   "timestamp": "0x00"
}

Path: can be located anywhere. You can direct to this place via --datadir when executing gman

In the file genesis.json :

  • smartcontract-candidate list: includes the NodeID, accounts, deposits, online time, etc of current candidates

How candidate list is generated:

Step 1: Create a txt file named genesis.txt under go-matrix/core/core, where you should specify the nodeid, account and role of each node

Step 2: Run the file create_genesis_data_test.go under go-matrix/core

Step 3: Then a txt file named saveGenesis.txt will be generated, where there's a candidate list. You can copy these to the genesis.json

  • election info: includes the account address, stakes and ID types of all miners as well as validators during the first election cycle

elect PART:

type=2 indicates a validator; type=0 indicates a miner

  • topology: includes the accounts and addresses of all miners as well as validators during the first election cycle (the account information shall be consistent with election information)

nettopology PART:

The role in the topology can be judged by its position information, where 8XXX indicates a validator,and 0-1-2-3... indicates a miner

The above fields should be fine for most purposes, although we'd recommend changing the nonce to some random value so you prevent unknown remote nodes from being able to connect to you. If you'd like to pre-fund some accounts for easier testing, you can populate the alloc field with account configs:

"alloc": {
 "0x0000000000000000000000000000000000000001": {"balance": "111111111"},
 "0x0000000000000000000000000000000000000002": {"balance": "222222222"}
}
Common Profile (name it 'man.json', for example)
{
"BootNode":[
"enode://b624a3fb585a48b4c96e4e6327752b1ba82a90a948f258be380ba17ead7c01f6d4ad43d665bb11c50475c058d3aad1ba9a35c0e0c4aa118503bf3ce79609bef6@192.168.3.162:30303"
],
"BroadNode":[
{"NodeID":"4b2f638f46c7ae5b1564ca7015d716621848a0d9be66f1d1e91d566d2a70eedc2f11e92b743acb8d97dec3fb412c1b2f66afd7fbb9399d4fb2423619eaa514c7","Address":"0x992fcd5f39a298e58776a87441f5ee3319a101a0"}
]
}

Please note: You need to create a directory named chaindata first. This common profile should be put under this directory. Otherwise, you can't start gman due to the inability to read the profile

  • BootNode: includes NodeID and IP of all boot nodes for node discovery
  • BroadNode: includes NodeID and accounts of all broadcast nodes for broadcast service

With the genesis state defined in the above JSON file, you'll need to initialize every gman node with it prior to starting it up to ensure all blockchain parameters are correctly set:

./gman --datadir ./chaindata/ init ./root/genesis.json
Starting up your member nodes

step 1: With the bootnode operational and externally reachable (you can try telnet <ip> <port> to ensure it's indeed reachable), start every subsequent gman node pointed to the bootnode for peer discovery via the --bootnodes flag. It will probably also be desirable to keep the data directory of your private network separated, so do also specify a custom --datadir flag.

$ gman --datadir=path/to/custom/data/folder --bootnodes=<bootnode-enode-url-from-above>

step 2: start up all validator nodes (see genesis.json for configurations of validators)

step 3: start up all broadcast nodes (see man.json for configurations of broadcast nodes)

step 4: start up all miner nodes (see genesis.json for configurations of validators)

Execute the following command:

./gman --identity "MyNodeName" --datadir ./chaindata/ --rpc --rpcaddr 0.0.0.0 --rpccorsdomain "*" --networkid 1 --password ./chaindata/password.txt

Note: password.txt contains your password of the wallet, which can also be placed under /chaindata.

License

Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors

The go-matrix-ethereum library (i.e. all code outside of the cmd directory) is licensed under MIT.

Permission 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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE 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.

Documentation

Overview

Package matrix defines interfaces for interacting with Matrix.

Index

Constants

This section is empty.

Variables

View Source
var NotFound = errors.New("not found")

NotFound is returned by API methods if the requested item does not exist.

Functions

This section is empty.

Types

type CallMsg

type CallMsg struct {
	From     common.Address  // the sender of the 'transaction'
	To       *common.Address // the destination contract (nil for contract creation)
	Gas      uint64          // if 0, the call executes with near-infinite gas
	GasPrice *big.Int        // wei <-> gas exchange ratio
	Value    *big.Int        // amount of wei sent along with the call
	Data     []byte          // input data, usually an ABI-encoded contract method invocation
}

CallMsg contains parameters for contract calls.

type ChainReader

type ChainReader interface {
	BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
	BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
	HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)
	TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)

	// This method subscribes to notifications about changes of the head block of
	// the canonical chain.
	SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (Subscription, error)
}

ChainReader provides access to the blockchain. The methods in this interface access raw data from either the canonical chain (when requesting by block number) or any blockchain fork that was previously downloaded and processed by the node. The block number argument can be nil to select the latest canonical block. Reading block headers should be preferred over full blocks whenever possible.

The returned error is NotFound if the requested item does not exist.

type ChainStateReader

type ChainStateReader interface {
	BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
	StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)
	CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
	NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
}

ChainStateReader wraps access to the state trie of the canonical blockchain. Note that implementations of the interface may be unable to return state values for old blocks. In many cases, using CallContract can be preferable to reading raw contract storage.

type ChainSyncReader

type ChainSyncReader interface {
	SyncProgress(ctx context.Context) (*SyncProgress, error)
}

ChainSyncReader wraps access to the node's current sync status. If there's no sync currently running, it returns nil.

type ContractCaller

type ContractCaller interface {
	CallContract(ctx context.Context, call CallMsg, blockNumber *big.Int) ([]byte, error)
}

A ContractCaller provides contract calls, essentially transactions that are executed by the EVM but not mined into the blockchain. ContractCall is a low-level method to execute such calls. For applications which are structured around specific contracts, the abigen tool provides a nicer, properly typed way to perform calls.

type FilterQuery

type FilterQuery struct {
	FromBlock *big.Int         // beginning of the queried range, nil means genesis block
	ToBlock   *big.Int         // end of the range, nil means latest block
	Addresses []common.Address // restricts matches to events created by specific contracts

	// The Topic list restricts matches to particular event topics. Each event has a list
	// of topics. Topics matches a prefix of that list. An empty element slice matches any
	// topic. Non-empty elements represent an alternative that matches any of the
	// contained topics.
	//
	// Examples:
	// {} or nil          matches any topic list
	// {{A}}              matches topic A in first position
	// {{}, {B}}          matches any topic in first position, B in second position
	// {{A}}, {B}}        matches topic A in first position, B in second position
	// {{A, B}}, {C, D}}  matches topic (A OR B) in first position, (C OR D) in second position
	Topics [][]common.Hash
}

FilterQuery contains options for contract log filtering.

type GasEstimator

type GasEstimator interface {
	EstimateGas(ctx context.Context, call CallMsg) (uint64, error)
}

GasEstimator wraps EstimateGas, which tries to estimate the gas needed to execute a specific transaction based on the pending state. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.

type GasPricer

type GasPricer interface {
	SuggestGasPrice(ctx context.Context) (*big.Int, error)
}

GasPricer wraps the gas price oracle, which monitors the blockchain to determine the optimal gas price given current fee market conditions.

type LogFilterer

type LogFilterer interface {
	FilterLogs(ctx context.Context, q FilterQuery) ([]types.Log, error)
	SubscribeFilterLogs(ctx context.Context, q FilterQuery, ch chan<- types.Log) (Subscription, error)
}

LogFilterer provides access to contract log events using a one-off query or continuous event subscription.

Logs received through a streaming query subscription may have Removed set to true, indicating that the log was reverted due to a chain reorganisation.

type PendingContractCaller

type PendingContractCaller interface {
	PendingCallContract(ctx context.Context, call CallMsg) ([]byte, error)
}

PendingContractCaller can be used to perform calls against the pending state.

type PendingStateEventer

type PendingStateEventer interface {
	SubscribePendingTransactions(ctx context.Context, ch chan<- *types.Transaction) (Subscription, error)
}

A PendingStateEventer provides access to real time notifications about changes to the pending state.

type PendingStateReader

type PendingStateReader interface {
	PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)
	PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)
	PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
	PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
	PendingTransactionCount(ctx context.Context) (uint, error)
}

A PendingStateReader provides access to the pending state, which is the result of all known executable transactions which have not yet been included in the blockchain. It is commonly used to display the result of ’unconfirmed’ actions (e.g. wallet value transfers) initiated by the user. The PendingNonceAt operation is a good way to retrieve the next available transaction nonce for a specific account.

type Subscription

type Subscription interface {
	// Unsubscribe cancels the sending of events to the data channel
	// and closes the error channel.
	Unsubscribe()
	// Err returns the subscription error channel. The error channel receives
	// a value if there is an issue with the subscription (e.g. the network connection
	// delivering the events has been closed). Only one value will ever be sent.
	// The error channel is closed by Unsubscribe.
	Err() <-chan error
}

Subscription represents an event subscription where events are delivered on a data channel.

type SyncProgress

type SyncProgress struct {
	StartingBlock uint64 // Block number where sync began
	CurrentBlock  uint64 // Current block number where sync is at
	HighestBlock  uint64 // Highest alleged block number in the chain
	PulledStates  uint64 // Number of state trie entries already downloaded
	KnownStates   uint64 // Total number of state trie entries known about
}

SyncProgress gives progress indications when the node is synchronising with the Matrix network.

type TransactionReader

type TransactionReader interface {
	// TransactionByHash checks the pool of pending transactions in addition to the
	// blockchain. The isPending return value indicates whether the transaction has been
	// mined yet. Note that the transaction may not be part of the canonical chain even if
	// it's not pending.
	TransactionByHash(ctx context.Context, txHash common.Hash) (tx *types.Transaction, isPending bool, err error)
	// TransactionReceipt returns the receipt of a mined transaction. Note that the
	// transaction may not be included in the current canonical chain even if a receipt
	// exists.
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

TransactionReader provides access to past transactions and their receipts. Implementations may impose arbitrary restrictions on the transactions and receipts that can be retrieved. Historic transactions may not be available.

Avoid relying on this interface if possible. Contract logs (through the LogFilterer interface) are more reliable and usually safer in the presence of chain reorganisations.

The returned error is NotFound if the requested item does not exist.

type TransactionSender

type TransactionSender interface {
	SendTransaction(ctx context.Context, tx *types.Transaction) error
}

TransactionSender wraps transaction sending. The SendTransaction method injects a signed transaction into the pending transaction pool for execution. If the transaction was a contract creation, the TransactionReceipt method can be used to retrieve the contract address after the transaction has been mined.

The transaction must be signed and have a valid nonce to be included. Consumers of the API can use package accounts to maintain local private keys and need can retrieve the next available nonce using PendingNonceAt.

Directories

Path Synopsis
Package accounts implements high level Matrix account management.
Package accounts implements high level Matrix account management.
abi
Package abi implements the Matrix ABI (Application Binary Interface).
Package abi implements the Matrix ABI (Application Binary Interface).
abi/bind
Package bind generates Matrix contract Go bindings.
Package bind generates Matrix contract Go bindings.
keystore
Package keystore implements encrypted storage of secp256k1 private keys.
Package keystore implements encrypted storage of secp256k1 private keys.
usbwallet
Package usbwallet implements support for USB hardware wallets.
Package usbwallet implements support for USB hardware wallets.
usbwallet/internal/trezor
Package trezor contains the wire protocol wrapper in Go.
Package trezor contains the wire protocol wrapper in Go.
blkconsensus
Package bmt provides a binary merkle tree implementation simple nonconcurrent reference implementation for hashsize segment based Binary Merkle tree hash on arbitrary but fixed maximum chunksize This implementation does not take advantage of any paralellisms and uses far more memory than necessary, but it is easy to see that it is correct.
Package bmt provides a binary merkle tree implementation simple nonconcurrent reference implementation for hashsize segment based Binary Merkle tree hash on arbitrary but fixed maximum chunksize This implementation does not take advantage of any paralellisms and uses far more memory than necessary, but it is easy to see that it is correct.
cmd
bootnode
bootnode runs a bootstrap node for the Matrix Discovery Protocol.
bootnode runs a bootstrap node for the Matrix Discovery Protocol.
clef
signer is a utility that can be used so sign transactions and arbitrary data.
signer is a utility that can be used so sign transactions and arbitrary data.
evm
evm executes EVM code snippets.
evm executes EVM code snippets.
faucet
faucet is a Ether faucet backed by a light client.
faucet is a Ether faucet backed by a light client.
gman
gman is the official command-line client for Matrix.
gman is the official command-line client for Matrix.
internal/browser
Package browser provides utilities for interacting with users' browsers.
Package browser provides utilities for interacting with users' browsers.
p2psim
p2psim provides a command-line client for a simulation HTTP API.
p2psim provides a command-line client for a simulation HTTP API.
puppeth
puppeth is a command to assemble and maintain private networks.
puppeth is a command to assemble and maintain private networks.
rlpdump
rlpdump is a pretty-printer for RLP data.
rlpdump is a pretty-printer for RLP data.
swarm
Command bzzhash computes a swarm tree hash.
Command bzzhash computes a swarm tree hash.
utils
Package utils contains internal helper functions for go-matrix commands.
Package utils contains internal helper functions for go-matrix commands.
bitutil
Package bitutil implements fast bitwise operations.
Package bitutil implements fast bitwise operations.
compiler
Package compiler wraps the Solidity compiler executable (solc).
Package compiler wraps the Solidity compiler executable (solc).
hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
math
Package math provides integer math utilities.
Package math provides integer math utilities.
mclock
package mclock is a wrapper for a monotonic clock source
package mclock is a wrapper for a monotonic clock source
Package consensus implements different Matrix consensus engines.
Package consensus implements different Matrix consensus engines.
clique
Package clique implements the proof-of-authority consensus engine.
Package clique implements the proof-of-authority consensus engine.
manash
Package manash implements the manash proof-of-work consensus engine.
Package manash implements the manash proof-of-work consensus engine.
contracts
chequebook
Package chequebook package wraps the 'chequebook' Matrix smart contract.
Package chequebook package wraps the 'chequebook' Matrix smart contract.
ens
Package core implements the Matrix consensus protocol.
Package core implements the Matrix consensus protocol.
asm
Provides support for dealing with EVM assembly instructions (e.g., disassembling them).
Provides support for dealing with EVM assembly instructions (e.g., disassembling them).
bloombits
Package bloombits implements bloom filtering on batches of data.
Package bloombits implements bloom filtering on batches of data.
rawdb
Package rawdb contains a collection of low level database accessors.
Package rawdb contains a collection of low level database accessors.
state
Package state provides a caching layer atop the Matrix state trie.
Package state provides a caching layer atop the Matrix state trie.
types
Package types contains data types related to Matrix consensus.
Package types contains data types related to Matrix consensus.
vm
vm/runtime
Package runtime provides a basic execution model for executing EVM code.
Package runtime provides a basic execution model for executing EVM code.
wasm
Package wasm provides functions for reading and parsing WebAssembly modules.
Package wasm provides functions for reading and parsing WebAssembly modules.
wasm/leb128
Package leb128 provides functions for reading integer values encoded in the Little Endian Base 128 (LEB128) format: https://en.wikipedia.org/wiki/LEB128
Package leb128 provides functions for reading integer values encoded in the Little Endian Base 128 (LEB128) format: https://en.wikipedia.org/wiki/LEB128
wasm/operators
Package operators provides all operators used by WebAssembly bytecode, together with their parameter and return type(s).
Package operators provides all operators used by WebAssembly bytecode, together with their parameter and return type(s).
bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
bn256/google
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
sm2
crypto/x509 add sm2 support
crypto/x509 add sm2 support
sm3
sm4
Package event deals with subscriptions to real-time events.
Package event deals with subscriptions to real-time events.
filter
Package filter implements event filters.
Package filter implements event filters.
internal
debug
Package debug interfaces Go runtime debugging facilities.
Package debug interfaces Go runtime debugging facilities.
guide
Package guide is a small test suite to ensure snippets in the dev guide work.
Package guide is a small test suite to ensure snippets in the dev guide work.
jsre
Package jsre provides execution environment for JavaScript.
Package jsre provides execution environment for JavaScript.
jsre/deps
Package deps contains the console JavaScript dependencies Go embedded.
Package deps contains the console JavaScript dependencies Go embedded.
manapi
Package manapi implements the general Matrix API functions.
Package manapi implements the general Matrix API functions.
web3ext
package web3ext contains gman specific web3.js extensions.
package web3ext contains gman specific web3.js extensions.
les
Package les implements the Light Matrix Subprotocol.
Package les implements the Light Matrix Subprotocol.
flowcontrol
Package flowcontrol implements a client side flow control mechanism Package flowcontrol implements a client side flow control mechanism
Package flowcontrol implements a client side flow control mechanism Package flowcontrol implements a client side flow control mechanism
Package light implements on-demand retrieval capable state and chain objects for the Matrix Light Client.
Package light implements on-demand retrieval capable state and chain objects for the Matrix Light Client.
log
man
Package man implements the matrix protocol.
Package man implements the matrix protocol.
downloader
Package downloader contains the manual full chain synchronisation.
Package downloader contains the manual full chain synchronisation.
fetcher
Package fetcher contains the block announcement based synchronisation.
Package fetcher contains the block announcement based synchronisation.
filters
Package filters implements an matrix filtering system for block, transactions and log events.
Package filters implements an matrix filtering system for block, transactions and log events.
tracers
Package tracers is a collection of JavaScript transaction tracers.
Package tracers is a collection of JavaScript transaction tracers.
tracers/internal/tracers
Package tracers contains the actual JavaScript tracer assets.
Package tracers contains the actual JavaScript tracer assets.
Package manclient provides a client for the Matrix RPC API.
Package manclient provides a client for the Matrix RPC API.
Package manstats implements the network stats reporting service.
Package manstats implements the network stats reporting service.
exp
Package gman contains the simplified mobile APIs to go-matrix.
Package gman contains the simplified mobile APIs to go-matrix.
Package node sets up multi-protocol Matrix nodes.
Package node sets up multi-protocol Matrix nodes.
p2p
discover
Package discover implements the Node Discovery Protocol.
Package discover implements the Node Discovery Protocol.
discv5
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
Package discv5 implements the RLPx v5 Topic Discovery Protocol.
enr
Package enr implements Matrix Node Records as defined in EIP-778.
Package enr implements Matrix Node Records as defined in EIP-778.
nat
Package nat provides access to common network port mapping protocols.
Package nat provides access to common network port mapping protocols.
netutil
Package netutil contains extensions to the net package.
Package netutil contains extensions to the net package.
protocols
Package protocols is an extension to p2p.
Package protocols is an extension to p2p.
simulations
Package simulations simulates p2p networks.
Package simulations simulates p2p networks.
man
Package rlp implements the RLP serialization format.
Package rlp implements the RLP serialization format.
Package rpc provides access to the exported methods of an object across a network or other I/O connection.
Package rpc provides access to the exported methods of an object across a network or other I/O connection.
signer
rules/deps
Package deps contains the console JavaScript dependencies Go embedded.
Package deps contains the console JavaScript dependencies Go embedded.
api
api/http
Show nicely (but simple) formatted HTML error pages (or respond with JSON if the appropriate `Accept` header is set)) for the http package.
Show nicely (but simple) formatted HTML error pages (or respond with JSON if the appropriate `Accept` header is set)) for the http package.
Package tests implements execution of Matrix JSON tests.
Package tests implements execution of Matrix JSON tests.
Package trie implements Merkle Patricia Tries.
Package trie implements Merkle Patricia Tries.
whisper
whisperv5
Package whisperv5 implements the Whisper protocol (version 5).
Package whisperv5 implements the Whisper protocol (version 5).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL