Rosetta test final (#4080)

* add docker-compose.yaml
* fix bug
* test remove cache
* change timeout to 60 second
* add offline node docker compose file

Co-authored-by: haodi <82733821@qq.com>
pull/4083/head
LuttyYang 3 years ago committed by GitHub
parent 3e4aab1b53
commit 9d16d91df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      rosetta/common/config.go
  2. 18
      rosetta/infra/docker-compose-offline.yaml
  3. 18
      rosetta/infra/docker-compose.yaml
  4. 2
      rosetta/infra/run.sh
  5. 4
      rosetta/services/block.go

@ -32,10 +32,10 @@ const (
var (
// ReadTimeout ..
ReadTimeout = 30 * time.Second
ReadTimeout = 60 * time.Second
// WriteTimeout ..
WriteTimeout = 30 * time.Second
WriteTimeout = 60 * time.Second
// IdleTimeout ..
IdleTimeout = 120 * time.Second

@ -0,0 +1,18 @@
version: "2"
services:
node:
build:
context: .
dockerfile: Dockerfile
privileged: true
ports:
- "8080:9700"
environment:
- "RCLONE_DB_0_URL=release:pub.harmony.one/mainnet.min.22816573/harmony_sharddb_0"
- "DATA_NAME=harmony_sharddb_0"
volumes:
- "./data:/root/data/"
command: [ "-c", "harmony-mainnet.conf", "--run.shard=0", "--sharddata.enable=true", "--run.offline", "--dns.server=false", "--dns.client=false", "--sync.legacy.server=false", "--sync.legacy.client=false" ]
labels:
service_group: rosetta

@ -0,0 +1,18 @@
version: "2"
services:
node:
build:
context: .
dockerfile: Dockerfile
privileged: true
ports:
- "8080:9700"
environment:
- "RCLONE_DB_0_URL=release:pub.harmony.one/mainnet.min.22816573/harmony_sharddb_0"
- "DATA_NAME=harmony_sharddb_0"
volumes:
- "./data:/root/data/"
command: [ "-c", "harmony-mainnet.conf", "--run.shard=0", "--sharddata.enable=true" ]
labels:
service_group: rosetta

@ -8,7 +8,7 @@ BASE_ARGS=(--http.ip "0.0.0.0" --ws.ip "0.0.0.0" --http.rosetta --node_type "exp
DATA_NAME="${DATA_NAME:=harmony_db_0}"
if [ -n "$RCLONE_DB_0_URL" ]; then
rclone -P -L sync $RCLONE_DB_0_URL $DATA/$DATA_NAME --multi-thread-streams 4 --transfers=8
rclone -P -L sync $RCLONE_DB_0_URL $DATA/$DATA_NAME --transfers=64
fi
mkdir -p "$LOGS"

@ -164,10 +164,10 @@ func (s *BlockAPI) BlockTransaction(
}
return response, rosettaError2
}
state, _, err := s.hmy.StateAndHeaderByNumber(ctx, rpc.BlockNumber(request.BlockIdentifier.Index))
state, _, err := s.hmy.StateAndHeaderByNumber(ctx, rpc.BlockNumber(blk.NumberU64()))
if state == nil || err != nil {
return nil, common.NewError(common.BlockNotFoundError, map[string]interface{}{
"message": fmt.Sprintf("block state not found for block %v", request.BlockIdentifier.Index),
"message": fmt.Sprintf("block state not found for block %v", blk.NumberU64()),
})
}

Loading…
Cancel
Save