Hedera-local-node in docker machine #136
Unanswered
mamorales1
asked this question in
Q&A
Replies: 1 comment
-
To further add context to the question. We use We are using the following services:
- docker:19.03.5-dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
stages:
- build
- lint
- slither
- test
build:
image: node:16
stage: build
only:
refs:
- merge_requests
- main
script:
- npm install
- npx hardhat compile --force
lint:
image: node:16
stage: lint
only:
refs:
- merge_requests
- main
script:
- npm run lint
slither:
image: $JAVA_EXECUTOR_IMAGE
stage: slither
only:
refs:
- merge_requests
- main
script:
- npm install
- npm run security
test:
image: $JAVA_EXECUTOR_IMAGE
stage: test
only:
refs:
- merge_requests
- main
before_script:
- curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
- npm install -g [email protected]
- npm install
- apt-get update
- apt-get install -y curl
- curl -sL https://deb.nodesource.com/setup_17.x | bash -
- apt install -y nodejs
script:
- cd node_modules/@hashgraph/hedera-local
- docker-compose up -d
- docker ps
- sleep 10
- cd ../../../
- npx hardhat test --network localHederaNetworkPipeline
And the following network configuration for ```
module.exports = {
solidity: {
version: "0.8.10",
settings: {
optimizer: {
enabled: true,
runs: 100,
},
},
},
defaultNetwork: "localHederaNetwork", // The selected default network. It has to match the name of one of the configured networks.
hedera: {
gasLimit: 300000, // Default gas limit. It is added to every contract transaction, but can be overwritten if required.
networks: {
localHederaNetwork: {
consensusNodes: [
{
url: "127.0.0.1:50211",
nodeId: "0.0.3",
},
],
mirrorNodeUrl: "http://127.0.0.1:5551",
chainId: 0,
accounts: [
{
account: "0.0.2",
privateKey: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137",
},
],
},
localHederaNetworkPipeline: {
consensusNodes: [
{
url: "docker:50211",
nodeId: "0.0.3",
},
],
mirrorNodeUrl: "http://docker:5551",
chainId: 0,
accounts: [
{
account: "0.0.2",
privateKey: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137",
},
],
},
},
},
mocha: {
timeout: 400000,
},
}; As a possible solution suggestion, maybe adding some option on the cli to override the ip where it looks for the containers could work as a simple fix? I've added a PR: #137 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We are trying to integrate local node into the lifecycle of our hedera smart contracts. We had no problem to use it to pass smart contracts tests in our local machines, but when we tried to do it in a stage of a gitlab pipeline we are always getting "Waiting the containers, retrying in 20 seconds..." messages at starting, since it seems that there is no communication between docker machine host executing the pipeline and the containers created by hedera-local.
Have you ever tried local node in a docker machine? How dou you recommend to use it in such environment?
Beta Was this translation helpful? Give feedback.
All reactions