Dark Forest Dev Guides
1.0.0
1.0.0
  • Developing for Dark Forest!
  • Connecting to the blockchain
    • What is an RPC endpoint?
    • Changing your RPC endpoint
    • Running your own xDAI node
  • Plugins
    • What is a plugin?
    • Writing your first plugin
    • Porting v0.5 plugins to v0.6
  • Mining
    • What is mining?
    • Sharing map data
    • Running a headless miner
    • Connecting to a remote (headless) miner
  • Developer resources
    • Running a custom client
    • Developing plugins locally
    • 3rd-party contract development
    • Dark Forest subgraph
    • How to query a subgraph
  • SNARKing
    • Running a remote SNARKer
  • Contributing
    • Contributing to this knowledge base
Powered by GitBook
On this page
  • Dependencies
  • Installing on a Local Server (Mac, Unix)
  • Connecting to server
  • Troubleshooting

Was this helpful?

  1. SNARKing

Running a remote SNARKer

PreviousHow to query a subgraphNextContributing to this knowledge base

Last updated 3 years ago

Was this helpful?

Dark Forest is powered by ZK-Snark technology, a cryptographic technique that can be used to prove the correctness of a function without revealing the inputs or logic of the function.

Dark Forest uses this technique to verify moves within the game are valid without revealing the location of planets to folks snooping on-chain. This technique (Zk-snark Proof Generation) is computationally expensive! Let's move that computation outside of your browser instance.

Dependencies

  • Node.js: install

  • Git: follow instructions

Installing on a Local Server (Mac, Unix)

First, get a copy of the code from Github.

git clone https://github.com/Bind/df-snarker

Enter the df-snarker directory.

cd df-snarker

Install code dependencies from NPM.

npm install

Start the server.

npm run start

If you are running the server on your machine with the default configuration you can click to verify it's working! You should see v.6 Round 1 Dark Forest Snarking Server in your browser.

Connecting to server

  • Add the IP address or the URL of the machine running the server into the plugin and set the concurrency to 1. (You can set the concurrency higher if you have a very powerful machine).

That is it! You should be generating your move snarks outside of your browser.

Troubleshooting

Like the remote miner, if your server doesn't have an ssl cert (it probably doesn't) then you need to enable mixed content in your browser.

Be sure to disable adblockers as they can block outbound requests from the browser to the server, causing moves to fail!

If you are running the snarking server on the same machine as your browser be sure to use http:// not https:// when connecting to it!

Copy the remote snarker plugin code from the

node.js v.14
here
here
plugins repository