diff --git a/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java b/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java index 98ccdf55e48..226c96e2170 100644 --- a/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java +++ b/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java @@ -20,7 +20,9 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import com.github.dockerjava.api.command.CreateContainerCmd; import org.awaitility.Awaitility; import org.awaitility.core.ThrowingRunnable; import org.junit.After; @@ -30,7 +32,6 @@ import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.Network; import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.utility.MountableFile; import org.web3j.crypto.CipherException; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; @@ -88,6 +89,7 @@ public class ContainerTestBase { // GoQuorum config private final String goQuorumContainerDatadir = "/tmp/qdata/"; + private final String goQuorumContainerGenesis = "/tmp/qdata/genesis.json"; private final String goQuorumContainerGethIpcPath = goQuorumContainerDatadir + "/geth.ipc"; private final Integer goQuorumP2pPort = 30303; private final Integer goQuorumRpcPort = 8545; @@ -230,30 +232,37 @@ private GenericContainer buildGoQuorumContainer( .withNetwork(containerNetwork) .dependsOn(tesseraGoQuorumContainer) .withExposedPorts(goQuorumRpcPort, goQuorumP2pPort) - .withCopyFileToContainer( - MountableFile.forClasspathResource("/goQuorum/qdata/"), goQuorumContainerDatadir) + .withClasspathResourceMapping( + "/goQuorum/qdata/", goQuorumContainerDatadir, BindMode.READ_ONLY) + .withClasspathResourceMapping(hostGenesisPath, goQuorumContainerGenesis, BindMode.READ_ONLY) .withClasspathResourceMapping(ipcPath, ipcBindDir, BindMode.READ_WRITE) .withEnv("PRIVATE_CONFIG", containerIpcPath) - .withCommand( - "--datadir", - goQuorumContainerDatadir, - "--networkid", - networkId.toString(), - "--rpc", - "--rpcaddr", - "0.0.0.0", - "--rpcport", - goQuorumRpcPort.toString(), - "--rpcapi", - "admin,eth,debug,miner,net,shh,txpool,personal,web3,quorum,quorumExtension,clique", - "--emitcheckpoints", - "--port", - goQuorumP2pPort.toString(), - "--verbosity", - "3", - "--nousb", - "--nodekey", - goQuorumContainerDatadir + "/nodeKey"); + .withCreateContainerCmdModifier( + (Consumer) + cmd -> + cmd.withEntrypoint( + "/bin/ash", + "-c", + "geth init " + goQuorumContainerGenesis + " --datadir " + + goQuorumContainerDatadir + + " && geth --datadir " + + goQuorumContainerDatadir + + " --networkid " + + networkId.toString() + + " --rpc" + + " --rpcaddr 0.0.0.0" + + " --rpcport " + + goQuorumRpcPort.toString() + + " --rpcapi admin,eth,debug,miner,net,shh,txpool,personal,web3,quorum,quorumExtension,clique" + + " --emitcheckpoints" + + " --port " + + goQuorumP2pPort.toString() + + " --verbosity" + + " 3" + + " --nousb" + + " --nodekey " + + goQuorumContainerDatadir + + "/nodeKey")); } private Quorum buildWeb3JQuorum(final String containerIpAddress, final Integer mappedPort) { diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/CURRENT b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/CURRENT deleted file mode 100644 index feda7d6b248..00000000000 --- a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000000 diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/LOCK b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/LOCK deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/LOG b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/LOG deleted file mode 100644 index 78b39ebe35e..00000000000 --- a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/LOG +++ /dev/null @@ -1,8 +0,0 @@ -=============== Feb 14, 2021 (AEST) =============== -23:14:40.884025 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -23:14:40.903422 db@open opening -23:14:40.908575 version@stat F·[] S·0B[] Sc·[] -23:14:40.925362 db@janitor F·2 G·0 -23:14:40.928734 db@open done T·21.570473ms -23:14:40.931679 db@close closing -23:14:40.931776 db@close done T·96.123µs diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/MANIFEST-000000 b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/MANIFEST-000000 deleted file mode 100644 index 9d54f6733b1..00000000000 Binary files a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/chaindata/MANIFEST-000000 and /dev/null differ diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/CURRENT b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/CURRENT deleted file mode 100644 index feda7d6b248..00000000000 --- a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000000 diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/LOCK b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/LOCK deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/LOG b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/LOG deleted file mode 100644 index c229bdf81c4..00000000000 --- a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/LOG +++ /dev/null @@ -1,8 +0,0 @@ -=============== Feb 14, 2021 (AEST) =============== -23:14:40.932506 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -23:14:40.943314 db@open opening -23:14:40.946979 version@stat F·[] S·0B[] Sc·[] -23:14:40.951171 db@janitor F·2 G·0 -23:14:40.956883 db@open done T·10.713343ms -23:14:40.957782 db@close closing -23:14:40.957945 db@close done T·162.042µs diff --git a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/MANIFEST-000000 b/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/MANIFEST-000000 deleted file mode 100644 index 9d54f6733b1..00000000000 Binary files a/container-tests/tests/src/test/resources/goQuorum/qdata/geth/lightchaindata/MANIFEST-000000 and /dev/null differ diff --git a/ethereum/referencetests/src/test/resources b/ethereum/referencetests/src/test/resources index 1508126ea04..3f25e873a44 160000 --- a/ethereum/referencetests/src/test/resources +++ b/ethereum/referencetests/src/test/resources @@ -1 +1 @@ -Subproject commit 1508126ea04cd61495b60db2f036ac823de274b1 +Subproject commit 3f25e873a442700d0024168c54a45f6a9d2dec6e