Skip to content

Running the Matryx Ethereum Private Chain [OSX]

Sam Hesssenauer edited this page Jan 6, 2018 · 3 revisions

Matryx Ethereum Private Chain on Mac OSX

alt text

To begin, make sure you have downloaded this repository and Geth. This will give you access to our private Ethereum blockchain, provide you the means to import your MTX-positive Ethereum key, and begin interacting with our smart contract.

Download Geth

Navigate to the project directory, change into the private chain folder and initialize the chain.

cd privateChain
initialize-block-locally.sh

Next you want to run the node from your command line so you sync with the network...

open_geth_console.sh

Open_geth_console

Make sure that the ChainID is correctly set to 777 and the NetworkID is 628799 so you know you are on the right chain.

PS: if it is shooting out way too much debug logs, then run a debug.verbosity(3) and it should only show info, warnings and errors only after that.

You can always check if you have any peers by entering the following: web3.admin.peers

Now you need to import your wallet. Note: YOU CAN ONLY INTERACT WITH THE PLATFORM IF YOU HAVE MATRYX TOKENS IN YOUR WALLET ON MAINNET AND YOU ARE USING THE SAME WALLET HERE.

web3.personal.importRawKey('[private key]', '[passphrase]')

You will need to start mining so that you have enough ethereum to interact with the platform contracts on the private chain. So you will need to set your etherbase to your wallet address and set the miner on.

web3.eth.setEtherbase("<yourWalletAddress>")
web3.miner.start(1)

Also make sure your account is default

web3.eth.defaultAccount = web3.personal.listAccounts[0]

You can check your balance to make sure you have enough eth to make a transaction with the following:

web3.eth.getBalance("<yourWalletAddress")

Next you want to unlock your account before you attempt to connect to the platform so that you can send transactions to the Platform.

web3.personal.unlockAccount('[public key]', '[passphrase]', [number of seconds to keep account unlocked])

Here again, ‘[public key]’ is your public key in quotes, ‘[passphrase]’ is your passphrase in quotes, and the third parameter is how long you’d like your account to remain unlocked. This one is up to you, however we recommend an amount of time no longer than you plan to spend interacting with the platform. (3600 seconds is one hour.) This being said, closing the terminal window will always lock your account again.

Congrats!

You now have the Matryx Private chain node running locally. Now you can interact with the Matryx Platform directly or you can use one of our Matryx Interfaces.

Below is the Matryx Genesis block we use in our private chain if you are interested:

{
    "config": {
        "chainId": 777,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "nonce": "0x0000000000000042",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x00",
    "gasLimit": "0xBB40E3C0",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x11f2915576dc51dffb246959258e8fe5a1913161",
    "alloc": {
        "11f2915576dc51dffb246959258e8fe5a1913161": {
            "balance": "200000000000000000000000"
        }
    }
}