https://github.com/celer-network/go-rollup
Go implementation of the Celer Optimistic Rollup
https://github.com/celer-network/go-rollup
Last synced: 18 days ago
JSON representation
Go implementation of the Celer Optimistic Rollup
- Host: GitHub
- URL: https://github.com/celer-network/go-rollup
- Owner: celer-network
- License: mit
- Created: 2020-02-27T19:53:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-06T20:17:19.000Z (over 5 years ago)
- Last Synced: 2023-07-27T21:59:11.064Z (over 2 years ago)
- Language: Go
- Homepage:
- Size: 226 KB
- Stars: 3
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go implementation of the Celer Optimistic Rollup
See the [contract](https://github.com/celer-network/rollup-contracts)
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:
```shellscript
geth account new --lightkdf --keystore
```
3. We have mapped an ERC-20 token named MOON from Ropsten to the sidechain. Join our [Discord](https://discord.gg/uGx4fjQ)
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](https://faucet.metamask.io).
4. Clone the repository and install the demo binary:
```shellscript
git clone https://github.com/celer-network/go-rollup
cd go-rollup
make install-demo
```
5. Deposit into the sidechain:
```shellscript
rollupdemo deposit --keystore --amount
```
This deposits `` MOON tokens into the sidechain.
6. For an example of account-to-account transfer, run:
```shellscript
rollupdemo transfer-to-account --keystore --recipient --amount
```
This transfers `` MOON tokens from the sender to the recipient.
6. For an example of contract interaction, run:
```shellscript
rollupdemo transfer-to-contract --keystore --amount
```
This deploys a dummy dApp
[contract](https://github.com/celer-network/rollup-contracts/blob/8a1d735cb4af3aa557d106701a73e65ff7a22f00/contracts/sidechain/DummyApp.sol)
on the sidechain and sends `` MOON tokens to it.
## A few more details
1. Deposit is sent to [DepositWithdrawManager](https://github.com/celer-network/rollup-contracts/blob/8a1d735cb4af3aa557d106701a73e65ff7a22f00/contracts/mainchain/DepositWithdrawManager.sol) 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](https://github.com/celer-network/rollup-contracts/blob/8a1d735cb4af3aa557d106701a73e65ff7a22f00/contracts/mainchain/AccountRegistry.sol#L12).
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](https://github.com/celer-network/go-rollup/blob/5ae956cadfb852163bd208d2a33156140c994461/test/token_mapper.go#L153)).
4. The rollup aggregator will pack the transfers into rollup blocks and commit to Ropsten.