mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
commit
c289420899
8 changed files with 61 additions and 23 deletions
33
.github/workflows/ci_deploy.yaml
vendored
33
.github/workflows/ci_deploy.yaml
vendored
|
|
@ -26,23 +26,25 @@ jobs:
|
|||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
# - name: Set up Node.js
|
||||
# uses: actions/setup-node@v4
|
||||
# with:
|
||||
# node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install --save-dev hardhat
|
||||
# - name: Install dependencies
|
||||
# run: npm install --save-dev hardhat
|
||||
|
||||
- name: Run local devnet
|
||||
run: |
|
||||
docker-compose up -d
|
||||
run: docker-compose up -d
|
||||
|
||||
- name: Deploy contracts
|
||||
run: |
|
||||
cd /home/runner/work/go-ethereum/go-ethereum/hardhat
|
||||
npm install --save-dev @nomicfoundation/hardhat-toolbox
|
||||
npx hardhat ignition deploy ./ignition/modules/Lock.js
|
||||
- name: Build a new image with Apollo contract
|
||||
run: docker build -t hardhat-ignition .
|
||||
|
||||
# - name: Deploy contracts
|
||||
# run: |
|
||||
# cd /home/runner/work/go-ethereum/go-ethereum/hardhat
|
||||
# npm install --save-dev @nomicfoundation/hardhat-toolbox
|
||||
# npx hardhat ignition deploy ./ignition/modules/Lock.js
|
||||
|
||||
|
||||
- name: Build and push Docker image
|
||||
|
|
@ -52,6 +54,5 @@ jobs:
|
|||
push: true
|
||||
tags: e1018mc/limechain:deployed
|
||||
|
||||
- name: Tear down local devnet
|
||||
run: |
|
||||
docker-compose down
|
||||
- name: Destroy local devnet
|
||||
run: docker-compose down
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
require("@nomicfoundation/hardhat-toolbox");
|
||||
|
||||
/** @type import('hardhat/config').HardhatUserConfig */
|
||||
module.exports = {
|
||||
solidity: "0.8.24",
|
||||
};
|
||||
15
hardhat/Dockerfile
Normal file
15
hardhat/Dockerfile
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
FROM node:lts-alpine
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8545
|
||||
|
||||
CMD ["npx", "hardhat", "ignition", "deploy", "/usr/app/ignition/modules/Apollo.js"]
|
||||
16
hardhat/contracts/Rocket.sol
Normal file
16
hardhat/contracts/Rocket.sol
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
contract Rocket {
|
||||
string public name;
|
||||
string public status;
|
||||
|
||||
constructor(string memory _name) {
|
||||
name = _name;
|
||||
status = "ignition";
|
||||
}
|
||||
|
||||
function launch() public {
|
||||
status = "lift-off";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
require("@nomicfoundation/hardhat-toolbox");
|
||||
require("@nomicfoundation/hardhat-ignition-ethers");
|
||||
|
||||
/** @type import('hardhat/config').HardhatUserConfig */
|
||||
module.exports = {
|
||||
|
|
|
|||
9
hardhat/ignition/modules/Apollo.js
Normal file
9
hardhat/ignition/modules/Apollo.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");
|
||||
|
||||
module.exports = buildModule("Apollo", (m) => {
|
||||
const apollo = m.contract("Rocket", ["Saturn V"]);
|
||||
|
||||
m.call(apollo, "launch", []);
|
||||
|
||||
return { apollo };
|
||||
});
|
||||
2
hardhat/package-lock.json
generated
2
hardhat/package-lock.json
generated
|
|
@ -9,6 +9,7 @@
|
|||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.4",
|
||||
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
|
||||
"hardhat": "^2.22.5"
|
||||
}
|
||||
|
|
@ -1333,7 +1334,6 @@
|
|||
"integrity": "sha512-vY30V4b788GSziW/nOd0L/4IPw6mwpluahLs4+gPUUKWaHHGMA8OIeHaYpRRljM1i0M/Kg1yIozrDM/aeRebkg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"peerDependencies": {
|
||||
"@nomicfoundation/hardhat-ethers": "^3.0.4",
|
||||
"@nomicfoundation/hardhat-ignition": "^0.15.4",
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@
|
|||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"devDependencies": {
|
||||
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.4",
|
||||
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
|
||||
"hardhat": "^2.22.5"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue