Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for any initial sync problems with Arbitrum #2913

Closed
taleldayekh opened this issue Aug 27, 2021 · 1 comment · Fixed by #2968
Closed

Check for any initial sync problems with Arbitrum #2913

taleldayekh opened this issue Aug 27, 2021 · 1 comment · Fixed by #2968
Assignees

Comments

@taleldayekh
Copy link
Contributor

Description

Make sure the deployment can scan the whole network fine even with old contracts.

Acceptance criteria

Tasks

  • [ ]
@andrevmatos
Copy link
Contributor

andrevmatos commented Oct 9, 2021

I got a pair of clients running smoothly after #2911 🎉
It required a small fix on the first client, in order to be able to get started on a TokenNetworkRegistry without registered TokenNetwork yet, but after fixing it (#2968), I could deploy token 0xfd9ad9bb6353c6AdE47E3F8A4296Bf2ABf707BC4 on Arbitrum Rinkeby on this tx.

These are the instructions to get a LC running on Arbitrum currently:

  1. Go to https://bridge.arbitrum.io/ , connect a Rinkeby metamask account you'll be using on Raiden, and deposit some ETH to it (takes ~10min)
  2. Start a CLI on above account, with these parameters:
./raiden --eth-rpc-endpoint=https://rinkeby.arbitrum.io/rpc \
  --matrix-server=https://transport.arbitrum.env.raiden.network \
  --pathfinding-service-address=https://pfs.arbitrum.env.raiden.network \
  --user-deposit-contract-address=0xc73fF44a5b216ef9D79F5cF30B221B589102aE00:5416882

This will take a while on first run , because since there's no deployment.json file yet for Arbitrum, it needs to scan from UDC entrypoint fromBlock=1 (or the above provided blockNumber) for registered TokenNetworks. It'll then find token 0xfd9ad9bb6353c6AdE47E3F8A4296Bf2ABf707BC4 registered on TokenNetwork 0xe500036e9CC55C2141965E5a39DaFb8812261841, and from there, all scans will take this block as starting point and should be way faster.

For completeness, to register that TokenNetwork, I did: http -v PUT http://localhost:5001/api/v1/tokens/0xfd9ad9bb6353c6AdE47E3F8A4296Bf2ABf707BC4

  1. After the client is synced, mint some TKN and SVT, and deposit SVT to UDC:
# mint 1000 TTT
http -v http://localhost:5001/api/v1/_testing/tokens/0xfd9ad9bb6353c6AdE47E3F8A4296Bf2ABf707BC4/mint value=1000000000000000000000
# mint 300 SVT
http -v http://localhost:5001/api/v1/_testing/tokens/0x9A2056b5DD74c3B87C62F6bDFA271C9293E78D6f/mint value=300000000000000000000
# deposit 160 SVT to UDC
http -v http://localhost:5001/api/v1/user_deposit total_deposit=160000000000000000000
  1. Repeat in another client to use as partner
  2. Open a channel with 40 TTT as deposit with your other client: http -v PUT http://localhost:5002/api/v1/channels token_address=0xfd9ad9bb6353c6AdE47E3F8A4296Bf2ABf707BC4 partner_address=0xb0d5EeAeB7b084a2ba92C24b79f4f2D079A3062b settle_timeout:=110 total_deposit=40000000000000000000
  3. Transfer: http -v http://localhost:5002/api/v1/payments/0xfd9ad9bb6353c6AdE47E3F8A4296Bf2ABf707BC4/0xb0d5EeAeB7b084a2ba92C24b79f4f2D079A3062b amount=1337

No other changes were needed, client runs fairly well out-of-the-box.

Edit: updated the addresses to the new deployment, which uses ArbSys(100).arbBlockNumber() in place of block.number in contracts, in order to match client's view of eth_blockNumber and transaction/receipt/logs's blockNumber, which returns L2 block, so timeouts and signatures are consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants