go-rollup

module
v0.0.0-...-c1b05a4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT

README

Go implementation of the Celer Optimistic Rollup

See the contract repo for an overview of the Celer rollup architecture.

Examples for interacting with the sidechain testnet on Ropsten

  1. Make sure you have go, geth and make installed.
  2. Prepare an Ethereum keystore file with an empty password. Eg. run:
geth account new --lightkdf --keystore <path-to-keystore-folder>
  1. We have mapped an ERC-20 token named MOON from Ropsten to the sidechain. Join our Discord server. Ping us to obtain some MOON tokens and sidechain ETH for gas. You should also obtain some Ropsten ETH from places like the MetaMask faucet.
  2. Clone the repository and install the demo binary:
git clone https://github.com/celer-network/go-rollup
cd go-rollup
make install-demo
  1. Deposit into the sidechain:
rollupdemo deposit --keystore <path-to-keystore-file> --amount <amount>

This deposits <amount> MOON tokens into the sidechain.

  1. For an example of account-to-account transfer, run:
rollupdemo transfer-to-account --keystore <path-to-keystore-file> --recipient <recipient-address> --amount <amount>

This transfers <amount> MOON tokens from the sender to the recipient.

  1. For an example of contract interaction, run:
rollupdemo transfer-to-contract --keystore <path-to-keystore-file> --amount <amount>

This deploys a dummy dApp contract on the sidechain and sends <amount> MOON tokens to it.

A few more details

  1. Deposit is sent to DepositWithdrawManager contract on Ropsten. The rollup aggregator will relay the deposit and mint corresponding amount of tokens on the sidechain.
  2. Optional rollup security for account-to-account transfers is ensured by registering on the AccountRegistry.
  3. Transfer to contracts and external accounts are similar to a regular ERC-20 transfer, with the exception that an additional signature needs to be supplied (Example).
  4. The rollup aggregator will pack the transfers into rollup blocks and commit to Ropsten.

Directories

Path Synopsis
cmd
db
Package log is a global and configurable logger pkg, based on zerolog (https://github.com/rs/zerolog) You can configure this logger using a toml configuration file.
Package log is a global and configurable logger pkg, based on zerolog (https://github.com/rs/zerolog) You can configure this logger using a toml configuration file.
Package smt implements a Sparse Merkle tree.
Package smt implements a Sparse Merkle tree.
tools

Jump to

Keyboard shortcuts

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