diff --git a/rosetta/common/config.go b/rosetta/common/config.go index feb30d67a..e6cbacf01 100644 --- a/rosetta/common/config.go +++ b/rosetta/common/config.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 diff --git a/rosetta/infra/docker-compose-offline.yaml b/rosetta/infra/docker-compose-offline.yaml new file mode 100644 index 000000000..4d6f55794 --- /dev/null +++ b/rosetta/infra/docker-compose-offline.yaml @@ -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 \ No newline at end of file diff --git a/rosetta/infra/docker-compose.yaml b/rosetta/infra/docker-compose.yaml new file mode 100644 index 000000000..581bbec62 --- /dev/null +++ b/rosetta/infra/docker-compose.yaml @@ -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 \ No newline at end of file diff --git a/rosetta/infra/run.sh b/rosetta/infra/run.sh index e4b5f2c52..c096fb5be 100644 --- a/rosetta/infra/run.sh +++ b/rosetta/infra/run.sh @@ -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" diff --git a/rosetta/services/block.go b/rosetta/services/block.go index e9eece2a6..c488c5ff9 100644 --- a/rosetta/services/block.go +++ b/rosetta/services/block.go @@ -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()), }) }