Skip to content

Commit

Permalink
Merge branch 'for-ramus-sdk' into chore/add-shell-running-l2fullnode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mdaiki0730 authored Oct 30, 2023
2 parents 1136364 + 9bf681f commit 0a1b2c3
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 92 deletions.
Binary file modified demo/L1/simd-darwin-arm64
Binary file not shown.
24 changes: 22 additions & 2 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Demo

- Run the test script, start the L1 chain and L2 sequencer, and then run the tx.
1. Reset L1 and L2 data
```
./reset.sh
```

2. Run L1 chain
```
./run_chain.sh
```

3. Create rollup & register sequencer info
```
./prepare_rollup.sh
```

3. Run L2 sequencer
```
./run_sequencer.sh
```

4. Execute bank tx
```
./test_sequencer.sh
```
```
17 changes: 17 additions & 0 deletions demo/reset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
L2BINARYNAME=rollupd
L1_KEYRING_DIR=~/.simapp
L2_KEYRING_DIR=~/.l2simapp

# Remove L1 data
pkill simd-darwin-arm64
rm -rf $L1_KEYRING_DIR

# Remove L2 data
if [ -x "$(which ${L2BINARYNAME})" ]; then
echo "clear L2 Binary"
pkill $L2BINARYNAME
rm $GOPATH/bin/$L2BINARYNAME
fi

rm -rf $L2_KEYRING_DIR
4 changes: 0 additions & 4 deletions demo/run_chain.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

# Remove data
pkill ./L1/simd-darwin-arm64
rm -rf ~/.simapp

# Prepare chain
TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have"
BASE_DIR=~/.simapp
Expand Down
28 changes: 28 additions & 0 deletions demo/run_sequencer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
L2BINARYNAME=rollupd
ROLLUP_NAME=test-rollup
L1_CHAIN_ID=sim
L2_CHAIN_ID=sim2
L1_KEYRING_DIR=~/.simapp
L2_KEYRING_DIR=~/.l2simapp
RPC_URI=http://localhost:26659
TEST_SEQUENCER_ADDRESS=link1twsfmuj28ndph54k4nw8crwu8h9c8mh3rtx705
SEQUENCER_DIR=simapp0
TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have"

cd ..

# Build & rename
make build && cp -r build/simd $GOPATH/bin/$L2BINARYNAME
${L2BINARYNAME} version

# Init sequencer

${L2BINARYNAME} init rollupdemo --home $L2_KEYRING_DIR/$SEQUENCER_DIR --chain-id $L2_CHAIN_ID > /dev/null 2>&1
${L2BINARYNAME} keys add validator --keyring-backend=test --home $L2_KEYRING_DIR/$SEQUENCER_DIR --recover --account=0 <<< ${TEST_MNEMONIC} > /dev/null 2>&1
${L2BINARYNAME} add-genesis-account $(${L2BINARYNAME} --home $L2_KEYRING_DIR/$SEQUENCER_DIR keys show validator -a --keyring-backend=test) 100000000000stake,100000000000tcony --home $L2_KEYRING_DIR/$SEQUENCER_DIR > /dev/null 2>&1
${L2BINARYNAME} gentx validator 10000000000stake --keyring-backend=test --home $L2_KEYRING_DIR/$SEQUENCER_DIR --chain-id=$L2_CHAIN_ID > /dev/null 2>&1
${L2BINARYNAME} collect-gentxs --home $L2_KEYRING_DIR/$SEQUENCER_DIR > /dev/null 2>&1

# Run L2 sequencer
${L2BINARYNAME} start --home $L2_KEYRING_DIR/$SEQUENCER_DIR --p2p.laddr "tcp://0.0.0.0:26556" --grpc.address "0.0.0.0:9190" --grpc-web.address "0.0.0.0:9191" --rollkit.sequencer "true" --rollkit.da_layer finschia --rollkit.da_config='{"rpc_uri":"'$RPC_URI'","chain_id":"'$L1_CHAIN_ID'","keyring_dir":"'$L1_KEYRING_DIR'","from":"'$TEST_SEQUENCER_ADDRESS'", "rollup_name":"'$ROLLUP_NAME'"}' > $L2_KEYRING_DIR/$L2_CHAIN_ID.log 2>&1 &
2 changes: 0 additions & 2 deletions demo/test_sequencer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ L1_CHAIN_ID=sim
L2_CHAIN_ID=sim2
L1_KEYRING_DIR=~/.simapp
L2_KEYRING_DIR=~/.l2simapp
NAMESPACE_ID=$(openssl rand -hex 8)
RPC_URI=http://localhost:26659
TEST_SEQUENCER_ADDRESS=link1twsfmuj28ndph54k4nw8crwu8h9c8mh3rtx705
DA_BLOCK_HEIGH=1
SEQUENCER_DIR=simapp0
TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have"

Expand Down
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ go 1.20
module github.com/Finschia/finschia-rdk

require (
github.com/Finschia/finschia-sdk v0.47.0-rc7.0.20230825075051-0d2a3d632ad8
github.com/Finschia/finschia-sdk v0.47.0-rc7.0.20230907054755-0e8b532b14f7
github.com/Finschia/ostracon v1.1.2-0.20230825070344-b9cf421a361e
github.com/Finschia/ramus v0.7.5-0.20230904043153-17c20572637d
github.com/Finschia/ramus v0.7.5-0.20230913025231-31ce853b82a3
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/btcsuite/btcd v0.22.1
github.com/coinbase/rosetta-sdk-go v0.8.3
Expand All @@ -21,7 +21,7 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/improbable-eng/grpc-web v0.15.0
github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b
github.com/jhump/protoreflect v1.15.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/rakyll/statik v0.1.7
Expand Down Expand Up @@ -223,7 +223,9 @@ require (
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.11.0 // indirect
gonum.org/v1/gonum v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 0a1b2c3

Please sign in to comment.