truffle 框架

This commit is contained in:
myh 2024-06-05 16:07:01 +08:00
parent c914473c5c
commit a1c481cef4
7 changed files with 13676 additions and 0 deletions

3
build.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
truffle compile && truffle migrate --reset && cp build/contracts/DeviceManager.json frontend/src/artifacts/DeviceManager.json

View File

@ -0,0 +1,5 @@
var Migrations = artifacts.require("./Migrations.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};

View File

@ -0,0 +1,5 @@
var DeviceManager = artifacts.require("./DeviceManager.sol");
module.exports = function(deployer) {
deployer.deploy(DeviceManager);
};

13640
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"dependencies": {
"truffle": "^5.11.5"
}
}

9
truffle-config.js Normal file
View File

@ -0,0 +1,9 @@
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*"
}
}
};

9
truffle.js Normal file
View File

@ -0,0 +1,9 @@
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*"
}
}
};