Skip to content
Guy Davis edited this page Nov 3, 2021 · 59 revisions

Setup

On first run of Machinaris as fullnode or farmer, you'll need to either import a key or generate a new one. (Note, if running a stripped down Machinaris worker such as a harvester or plotter, the private key is not necessary.)

GenerateKey

Import Key Mnemonic

If browsing to your localhost running Machinaris, you may simply enter your 24-word single-space single-line mnemonic seed phrase into the form shown. Machinaris will write it to /root/.chia/mnemonic.txt in the container, add to the Chia keys, and start services.

If not browsing localhost, you may prefer to enter the mnemonic directly into a file yourself, then restart the Machinaris container. Details below.

OR Generate New Key

If you don't have an existing private key to import, just launch Machinaris and browse to the WebUI on port 8926. You'll be presented with a screen where you can choose to have one generated for you. Just click 'Generate New Key' to proceed.

Copy to Forks

Once you create or import your key above, it will be held in ~/.machinaris/mnemonic.txt file on disk. If you will be farming more than just Chia, but also forks such as Flax, HDDCoin, NChain, etc, then you also need to copy this mnemonic.txt file over into their application data folder:

cp ~/.machinaris/mnemonic.txt ~/.machinaris-flax/
cp ~/.machinaris/mnemonic.txt ~/.machinaris-hddcoin/
...etc...

Then restart the particular fork containers, such as machinaris-flax, to have them pick up this key.

View Public Key

Click the link 'Settings | Keys' in Machinaris to view public key details. Alternatively, you can execute the chia show wallet command from in-container (docker exec -it machinaris bash)

View Private Key

However, the Machinaris WebUI won't show your existing private key for security. To view private key details securely, you need to access the file described above on your host filesystem.

Your new key can be found at /root/.chia/mnemonic.txt in the container. This usually maps to these locations on the host OS:

  • Linux: ~/.machinaris/mnemonic.txt
  • Windows: C:/Users/USERNAME/.machinaris/mnemonic.txt
  • Unraid: /mnt/user/appdata/machinaris/mnemonic.txt

Alternatively execute chia wallet show --show-mnemonic-seed from in-container (docker exec -it machinaris bash).

Security

Using a Cold Wallet

All Chia users, including all Machinaris users, are strongly encouraged to create a cold wallet to send any wins/payouts. See How To Create A Cold Wallet For Chia Coin and Chia Forks - a great video tutorial by Digital Spaceport:

Digital Spaceport

Import SSH Private Key

Plotman supports an optional Archive feature that will copy completed plots to an archive disk via rsync. It relies upon the plotman process in-container to be able to ssh as the configured archive user into your rsync server. To add the required SSH private at start-up of the machinaris container, add the following to your docker run:

On Windows:

C:\Users\USER\.ssh\id_rsa:/id_rsa:ro

On Linux:

/Users/USER/.ssh/id_rsa:/id_rsa:ro

Be sure to change the USER name. This will mount your id_rsa private key file in the container read-only, configuring the local SSH to use it when connecting out to your rsync server.

Then you'll need to run plotman archive from the in-container CLI which will send plots when completed. For details on configuring the destination rsync server, see the Plotman wiki.

File Mnemonic Import

To manually add your file, with an existing mnemonic-seed (24 words, space-separated, single-line) to use, place the single line into a text file named mnemonic.txt in above /home/user/.machinaris or similar (/mnt/user/appdata/machinaris on Unraid) host volume. In-container, this will be found at /root/.chia/mnemonic.txt.

If you want to use more than one mnemonic key file, you can pass them as a colon-separated list of in-container paths for example:

-e keys="/root/.chia/mnemonic1.txt:/root/.chia/mnemonic2.txt"

Docker Secrets

As an alternative to above, if you wish to use the Secrets mechanism of docker-compose to store your mnemonic, update your docker-compose.yml as follows:

version: '3.7' 
services: 
    machinaris: 
        image: ghcr.io/guydavis/machinaris:latest 
        container_name: machinaris 
        hostname: aragorn 
        restart: always 
        volumes: 
            - ~/.machinaris:/root/.chia 
            - "/mnt/plots:/plots1" 
            - "/mnt/temp:/plotting" 
        environment: 
            - TZ=America/Edmonton 
            - mode=fullnode 
            - worker_address=192.168.1.129 
            - plots_dir=/plots1 
            - blockchains=chia 
        ports: 
            - 8926:8926 
            - 8927:8927 
            - 8444:8444 
            - 8447:8447
        secrets:
            - mnemonic
secrets:
  mnemonic:
    file: ./mnemonic.txt

You can even use a separate read-only volume to mount just your mnemonic.txt at startup. For example, if your mnemonic is in ~/keyfile on your host, then pass -v ./keyfile:/root/.chia/mnemonic.txt:ro

Blockchain Initialization

On first launch of Machinaris, the Chia farmer service begins to sync the blockchain from peers on the network. The current design of the Chia peer network means this initial sync of the blockchain database takes multiple days. Also, the Chia design precludes farming your plots before the blockchain is fully synced. Therefore, normally a new install of Chia requires days to become fully functional.

Machinaris however takes a much faster approach on fresh setup, by directly downloading a recently synced blockchain database directly from Chia Forks Blockchains. The blockchain database is approaching 30 GB in size, so takes multiple minutes to download initially, before setup may begin. However, this initial download saves days of waiting for the blockchain to sync as described above. So please be patient!

Blockchain Syncing

If you prefer to have Chia (or the other forks such as Flax, Chives, etc) sync the blockchain database themselves over a few days, then simply set the following environment variable on the launch of the Machinaris container: blockchain_skip_download = true

Blockchain Import

Alternatively, for users migrating to Machinaris from another Chia installation, it is possible to use your synced blockchain database instead. After initially launching Machinaris the first time, just stop the machinaris container and then:

rm -rf ~/.machinaris/mainnet/
cp /path/to/your/mainnet  ~/.machinaris/

Then start the Machinaris container again. The Chia farming services will use the blockchain and wallet dbs that you have copied over above, also saving days of syncing time.

Clone this wiki locally