Docker-compose部署TRX节点

news2024/11/26 20:21:20

1、编写Dockerfile

root@ubuntu:~# mkdir /data/docker-compose/trx -p
root@ubuntu:~# cd /data/docker-compose/trx/
root@ubuntu:/data/docker-compose/trx# ls
root@ubuntu:/data/docker-compose/trx# vim Dockerfile
root@ubuntu:/data/docker-compose/trx# cat Dockerfile
FROM openjdk:8
LABEL maintainer=yunson
WORKDIR /data

# 安装必要的系统库和工具
RUN apt-get update && \
    apt-get install -y curl && \
    apt-get clean


# download
RUN curl -Lo ./FullNode.jar https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.7.4/FullNode.jar

# copy config file
COPY data/mainnet.conf mainnet.conf

# 设定容器启动时运行的命令
ENTRYPOINT ["java","-jar","FullNode.jar","--witness","-c","mainnet.conf" ]

2、编写docker-compose.yaml
我们挂载了data/,那我们就要将FullNode.jar和mainnet.conf下载放到data/下,不然起不来

version: '3.8'

services:
  tronprotocol:
    build: 
      context: .
      dockerfile: Dockerfile
    container_name: tronprotocol 
    volumes:
      - ./data:/data/
    ports:
      - "8090:8090"
      - "8091:8091"

或者
我们也可以先打镜像,docker-compose.yaml我们就可以写成打好的镜像

version: '3.8'

services:
    image: devocenter/tronprotocol:latest
    container_name: tronprotocol 
    volumes:
      - ./data:/data/
    ports:
      - "8090:8090"
      - "8091:8091"    

mainnet.conf

net {
  type = mainnet
  # type = testnet
}

storage {
  # Directory for storing persistent data
  db.engine = "LEVELDB",
  db.sync = false,
  db.directory = "database",
  index.directory = "index",
  transHistory.switch = "on",
  # You can custom these 14 databases' configs:

  # account, account-index, asset-issue, block, block-index,
  # block_KDB, peers, properties, recent-block, trans,
  # utxo, votes, witness, witness_schedule.

  # Otherwise, db configs will remain default and data will be stored in
  # the path of "output-directory" or which is set by "-d" ("--output-directory").
  # setting can impove leveldb performance .... start
  # node: if this will increase process fds,you may be check your ulimit if 'too many open files' error occurs
  # see https://github.com/tronprotocol/tips/blob/master/tip-343.md for detail
  # if you find block sync has lower performance,you can try  this  settings
  #default = {
  #  maxOpenFiles = 100
  #}
  #defaultM = {
  #  maxOpenFiles = 500
  #}
  #defaultL = {
  #  maxOpenFiles = 1000
  #}
  # setting can impove leveldb performance .... end
  # Attention: name is a required field that must be set !!!
  properties = [
    //    {
    //      name = "account",
    //      path = "storage_directory_test",
    //      createIfMissing = true,
    //      paranoidChecks = true,
    //      verifyChecksums = true,
    //      compressionType = 1,        // compressed with snappy
    //      blockSize = 4096,           // 4  KB =         4 * 1024 B
    //      writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
    //      cacheSize = 10485760,       // 10 MB = 10 * 1024 * 1024 B
    //      maxOpenFiles = 100
    //    },
    //    {
    //      name = "account-index",
    //      path = "storage_directory_test",
    //      createIfMissing = true,
    //      paranoidChecks = true,
    //      verifyChecksums = true,
    //      compressionType = 1,        // compressed with snappy
    //      blockSize = 4096,           // 4  KB =         4 * 1024 B
    //      writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
    //      cacheSize = 10485760,       // 10 MB = 10 * 1024 * 1024 B
    //      maxOpenFiles = 100
    //    },
  ]

  needToUpdateAsset = true

  //dbsettings is needed when using rocksdb as the storage implement (db.engine="ROCKSDB").
  //we'd strongly recommend that do not modify it unless you know every item's meaning clearly.
  dbSettings = {
    levelNumber = 7
    //compactThreads = 32
    blocksize = 64  // n * KB
    maxBytesForLevelBase = 256  // n * MB
    maxBytesForLevelMultiplier = 10
    level0FileNumCompactionTrigger = 4
    targetFileSizeBase = 256  // n * MB
    targetFileSizeMultiplier = 1
  }

  //backup settings when using rocks db as the storage implement (db.engine="ROCKSDB").
  //if you want to use the backup plugin, please confirm set the db.engine="ROCKSDB" above.
  backup = {
    enable = false  // indicate whether enable the backup plugin
    propPath = "prop.properties" // record which bak directory is valid
    bak1path = "bak1/database" // you must set two backup directories to prevent application halt unexpected(e.g. kill -9).
    bak2path = "bak2/database"
    frequency = 10000   // indicate backup db once every 10000 blocks processed.
  }

  balance.history.lookup = false

  # checkpoint.version = 2
  # checkpoint.sync = true

  # the estimated number of block transactions (default 1000, min 100, max 10000).
  # so the total number of cached transactions is 65536 * txCache.estimatedTransactions
  # txCache.estimatedTransactions = 1000

  # data root setting, for check data, currently, only reward-vi is used.

  # merkleRoot = {
  # reward-vi = 9debcb9924055500aaae98cdee10501c5c39d4daa75800a996f4bdda73dbccd8 // main-net, Sha256Hash, hexString
  # }
}

node.discovery = {
  enable = true
  persist = true
}

# custom stop condition
#node.shutdown = {
#  BlockTime  = "54 59 08 * * ?" # if block header time in persistent db matched.
#  BlockHeight = 33350800 # if block header height in persistent db matched.
#  BlockCount = 12 # block sync count after node start.
#}

node.backup {
  # udp listen port, each member should have the same configuration
  port = 10001

  # my priority, each member should use different priority
  priority = 8

  # time interval to send keepAlive message, each member should have the same configuration
  keepAliveInterval = 3000

  # peer's ip list, can't contain mine
  members = [
    # "ip",
    # "ip"
  ]
}

crypto {
  engine = "eckey"
}
# prometheus metrics start
# node.metrics = {
#  prometheus{
#    enable=true
#    port="9527"
#  }
# }

# prometheus metrics end

node {
  # trust node for solidity node
  # trustNode = "ip:port"
  trustNode = "127.0.0.1:50051"

  # expose extension api to public or not
  walletExtensionApi = true

  listen.port = 18888

  connection.timeout = 2

  fetchBlock.timeout = 200

  tcpNettyWorkThreadNum = 0

  udpNettyWorkThreadNum = 1

  # Number of validate sign thread, default availableProcessors / 2
  # validateSignThreadNum = 16

  maxConnections = 30

  minConnections = 8

  minActiveConnections = 3

  maxConnectionsWithSameIp = 2

  maxHttpConnectNumber = 50

  minParticipationRate = 15

  isOpenFullTcpDisconnect = false

  p2p {
    version = 11111 # 11111: mainnet; 20180622: testnet
  }

  active = [
    # Active establish connection in any case
    # Sample entries:
    # "ip:port",
    # "ip:port"
  ]

  passive = [
    # Passive accept connection in any case
    # Sample entries:
    # "ip:port",
    # "ip:port"
  ]

  fastForward = [
    "100.26.245.209:18888",
    "15.188.6.125:18888"
  ]

  http {
    fullNodeEnable = true
    fullNodePort = 8090
    solidityEnable = true
    solidityPort = 8091
  }

  rpc {
    port = 50051
    #solidityPort = 50061
    # Number of gRPC thread, default availableProcessors / 2
    # thread = 16

    # The maximum number of concurrent calls permitted for each incoming connection
    # maxConcurrentCallsPerConnection =

    # The HTTP/2 flow control window, default 1MB
    # flowControlWindow =

    # Connection being idle for longer than which will be gracefully terminated
    maxConnectionIdleInMillis = 60000

    # Connection lasting longer than which will be gracefully terminated
    # maxConnectionAgeInMillis =

    # The maximum message size allowed to be received on the server, default 4MB
    # maxMessageSize =

    # The maximum size of header list allowed to be received, default 8192
    # maxHeaderListSize =

    # Transactions can only be broadcast if the number of effective connections is reached.
    minEffectiveConnection = 1
   
    # The switch of the reflection service, effective for all gRPC services
    # reflectionService = true
  }

  # number of solidity thread in the FullNode.
  # If accessing solidity rpc and http interface timeout, could increase the number of threads,
  # The default value is the number of cpu cores of the machine.
  #solidity.threads = 8

  # Limits the maximum percentage (default 75%) of producing block interval
  # to provide sufficient time to perform other operations e.g. broadcast block
  # blockProducedTimeOut = 75

  # Limits the maximum number (default 700) of transaction from network layer
  # netMaxTrxPerSecond = 700

  # Whether to enable the node detection function, default false
  # nodeDetectEnable = false

  # use your ipv6 address for node discovery and tcp connection, default false
  # enableIpv6 = false

  # if your node's highest block num is below than all your pees', try to acquire new connection. default false
  # effectiveCheckEnable = false

  # Dynamic loading configuration function, disabled by default
  # dynamicConfig = {
    # enable = false
    # Configuration file change check interval, default is 600 seconds
    # checkInterval = 600
  # }

  dns {
    # dns urls to get nodes, url format tree://{pubkey}@{domain}, default empty
    treeUrls = [
      #"tree://AKMQMNAJJBL73LXWPXDI4I5ZWWIZ4AWO34DWQ636QOBBXNFXH3LQS@main.trondisco.net", //offical dns tree
    ]

    # enable or disable dns publish, default false
    # publish = false

    # dns domain to publish nodes, required if publish is true
    # dnsDomain = "nodes1.example.org"

    # dns private key used to publish, required if publish is true, hex string of length 64
    # dnsPrivate = "b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"

    # known dns urls to publish if publish is true, url format tree://{pubkey}@{domain}, default empty
    # knownUrls = [
    #"tree://APFGGTFOBVE2ZNAB3CSMNNX6RRK3ODIRLP2AA5U4YFAA6MSYZUYTQ@nodes2.example.org",
    # ]

    # staticNodes = [
    # static nodes to published on dns
    # Sample entries:
    # "ip:port",
    # "ip:port"
    # ]

    # merge several nodes into a leaf of tree, should be 1~5
    # maxMergeSize = 5

    # only nodes change percent is bigger then the threshold, we update data on dns
    # changeThreshold = 0.1

    # dns server to publish, required if publish is true, only aws or aliyun is support
    # serverType = "aws"

    # access key id of aws or aliyun api, required if publish is true, string
    # accessKeyId = "your-key-id"

    # access key secret of aws or aliyun api, required if publish is true, string
    # accessKeySecret = "your-key-secret"

    # if publish is true and serverType is aliyun, it's endpoint of aws dns server, string
    # aliyunDnsEndpoint = "alidns.aliyuncs.com"

    # if publish is true and serverType is aws, it's region of aws api, such as "eu-south-1", string
    # awsRegion = "us-east-1"

    # if publish is true and server-type is aws, it's host zone id of aws's domain, string
    # awsHostZoneId = "your-host-zone-id"
  }

  # open the history query APIs(http&GRPC) when node is a lite fullNode,
  # like {getBlockByNum, getBlockByID, getTransactionByID...}.
  # default: false.
  # note: above APIs may return null even if blocks and transactions actually are on the blockchain
  # when opening on a lite fullnode. only open it if the consequences being clearly known
  # openHistoryQueryWhenLiteFN = false

  jsonrpc {
    # Note: If you turn on jsonrpc and run it for a while and then turn it off, you will not
    # be able to get the data from eth_getLogs for that period of time.

    # httpFullNodeEnable = true
    # httpFullNodePort = 8545
    # httpSolidityEnable = true
    # httpSolidityPort = 8555
    # httpPBFTEnable = true
    # httpPBFTPort = 8565
  }

  # Disabled api list, it will work for http, rpc and pbft, both fullnode and soliditynode,
  # but not jsonrpc.
  # Sample: The setting is case insensitive, GetNowBlock2 is equal to getnowblock2
  #
  # disabledApi = [
  #   "getaccount",
  #   "getnowblock2"
  # ]
}

## rate limiter config
rate.limiter = {
  # Every api could be set a specific rate limit strategy. Three strategy are supported:GlobalPreemptibleAdapter、IPQPSRateLimiterAdapte、QpsRateLimiterAdapter
  # GlobalPreemptibleAdapter: permit is the number of preemptible resource, every client must apply one resourse
  #       before do the request and release the resource after got the reponse automaticlly. permit should be a Integer.
  # QpsRateLimiterAdapter: qps is the average request count in one second supported by the server, it could be a Double or a Integer.
  # IPQPSRateLimiterAdapter: similar to the QpsRateLimiterAdapter, qps could be a Double or a Integer.
  # If do not set, the "default strategy" is set.The "default startegy" is based on QpsRateLimiterAdapter, the qps is set as 10000.
  #
  # Sample entries:
  #
  http = [
    #  {
    #    component = "GetNowBlockServlet",
    #    strategy = "GlobalPreemptibleAdapter",
    #    paramString = "permit=1"
    #  },

    #  {
    #    component = "GetAccountServlet",
    #    strategy = "IPQPSRateLimiterAdapter",
    #    paramString = "qps=1"
    #  },

    #  {
    #    component = "ListWitnessesServlet",
    #    strategy = "QpsRateLimiterAdapter",
    #    paramString = "qps=1"
    #  }
  ],

  rpc = [
    #  {
    #    component = "protocol.Wallet/GetBlockByLatestNum2",
    #    strategy = "GlobalPreemptibleAdapter",
    #    paramString = "permit=1"
    #  },

    #  {
    #    component = "protocol.Wallet/GetAccount",
    #    strategy = "IPQPSRateLimiterAdapter",
    #    paramString = "qps=1"
    #  },

    #  {
    #    component = "protocol.Wallet/ListWitnesses",
    #    strategy = "QpsRateLimiterAdapter",
    #    paramString = "qps=1"
    #  },
  ]

  # global qps, default 50000
  # global.qps = 50000
  # IP-based global qps, default 10000
  # global.ip.qps = 10000
}



seed.node = {
  # List of the seed nodes
  # Seed nodes are stable full nodes
  # example:
  # ip.list = [
  #   "ip:port",
  #   "ip:port"
  # ]
  ip.list = [
    "3.225.171.164:18888",
    "52.53.189.99:18888",
    "18.196.99.16:18888",
    "34.253.187.192:18888",
    "18.133.82.227:18888",
    "35.180.51.163:18888",
    "54.252.224.209:18888",
    "18.231.27.82:18888",
    "52.15.93.92:18888",
    "34.220.77.106:18888",
    "15.207.144.3:18888",
    "13.124.62.58:18888",
    "54.151.226.240:18888",
    "35.174.93.198:18888",
    "18.210.241.149:18888",
    "54.177.115.127:18888",
    "54.254.131.82:18888",
    "18.167.171.167:18888",
    "54.167.11.177:18888",
    "35.74.7.196:18888",
    "52.196.244.176:18888",
    "54.248.129.19:18888",
    "43.198.142.160:18888",
    "3.0.214.7:18888",
    "54.153.59.116:18888",
    "54.153.94.160:18888",
    "54.82.161.39:18888",
    "54.179.207.68:18888",
    "18.142.82.44:18888",
    "18.163.230.203:18888",
    # "[2a05:d014:1f2f:2600:1b15:921:d60b:4c60]:18888", // use this if support ipv6
    # "[2600:1f18:7260:f400:8947:ebf3:78a0:282b]:18888", // use this if support ipv6
  ]
}

genesis.block = {
  # Reserve balance
  assets = [
    {
      accountName = "Zion"
      accountType = "AssetIssue"
      address = "TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm"
      balance = "99000000000000000"
    },
    {
      accountName = "Sun"
      accountType = "AssetIssue"
      address = "TXmVpin5vq5gdZsciyyjdZgKRUju4st1wM"
      balance = "0"
    },
    {
      accountName = "Blackhole"
      accountType = "AssetIssue"
      address = "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy"
      balance = "-9223372036854775808"
    }
  ]

  witnesses = [
    {
      address: THKJYuUmMKKARNf7s2VT51g5uPY6KEqnat,
      url = "http://GR1.com",
      voteCount = 100000026
    },
    {
      address: TVDmPWGYxgi5DNeW8hXrzrhY8Y6zgxPNg4,
      url = "http://GR2.com",
      voteCount = 100000025
    },
    {
      address: TWKZN1JJPFydd5rMgMCV5aZTSiwmoksSZv,
      url = "http://GR3.com",
      voteCount = 100000024
    },
    {
      address: TDarXEG2rAD57oa7JTK785Yb2Et32UzY32,
      url = "http://GR4.com",
      voteCount = 100000023
    },
    {
      address: TAmFfS4Tmm8yKeoqZN8x51ASwdQBdnVizt,
      url = "http://GR5.com",
      voteCount = 100000022
    },
    {
      address: TK6V5Pw2UWQWpySnZyCDZaAvu1y48oRgXN,
      url = "http://GR6.com",
      voteCount = 100000021
    },
    {
      address: TGqFJPFiEqdZx52ZR4QcKHz4Zr3QXA24VL,
      url = "http://GR7.com",
      voteCount = 100000020
    },
    {
      address: TC1ZCj9Ne3j5v3TLx5ZCDLD55MU9g3XqQW,
      url = "http://GR8.com",
      voteCount = 100000019
    },
    {
      address: TWm3id3mrQ42guf7c4oVpYExyTYnEGy3JL,
      url = "http://GR9.com",
      voteCount = 100000018
    },
    {
      address: TCvwc3FV3ssq2rD82rMmjhT4PVXYTsFcKV,
      url = "http://GR10.com",
      voteCount = 100000017
    },
    {
      address: TFuC2Qge4GxA2U9abKxk1pw3YZvGM5XRir,
      url = "http://GR11.com",
      voteCount = 100000016
    },
    {
      address: TNGoca1VHC6Y5Jd2B1VFpFEhizVk92Rz85,
      url = "http://GR12.com",
      voteCount = 100000015
    },
    {
      address: TLCjmH6SqGK8twZ9XrBDWpBbfyvEXihhNS,
      url = "http://GR13.com",
      voteCount = 100000014
    },
    {
      address: TEEzguTtCihbRPfjf1CvW8Euxz1kKuvtR9,
      url = "http://GR14.com",
      voteCount = 100000013
    },
    {
      address: TZHvwiw9cehbMxrtTbmAexm9oPo4eFFvLS,
      url = "http://GR15.com",
      voteCount = 100000012
    },
    {
      address: TGK6iAKgBmHeQyp5hn3imB71EDnFPkXiPR,
      url = "http://GR16.com",
      voteCount = 100000011
    },
    {
      address: TLaqfGrxZ3dykAFps7M2B4gETTX1yixPgN,
      url = "http://GR17.com",
      voteCount = 100000010
    },
    {
      address: TX3ZceVew6yLC5hWTXnjrUFtiFfUDGKGty,
      url = "http://GR18.com",
      voteCount = 100000009
    },
    {
      address: TYednHaV9zXpnPchSywVpnseQxY9Pxw4do,
      url = "http://GR19.com",
      voteCount = 100000008
    },
    {
      address: TCf5cqLffPccEY7hcsabiFnMfdipfyryvr,
      url = "http://GR20.com",
      voteCount = 100000007
    },
    {
      address: TAa14iLEKPAetX49mzaxZmH6saRxcX7dT5,
      url = "http://GR21.com",
      voteCount = 100000006
    },
    {
      address: TBYsHxDmFaRmfCF3jZNmgeJE8sDnTNKHbz,
      url = "http://GR22.com",
      voteCount = 100000005
    },
    {
      address: TEVAq8dmSQyTYK7uP1ZnZpa6MBVR83GsV6,
      url = "http://GR23.com",
      voteCount = 100000004
    },
    {
      address: TRKJzrZxN34YyB8aBqqPDt7g4fv6sieemz,
      url = "http://GR24.com",
      voteCount = 100000003
    },
    {
      address: TRMP6SKeFUt5NtMLzJv8kdpYuHRnEGjGfe,
      url = "http://GR25.com",
      voteCount = 100000002
    },
    {
      address: TDbNE1VajxjpgM5p7FyGNDASt3UVoFbiD3,
      url = "http://GR26.com",
      voteCount = 100000001
    },
    {
      address: TLTDZBcPoJ8tZ6TTEeEqEvwYFk2wgotSfD,
      url = "http://GR27.com",
      voteCount = 100000000
    }
  ]

  timestamp = "0" #2017-8-26 12:00:00

  parentHash = "0xe58f33f9baf9305dc6f82b9f1934ea8f0ade2defb951258d50167028c780351f"
}

// Optional.The default is empty.
// It is used when the witness account has set the witnessPermission.
// When it is not empty, the localWitnessAccountAddress represents the address of the witness account,
// and the localwitness is configured with the private key of the witnessPermissionAddress in the witness account.
// When it is empty,the localwitness is configured with the private key of the witness account.

//localWitnessAccountAddress =

localwitness = [
]

#localwitnesskeystore = [
#  "localwitnesskeystore.json"
#]

block = {
  needSyncCheck = true
  maintenanceTimeInterval = 21600000
  proposalExpireTime = 259200000 // 3 day: 259200000(ms)
}

# Transaction reference block, default is "solid", configure to "head" may incur TaPos error
# trx.reference.block = "solid" // head;solid;

# This property sets the number of milliseconds after the creation of the transaction that is expired, default value is  60000.
# trx.expiration.timeInMilliseconds = 60000

vm = {
  supportConstant = false
  maxEnergyLimitForConstant = 100000000
  minTimeRatio = 0.0
  maxTimeRatio = 5.0
  saveInternalTx = false

  # Indicates whether the node stores featured internal transactions, such as freeze, vote and so on
  # saveFeaturedInternalTx = false

  # In rare cases, transactions that will be within the specified maximum execution time (default 10(ms)) are re-executed and packaged
  # longRunningTime = 10

  # Indicates whether the node support estimate energy API.
  # estimateEnergy = false

  # Indicates the max retry time for executing transaction in estimating energy.
  # estimateEnergyMaxRetry = 3
}

committee = {
  allowCreationOfContracts = 0  //mainnet:0 (reset by committee),test:1
  allowAdaptiveEnergy = 0  //mainnet:0 (reset by committee),test:1
}

event.subscribe = {
    native = {
      useNativeQueue = true // if true, use native message queue, else use event plugin.
      bindport = 5555 // bind port
      sendqueuelength = 1000 //max length of send queue
    }

    path = "" // absolute path of plugin
    server = "" // target server address to receive event triggers
    // dbname|username|password, if you want to create indexes for collections when the collections
    // are not exist, you can add version and set it to 2, as dbname|username|password|version
    // if you use version 2 and one collection not exists, it will create index automaticaly;
    // if you use version 2 and one collection exists, it will not create index, you must create index manually;
    dbconfig = ""
    contractParse = true
    topics = [
        {
          triggerName = "block" // block trigger, the value can't be modified
          enable = false
          topic = "block" // plugin topic, the value could be modified
          solidified = false // if set true, just need solidified block, default is false
        },
        {
          triggerName = "transaction"
          enable = false
          topic = "transaction"
          solidified = false
          ethCompatible = false // if set true, add transactionIndex, cumulativeEnergyUsed, preCumulativeLogCount, logList, energyUnitPrice, default is false
        },
        {
          triggerName = "contractevent"
          enable = false
          topic = "contractevent"
        },
        {
          triggerName = "contractlog"
          enable = false
          topic = "contractlog"
          redundancy = false // if set true, contractevent will also be regarded as contractlog
        },
        {
          triggerName = "solidity" // solidity block trigger(just include solidity block number and timestamp), the value can't be modified
          enable = true            // the default value is true
          topic = "solidity"
        },
        {
          triggerName = "solidityevent"
          enable = false
          topic = "solidityevent"
        },
        {
          triggerName = "soliditylog"
          enable = false
          topic = "soliditylog"
          redundancy = false // if set true, solidityevent will also be regarded as soliditylog
        }
    ]

    filter = {
       fromblock = "" // the value could be "", "earliest" or a specified block number as the beginning of the queried range
       toblock = "" // the value could be "", "latest" or a specified block number as end of the queried range
       contractAddress = [
           "" // contract address you want to subscribe, if it's set to "", you will receive contract logs/events with any contract address.
       ]

       contractTopic = [
           "" // contract topic you want to subscribe, if it's set to "", you will receive contract logs/events with any contract topic.
       ]
    }
}

3、下载快照数据

mkdir data && cd data/
wget http://52.77.31.45/saveInternalTx/backup20240422/FullNode_output-directory.tgz
tar -xf FullNode_output-directory.tgz

4、启动容器

root@ubuntu:/data/docker-compose/trx# docker-compose up -d
[+] Building 3.5s (11/11) FINISHED                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                            0.0s
 => => transferring dockerfile: 508B                                                                                                                                            0.0s
 => [internal] load metadata for docker.io/library/openjdk:8                                                                                                                    3.4s
 => [auth] library/openjdk:pull token for registry-1.docker.io                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                                                 0.0s
 => [1/5] FROM docker.io/library/openjdk:8@sha256:86e863cc57215cfb181bd319736d0baf625fe8f150577f9eb58bd937f5452cb8                                                              0.0s
 => [internal] load build context                                                                                                                                               0.0s
 => => transferring context: 22.52kB                                                                                                                                            0.0s
 => CACHED [2/5] WORKDIR /data                                                                                                                                                  0.0s
 => CACHED [3/5] RUN apt-get update &&     apt-get install -y curl &&     apt-get clean                                                                                         0.0s
 => CACHED [4/5] RUN curl -Lo ./FullNode.jar https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.7.4/FullNode.jar                                        0.0s
 => [5/5] COPY data/mainnet.conf mainnet.conf                                                                                                                                   0.0s
 => exporting to image                                                                                                                                                          0.0s
 => => exporting layers                                                                                                                                                         0.0s
 => => writing image sha256:3b4e1f7694e0089a11996fc1881ffff91a1a3cc4a94109fe635f1e96b3e086a7                                                                                    0.0s
 => => naming to docker.io/library/trx_tronprotocol                                                                                                                             0.0s
[+] Running 2/2
 ⠿ Network trx_default     Created                                                                                                                                              0.1s
 ⠿ Container tronprotocol  Started 
 root@ubuntu:/data/docker-compose/trx# docker-compose ps
NAME                COMMAND                  SERVICE             STATUS              PORTS
tronprotocol        "java -jar FullNode.…"   tronprotocol        running             0.0.0.0:8090-8091->8090-8091/tcp, :::8090-8091->8090-8091/tcp

查询日志
日志路径在数据目录下的logs

oot@ubuntu:/data/docker-compose/trx# tail -f data/logs/tron.log 
generated by myself=false
generate time=2018-06-25 06:39:33.0
account root=0000000000000000000000000000000000000000000000000000000000000000
txs are empty
]
11:59:58.969 INFO  [sync-handle-block] [DB](PendingManager.java:57) Pending tx size: 0.
11:59:58.969 INFO  [sync-handle-block] [DB](Manager.java:1346) PushBlock block number: 5743, cost/txs: 35/0 false.
11:59:58.969 INFO  [sync-handle-block] [net](TronNetDelegate.java:269) Success process block Num:5743,ID:000000000000166fd5cac4ece68bb5a16fe7256a9162d4c7a0e9270aefdd726d
11:59:58.970 INFO  [sync-handle-block] [DB](Manager.java:1219) Block num: 5744, re-push-size: 0, pending-size: 0, block-tx-size: 0, verify-tx-size: 0
11:59:58.971 INFO  [sync-handle-block] [DB](KhaosDatabase.java:331) Remove from khaosDatabase: 000000000000165be2a1e27c8773eddf2daaff5d0f923819c17e066e3e4adaa4.
11:59:59.007 INFO  [sync-handle-block] [DB](SnapshotManager.java:362) Flush cost: 36 ms, create checkpoint cost: 33 ms, refresh cost: 3 ms.
11:59:59.011 INFO  [sync-handle-block] [DB](DynamicPropertiesStore.java:2193) Update state flag = 0.
11:59:59.011 INFO  [sync-handle-block] [consensus](DposService.java:162) Update solid block number to 5726
11:59:59.011 INFO  [sync-handle-block] [DB](DynamicPropertiesStore.java:2188) Update latest block header id = 00000000000016704446a426e3a20044488ee203f5286967fe856cf9b1f507f2.
11:59:59.011 INFO  [sync-handle-block] [DB](DynamicPropertiesStore.java:2180) Update latest block header number = 5744.
11:59:59.011 INFO  [sync-handle-block] [DB](DynamicPropertiesStore.java:2172) Update latest block header timestamp = 1529908776000.
11:59:59.011 INFO  [sync-handle-block] [DB](Manager.java:1328) Save block: BlockCapsule 
[ hash=00000000000016704446a426e3a20044488ee203f5286967fe856cf9b1f507f2
number=5744
parentId=000000000000166fd5cac4ece68bb5a16fe7256a9162d4c7a0e9270aefdd726d
witness address=41f8c7acc4c08cf36ca08fc2a61b1f5a7c8dea7bec
generated by myself=false
generate time=2018-06-25 06:39:36.0
account root=0000000000000000000000000000000000000000000000000000000000000000
txs are empty
]

5、打镜像

root@ubuntu:/data/docker-compose/trx# docker build -t tronprotocol .
[+] Building 44.1s (9/9) FINISHED                                docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 585B                                       0.0s
 => [internal] load metadata for docker.io/library/openjdk:8               7.2s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/5] FROM docker.io/library/openjdk:8@sha256:86e863cc57215cfb181bd3  16.6s
 => => resolve docker.io/library/openjdk:8@sha256:86e863cc57215cfb181bd31  0.0s
 => => sha256:b273004037cc3af245d8e08cfbfa672b93ee7dcb289 7.81kB / 7.81kB  0.0s
 => => sha256:001c52e26ad57e3b25b439ee0052f6692e5c0f2d5 55.00MB / 55.00MB  9.7s
 => => sha256:2068746827ec1b043b571e4788693eab7e9b2a953 10.88MB / 10.88MB  2.5s
 => => sha256:86e863cc57215cfb181bd319736d0baf625fe8f1505 1.04kB / 1.04kB  0.0s
 => => sha256:3af2ac94130765b73fc8f1b42ffc04f77996ed8210c 1.79kB / 1.79kB  0.0s
 => => sha256:d9d4b9b6e964657da49910b495173d6c4f0d9bc47b3 5.16MB / 5.16MB  3.1s
 => => sha256:9daef329d35093868ef75ac8b7c6eb407fa53abbc 54.58MB / 54.58MB  6.6s
 => => sha256:d85151f15b6683b98f21c3827ac545188b1849efb14 5.42MB / 5.42MB  4.8s
 => => sha256:52a8c426d30b691c4f7e8c4b438901ddeb82ff80d4540d5 210B / 210B  5.8s
 => => sha256:8754a66e005039a091c5ad0319f055be393c712 105.92MB / 105.92MB  9.0s
 => => extracting sha256:001c52e26ad57e3b25b439ee0052f6692e5c0f2d5d982a00  1.9s
 => => extracting sha256:d9d4b9b6e964657da49910b495173d6c4f0d9bc47b3b4427  0.2s
 => => extracting sha256:2068746827ec1b043b571e4788693eab7e9b2a9530117651  0.2s
 => => extracting sha256:9daef329d35093868ef75ac8b7c6eb407fa53abbcb3a264c  2.1s
 => => extracting sha256:d85151f15b6683b98f21c3827ac545188b1849efb14a1049  0.2s
 => => extracting sha256:52a8c426d30b691c4f7e8c4b438901ddeb82ff80d4540d5b  0.0s
 => => extracting sha256:8754a66e005039a091c5ad0319f055be393c7123717b1f6f  2.0s
 => [2/5] WORKDIR /data                                                    1.1s
 => [3/5] RUN apt-get update &&     apt-get install -y curl &&     apt-ge  7.6s
 => [4/5] RUN curl -Lo ./FullNode.jar https://github.com/tronprotocol/jav  9.5s
 => [5/5] RUN curl -Lo ./mainnet.conf https://github.com/tronprotocol/tro  1.4s
 => exporting to image                                                     0.5s
 => => exporting layers                                                    0.3s
 => => writing image sha256:7de082bb163cb878f315ec2fc6f72216832805e2eae07  0.0s
 => => naming to docker.io/library/tronprotocol                            0.1s
root@ubuntu:/data/docker-compose/trx# docker images
REPOSITORY     TAG       IMAGE ID       CREATED         SIZE
tronprotocol   latest    7de082bb163c   6 seconds ago   689MB

保存镜像

root@ubuntu:/data/docker-compose/trx# docker images
REPOSITORY         TAG       IMAGE ID       CREATED          SIZE
trx_tronprotocol   latest    3b4e1f7694e0   38 seconds ago   689MB
root@ubuntu:/data/docker-compose/trx# docker tag trx_tronprotocol:latest devocenter/tronprotocol:v4.7.4
root@ubuntu:/data/docker-compose/trx# docker tag trx_tronprotocol:latest devocenter/tronprotocol
root@ubuntu:/data/docker-compose/trx# docker images
REPOSITORY                TAG       IMAGE ID       CREATED              SIZE
trx_tronprotocol          latest    3b4e1f7694e0   About a minute ago   689MB
devocenter/tronprotocol   latest    3b4e1f7694e0   About a minute ago   689MB
devocenter/tronprotocol   v4.7.4    3b4e1f7694e0   About a minute ago   689MB
root@ubuntu:/data/docker-compose/trx# docker login docker.io
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/

Username: devocenter
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
root@ubuntu:/data/docker-compose/trx# docker push devocenter/tronprotocol:v4.7.4 
The push refers to repository [docker.io/devocenter/tronprotocol]
c8883b956af0: Pushed 
14b9852dbb22: Pushed 
2652b2be035c: Pushed 
79e65205e03f: Pushed 
6b5aaff44254: Mounted from library/openjdk 
53a0b163e995: Mounted from library/openjdk 
b626401ef603: Mounted from library/openjdk 
9b55156abf26: Mounted from library/openjdk 
293d5db30c9f: Mounted from library/openjdk 
03127cdb479b: Mounted from library/openjdk 
9c742cd6c7a5: Mounted from library/openjdk 
v4.7.4: digest: sha256:fbe40944dda0d8c67798aeb192a2881283865d1ba0692f7b9d8008af80150289 size: 2635
root@ubuntu:/data/docker-compose/trx# docker push devocenter/tronprotocol:latest 
The push refers to repository [docker.io/devocenter/tronprotocol]
c8883b956af0: Layer already exists 
14b9852dbb22: Layer already exists 
2652b2be035c: Layer already exists 
79e65205e03f: Layer already exists 
6b5aaff44254: Layer already exists 
53a0b163e995: Layer already exists 
b626401ef603: Layer already exists 
9b55156abf26: Layer already exists 
293d5db30c9f: Layer already exists 
03127cdb479b: Layer already exists 
9c742cd6c7a5: Layer already exists 
latest: digest: sha256:fbe40944dda0d8c67798aeb192a2881283865d1ba0692f7b9d8008af80150289 size: 2635

镜像仓库查看镜像
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1671351.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

鲁棒控制问题描述

复杂的合成问题成为一个具有特殊结构控制器的设计问题。 H无穷范数(H∞ norm):对于线性时不变(LTI)系统,H∞范数通常定义为系统频率响应的最大幅值。换句话说,它是系统传递函数在复平面单位圆上…

基于SSM的“图书仓储管理系统”的设计与实现(源码+数据库+文档)

基于SSM的“图书仓储管理系统”的设计与实现(源码数据库文档) 开发语言:Java 数据库:MySQL 技术:SSM 工具:IDEA/Ecilpse、Navicat、Maven 系统展示 系统功能结构图 系统登录页面 人员管理信息页面 添加人员信息页…

公司申请增加公众号数量

一般可以申请多少个公众号?众所周知,在2013年前后,公众号申请是不限制数量的,后来企业开始限制申请50个,直到2018年的11月tx又发布,其中个人主体可申请公众号由2个调整为1个,企业主体由50个调整…

[C/C++] -- 搜索迷宫路径

DFS(深度优先搜索)和BFS(广度优先搜索)是两种常用的图遍历算法,它们在搜索图或树中的节点时有着不同的策略和特点。 深度优先搜索 (DFS): 在DFS中,从起始节点开始,沿着一条路径尽可能深地搜索&a…

Footprint Analytics 与 Core Chain 达成战略合作

​ 领先的区块链数据解决方案提供商 Footprint Analytics 与比特币驱动、EVM 兼容的 Layer 1 区块链 Core Chain 宣布达成战略合作。此次合作旨在将 Footprint Analytics 的前沿数据解决方案与 Core Chain 的区块链基础设施相结合,共同引领区块链领域的创新发展。 …

class常量池、运行时常量池和字符串常量池的关系

类常量池、运行时常量池和字符串常量池这三种常量池,在Java中扮演着不同但又相互关联的角色。理解它们之间的关系,有助于深入理解Java虚拟机(JVM)的内部工作机制,尤其是在类加载、内存分配和字符串处理方面。 类常量池…

【文献阅读】企业ESG表现与创新——来自A股上市公司的证据

企业ESG表现与创新——来自A股上市公司的证据 1.引言 第一段——背景介绍 可持续发展 碳达峰、碳中和 ESG既是从微观层面解决全球性社会问题的必要,也是实现我国经济转型、促进高质量发展的有效手段。 2017.12证监会:重点排污企业的环境披露 2021.6证监…

【C++】string类的使用④(字符串操作String operations || 常量成员Member constants)

🔥个人主页: Forcible Bug Maker 🔥专栏: STL || C 目录 前言🔥字符串操作(String operations)c_strdataget_allocatorcopyfindrfindfind_first_offind_last_offind_first_not_offind_last_not…

编码器介绍与应用

一.概述 1.编码器 编码器,是一种用来测量机械旋转或位移的传感器。这种传感器能够测量机械部件在旋转或直线运动时的位移位置或速度等信息,并将其转换成一系列电信号。其可和电机组装到一起用,反馈电机方向、转换角度的,然后电机…

MongoDB和AI 赋能行业应用:制造业和汽车行业

欢迎阅读“MongoDB和AI 赋能行业应用”系列的第一篇。 本系列重点介绍AI应用于不同行业的关键用例,涵盖制造业和汽车行业、金融服务、零售、电信和媒体、保险以及医疗保健行业。 随着人工智能(AI)在制造业和汽车行业的集成,传统…

求四个整数中的最大值(函数)(C语言)

一、N-S流程图&#xff1b; 二、运行结果&#xff1b; 三、源代码&#xff1b; # define _CRT_SECURE_NO_WARNINGS # include <stdio.h>int main() {//初始化变量值&#xff1b;int a, b, c, d, max;//获取用户输入的数据&#xff1b;printf("请输入4个整数&#x…

内部开发平台如何赋能开发人员与业务

一个厨师只有具备烹饪美食的技能与经验&#xff0c;并且在设备、工具齐全的餐厅里才能发挥他的才能。交响乐团需要正确的乐器、指挥家和舞台才能演奏初美妙的音乐。 而在软件开发的世界&#xff0c;开发人员需要最好的工具包和开发环境来设计开发他们的软件项目。这个环境就被…

Mysql数据类型设计思考

一、Mysql数据类型设计规范 1.1 选择更小的数据类型 一般情况下&#xff0c;在满足存储要求的基础上&#xff0c;尽量选择小的存储类型。例如&#xff1a;存储0~200&#xff0c;tinyint和bigint都可以存储&#xff0c;那么选择tinyint。原因&#xff1a;越小的数据类型运算速…

计算机组成原理(超详解!!) 第七节 中央处理器(下)

1.微程序控制器 微程序设计技术&#xff1a;利用软件方法来设计硬件的一门技术。 微程序控制器的基本思想&#xff1a; 仿照通常的解题程序的方法&#xff0c;把操作控制信号编成所谓的“微指令”&#xff0c;存放到一个只读存储器里。当机器运行时&#xff0c;一条又一条地…

高速电流反馈运放总结

目录 前言 基础架构 CFB运算放大器拓扑结构的进步 前言 最近项目发现有震荡&#xff0c;发现是电流反馈型运放导致&#xff0c;所以对电流运放的知识做了全面的复习。 基础架构 现在&#xff0c;我们将详细考察高速运算放大器中非常流行的电流反馈(CFB)运算放大器拓扑结 构…

Vue 局部布局 Layout 内部布局 [el-row]、[el-col]

之前的布局容器是一个整体的框架&#xff0c;layout里面的布局其实就是el-row和el-col的组合。 基础布局 使用单一分栏创建基础的栅格布局。 通过 ​row ​和 ​col ​组件&#xff0c;并通过 ​col ​组件的 ​span ​属性我们就可以自由地组合布局。 这种最简单&#xff0c;…

网络库-libevent介绍

1.简介 libevent是一个事件驱动的网络库&#xff0c;主要用于构建可扩展的网络服务器。它提供了跨平台的API&#xff0c;支持多种事件通知机制&#xff0c;如select、poll、epoll、kqueue等。 主要组件 event: 表示一个具体的事件&#xff0c;包括事件类型、事件回调等。eve…

Office之Word应用(二)

一、页眉添加文件名称和页码 1、双击页眉&#xff0c;点击“页眉-空白&#xff08;三栏&#xff09;” 2、删掉第一处&#xff08;鼠标放在上面就会选中&#xff0c;Enter即可&#xff09;&#xff0c;第二处输入文档名称&#xff0c;第三处插入页码。 注&#xff1a;插入页码时…

【CSP CCF记录】202203-2 出行计划

题目 过程 第一次提交 暴力求解&#xff0c;时间复杂度为n*n&#xff0c;超时 #include<bits/stdc.h> using namespace std; const int N100001; int n,m,k; int t[N],c[N],q[N]; int main() {cin>>n>>m>>k;for(int i0;i<n;i){cin>>t[i]&g…

计算机视觉的应用30-基于深度卷积神经网络CNN模型实现物体表面缺陷检测技术的项目

大家好&#xff0c;我是微学AI&#xff0c;今天给大家介绍一下计算机视觉的应用30-基于深度卷积神经网络CNN模型实现物体表面缺陷检测技术的项目主要包括&#xff1a;物体表面缺陷检测技术项目介绍&#xff0c;数据构造&#xff0c;模型介绍。 物体表面缺陷检测技术是工业自动化…