Skip to content

celer-network/go-rollup

Repository files navigation

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.

About

Go implementation of the Celer Optimistic Rollup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published