Deploy spin-operator
Last updated
Last updated
spin-operator consists of an Express.js server that accepts player submission and then relay the submission to the blockchain.
Create a new file .env
and use as example to fill it in.
Reference provides details on filling the environments: spin-operator reference
The operator write to the chain in two most common ways. settle
a submission and submit
a submission. In order to handle concurrent requests from many different players, the operator cannot reliably rely on a single wallet to submit all the transactions on-chain. This is due to each on-chain transaction needs to have an unique nonce to prevent replay attacks. Thus, a good practice is to confirm a transaction is mined, then submit the second one.
One way to scale the operator's concurrency is to let the operator own multiple wallets.
Create a file name wallets.json
wallets.json
should expect a list of EVM addresses and their corresponding private keys like so:
Make sure all of the wallets has enough ETH to pay for gas fee.
There're few options running a spin-operator. To quickly run an instance, we recommend direly run the image from docker-hub.
Node.js >= 20
Clone the OPZK repo.
Install the NPM packages
Fill in .env
following instruction from above
Docker version > 25.0.0
We already build a latest image of the spin-operator.
The image is under docker pull zkspin/spin-operator:latest