hardhat project and hardhat config , node2 and genesis.json , extractPrivatekey script , short documentation.

This commit is contained in:
Teodor 2024-06-12 02:31:45 +03:00
parent e5eb32acee
commit 357a127a99
84 changed files with 19443 additions and 0 deletions

34
commands-for-hardhat.txt Normal file
View file

@ -0,0 +1,34 @@
npm install --save-dev hardhat @nomiclabs/hardhat-waffle @nomiclabs/hardhat-ethers @nomicfoundation/hardhat-ignition ethers
npx hardhat init -y ( still i had to press y and choose javascript project )
npx hardhat compile
npx hardhat ignition deploy ./ignition/modules/Lock.js --network gethDev
build/bin/geth --datadir node1/ account new
Public address of the key: 0x80DE34CaE5490B1f8e92caa5b1B194B4E68546a0
Paste public address in node1/genesis.json
gather private key with this script . paste in hardhat/hardhat.config.js
prerequisites for the script. npm install ethereumjs-wallet keythereum --legacy-peer-deps
node extractPrivateKey.js
Private key: 0xd3d245fd385b65ed722a4b91dcf6691c0a8aaf4a542edfba80f53d077fc504d1
initializing the private blockchain
build/bin/geth init --datadir node2 node2/genesis.json
node2 - 0x248fD25790319C25826ea76b26aA63B1127DF87a
node2 - 0x10db3a848996cd5b190ab083a2a3836c16ea2e16bc30447f3964e76dc5aa8594
build/bin/geth --datadir node2 --syncmode "full" --port 30304 --http --http.addr "localhost" --http.port 8552 --http.api "personal,eth,net,web3,txpool,miner,admin" --http.corsdomain="*" --networkid 2345 --allow-insecure-unlock --authrpc.port 8553 console
build/bin/geth attach http://127.0.0.1:8552 <<EOF
miner.start()
EOF
check balance in console
eth.getBalance(eth.accounts[0])

32
extractPrivateKey.js Normal file
View file

@ -0,0 +1,32 @@
const fs = require('fs');
const keythereum = require('keythereum');
const path = require('path');
// Path to the keystore file
const keystoreDir = path.join(__dirname, 'node2', 'keystore');
const keystoreFile = fs.readdirSync(keystoreDir).find(file => file.startsWith('UTC'));
if (!keystoreFile) {
console.error('Keystore file not found');
process.exit(1);
}
const keystorePath = path.join(keystoreDir, keystoreFile);
const password = '123'; // Replace with your keystore password
// Read and parse the keystore file
try {
const keystore = JSON.parse(fs.readFileSync(keystorePath));
// Extract the private key using the password
keythereum.recover(password, keystore, (privateKey) => {
if (!privateKey) {
console.error('Failed to recover private key');
process.exit(1);
}
console.log(`Private key: 0x${privateKey.toString('hex')}`);
});
} catch (error) {
console.error('Error reading keystore file:', error);
process.exit(1);
}

17
hardhat/.gitignore vendored Normal file
View file

@ -0,0 +1,17 @@
node_modules
.env
# Hardhat files
/cache
/artifacts
# TypeChain files
/typechain
/typechain-types
# solidity-coverage files
/coverage
/coverage.json
# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337

13
hardhat/README.md Normal file
View file

@ -0,0 +1,13 @@
# Sample Hardhat Project
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract.
Try running some of the following tasks:
```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat ignition deploy ./ignition/modules/Lock.js
```

View file

@ -0,0 +1,34 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
// Uncomment this line to use console.log
// import "hardhat/console.sol";
contract Lock {
uint public unlockTime;
address payable public owner;
event Withdrawal(uint amount, uint when);
constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);
unlockTime = _unlockTime;
owner = payable(msg.sender);
}
function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
emit Withdrawal(address(this).balance, block.timestamp);
owner.transfer(address(this).balance);
}
}

21
hardhat/hardhat.config.js Normal file
View file

@ -0,0 +1,21 @@
require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomiclabs/hardhat-ethers");
require("@nomicfoundation/hardhat-ignition-ethers");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.24",
networks: {
localhost: {
url: "http://127.0.0.1:8545"
},
gethDev: {
url: "http://127.0.0.1:8552",
accounts: ["0x10db3a848996cd5b190ab083a2a3836c16ea2e16bc30447f3964e76dc5aa8594"]
}
},
ignition: {
defaultNetwork: "gethDev"
}
};

View file

@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../build-info/22662767f8b1a09e64d324318d70c2ac.json"
}

View file

@ -0,0 +1,74 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "Lock",
"sourceName": "contracts/Lock.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_unlockTime",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "when",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address payable",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unlockTime",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x60806040526040516105d83803806105d8833981810160405281019061002591906100f0565b804210610067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161005e906101a0565b60405180910390fd5b8060008190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506101c0565b600080fd5b6000819050919050565b6100cd816100ba565b81146100d857600080fd5b50565b6000815190506100ea816100c4565b92915050565b600060208284031215610106576101056100b5565b5b6000610114848285016100db565b91505092915050565b600082825260208201905092915050565b7f556e6c6f636b2074696d652073686f756c6420626520696e207468652066757460008201527f7572650000000000000000000000000000000000000000000000000000000000602082015250565b600061018a60238361011d565b91506101958261012e565b604082019050919050565b600060208201905081810360008301526101b98161017d565b9050919050565b610409806101cf6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063251c1aa3146100465780633ccfd60b146100645780638da5cb5b1461006e575b600080fd5b61004e61008c565b60405161005b919061024a565b60405180910390f35b61006c610092565b005b61007661020b565b60405161008391906102a6565b60405180910390f35b60005481565b6000544210156100d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ce9061031e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015e9061038a565b60405180910390fd5b7fbf2ed60bd5b5965d685680c01195c9514e4382e28e3a5a2d2d5244bf59411b9347426040516101989291906103aa565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610208573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000819050919050565b61024481610231565b82525050565b600060208201905061025f600083018461023b565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061029082610265565b9050919050565b6102a081610285565b82525050565b60006020820190506102bb6000830184610297565b92915050565b600082825260208201905092915050565b7f596f752063616e27742077697468647261772079657400000000000000000000600082015250565b60006103086016836102c1565b9150610313826102d2565b602082019050919050565b60006020820190508181036000830152610337816102fb565b9050919050565b7f596f75206172656e277420746865206f776e6572000000000000000000000000600082015250565b60006103746014836102c1565b915061037f8261033e565b602082019050919050565b600060208201905081810360008301526103a381610367565b9050919050565b60006040820190506103bf600083018561023b565b6103cc602083018461023b565b939250505056fea264697066735822122022a2b65355af697b0725f7bcddf1c94be908ee67893e84bd3442d61fdc82585064736f6c63430008180033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063251c1aa3146100465780633ccfd60b146100645780638da5cb5b1461006e575b600080fd5b61004e61008c565b60405161005b919061024a565b60405180910390f35b61006c610092565b005b61007661020b565b60405161008391906102a6565b60405180910390f35b60005481565b6000544210156100d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ce9061031e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015e9061038a565b60405180910390fd5b7fbf2ed60bd5b5965d685680c01195c9514e4382e28e3a5a2d2d5244bf59411b9347426040516101989291906103aa565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610208573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000819050919050565b61024481610231565b82525050565b600060208201905061025f600083018461023b565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061029082610265565b9050919050565b6102a081610285565b82525050565b60006020820190506102bb6000830184610297565b92915050565b600082825260208201905092915050565b7f596f752063616e27742077697468647261772079657400000000000000000000600082015250565b60006103086016836102c1565b9150610313826102d2565b602082019050919050565b60006020820190508181036000830152610337816102fb565b9050919050565b7f596f75206172656e277420746865206f776e6572000000000000000000000000600082015250565b60006103746014836102c1565b915061037f8261033e565b602082019050919050565b600060208201905081810360008301526103a381610367565b9050919050565b60006040820190506103bf600083018561023b565b6103cc602083018461023b565b939250505056fea264697066735822122022a2b65355af697b0725f7bcddf1c94be908ee67893e84bd3442d61fdc82585064736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
{"chainId":1,"type":"DEPLOYMENT_INITIALIZE"}
{"artifactId":"LockModule#Lock","constructorArgs":[1893456000],"contractName":"Lock","dependencies":[],"from":"0x3234220902fef25df18475ac772dbbe7d300cdc2","futureId":"LockModule#Lock","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"1000000000"}}
{"futureId":"LockModule#Lock","networkInteraction":{"data":"0x60806040526040516105d83803806105d8833981810160405281019061002591906100f0565b804210610067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161005e906101a0565b60405180910390fd5b8060008190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506101c0565b600080fd5b6000819050919050565b6100cd816100ba565b81146100d857600080fd5b50565b6000815190506100ea816100c4565b92915050565b600060208284031215610106576101056100b5565b5b6000610114848285016100db565b91505092915050565b600082825260208201905092915050565b7f556e6c6f636b2074696d652073686f756c6420626520696e207468652066757460008201527f7572650000000000000000000000000000000000000000000000000000000000602082015250565b600061018a60238361011d565b91506101958261012e565b604082019050919050565b600060208201905081810360008301526101b98161017d565b9050919050565b610409806101cf6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063251c1aa3146100465780633ccfd60b146100645780638da5cb5b1461006e575b600080fd5b61004e61008c565b60405161005b919061024a565b60405180910390f35b61006c610092565b005b61007661020b565b60405161008391906102a6565b60405180910390f35b60005481565b6000544210156100d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ce9061031e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015e9061038a565b60405180910390fd5b7fbf2ed60bd5b5965d685680c01195c9514e4382e28e3a5a2d2d5244bf59411b9347426040516101989291906103aa565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610208573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000819050919050565b61024481610231565b82525050565b600060208201905061025f600083018461023b565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061029082610265565b9050919050565b6102a081610285565b82525050565b60006020820190506102bb6000830184610297565b92915050565b600082825260208201905092915050565b7f596f752063616e27742077697468647261772079657400000000000000000000600082015250565b60006103086016836102c1565b9150610313826102d2565b602082019050919050565b60006020820190508181036000830152610337816102fb565b9050919050565b7f596f75206172656e277420746865206f776e6572000000000000000000000000600082015250565b60006103746014836102c1565b915061037f8261033e565b602082019050919050565b600060208201905081810360008301526103a381610367565b9050919050565b60006040820190506103bf600083018561023b565b6103cc602083018461023b565b939250505056fea264697066735822122022a2b65355af697b0725f7bcddf1c94be908ee67893e84bd3442d61fdc82585064736f6c634300081800330000000000000000000000000000000000000000000000000000000070dbd880","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"1000000000"}},"type":"NETWORK_INTERACTION_REQUEST"}

View file

@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../build-info/22662767f8b1a09e64d324318d70c2ac.json"
}

View file

@ -0,0 +1,74 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "Lock",
"sourceName": "contracts/Lock.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_unlockTime",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "when",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address payable",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unlockTime",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x60806040526040516105d83803806105d8833981810160405281019061002591906100f0565b804210610067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161005e906101a0565b60405180910390fd5b8060008190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506101c0565b600080fd5b6000819050919050565b6100cd816100ba565b81146100d857600080fd5b50565b6000815190506100ea816100c4565b92915050565b600060208284031215610106576101056100b5565b5b6000610114848285016100db565b91505092915050565b600082825260208201905092915050565b7f556e6c6f636b2074696d652073686f756c6420626520696e207468652066757460008201527f7572650000000000000000000000000000000000000000000000000000000000602082015250565b600061018a60238361011d565b91506101958261012e565b604082019050919050565b600060208201905081810360008301526101b98161017d565b9050919050565b610409806101cf6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063251c1aa3146100465780633ccfd60b146100645780638da5cb5b1461006e575b600080fd5b61004e61008c565b60405161005b919061024a565b60405180910390f35b61006c610092565b005b61007661020b565b60405161008391906102a6565b60405180910390f35b60005481565b6000544210156100d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ce9061031e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015e9061038a565b60405180910390fd5b7fbf2ed60bd5b5965d685680c01195c9514e4382e28e3a5a2d2d5244bf59411b9347426040516101989291906103aa565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610208573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000819050919050565b61024481610231565b82525050565b600060208201905061025f600083018461023b565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061029082610265565b9050919050565b6102a081610285565b82525050565b60006020820190506102bb6000830184610297565b92915050565b600082825260208201905092915050565b7f596f752063616e27742077697468647261772079657400000000000000000000600082015250565b60006103086016836102c1565b9150610313826102d2565b602082019050919050565b60006020820190508181036000830152610337816102fb565b9050919050565b7f596f75206172656e277420746865206f776e6572000000000000000000000000600082015250565b60006103746014836102c1565b915061037f8261033e565b602082019050919050565b600060208201905081810360008301526103a381610367565b9050919050565b60006040820190506103bf600083018561023b565b6103cc602083018461023b565b939250505056fea264697066735822122022a2b65355af697b0725f7bcddf1c94be908ee67893e84bd3442d61fdc82585064736f6c63430008180033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063251c1aa3146100465780633ccfd60b146100645780638da5cb5b1461006e575b600080fd5b61004e61008c565b60405161005b919061024a565b60405180910390f35b61006c610092565b005b61007661020b565b60405161008391906102a6565b60405180910390f35b60005481565b6000544210156100d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ce9061031e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015e9061038a565b60405180910390fd5b7fbf2ed60bd5b5965d685680c01195c9514e4382e28e3a5a2d2d5244bf59411b9347426040516101989291906103aa565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610208573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000819050919050565b61024481610231565b82525050565b600060208201905061025f600083018461023b565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061029082610265565b9050919050565b6102a081610285565b82525050565b60006020820190506102bb6000830184610297565b92915050565b600082825260208201905092915050565b7f596f752063616e27742077697468647261772079657400000000000000000000600082015250565b60006103086016836102c1565b9150610313826102d2565b602082019050919050565b60006020820190508181036000830152610337816102fb565b9050919050565b7f596f75206172656e277420746865206f776e6572000000000000000000000000600082015250565b60006103746014836102c1565b915061037f8261033e565b602082019050919050565b600060208201905081810360008301526103a381610367565b9050919050565b60006040820190506103bf600083018561023b565b6103cc602083018461023b565b939250505056fea264697066735822122022a2b65355af697b0725f7bcddf1c94be908ee67893e84bd3442d61fdc82585064736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,3 @@
{
"LockModule#Lock": "0x88a4fBB6fA59Cfc8eb00d030204DEC869d38906E"
}

View file

@ -0,0 +1,7 @@
{"chainId":2345,"type":"DEPLOYMENT_INITIALIZE"}
{"artifactId":"LockModule#Lock","constructorArgs":[1893456000],"contractName":"Lock","dependencies":[],"from":"0x248fd25790319c25826ea76b26aa63b1127df87a","futureId":"LockModule#Lock","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"1000000000"}}
{"futureId":"LockModule#Lock","networkInteraction":{"data":"0x60806040526040516105d83803806105d8833981810160405281019061002591906100f0565b804210610067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161005e906101a0565b60405180910390fd5b8060008190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506101c0565b600080fd5b6000819050919050565b6100cd816100ba565b81146100d857600080fd5b50565b6000815190506100ea816100c4565b92915050565b600060208284031215610106576101056100b5565b5b6000610114848285016100db565b91505092915050565b600082825260208201905092915050565b7f556e6c6f636b2074696d652073686f756c6420626520696e207468652066757460008201527f7572650000000000000000000000000000000000000000000000000000000000602082015250565b600061018a60238361011d565b91506101958261012e565b604082019050919050565b600060208201905081810360008301526101b98161017d565b9050919050565b610409806101cf6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063251c1aa3146100465780633ccfd60b146100645780638da5cb5b1461006e575b600080fd5b61004e61008c565b60405161005b919061024a565b60405180910390f35b61006c610092565b005b61007661020b565b60405161008391906102a6565b60405180910390f35b60005481565b6000544210156100d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ce9061031e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015e9061038a565b60405180910390fd5b7fbf2ed60bd5b5965d685680c01195c9514e4382e28e3a5a2d2d5244bf59411b9347426040516101989291906103aa565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610208573d6000803e3d6000fd5b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000819050919050565b61024481610231565b82525050565b600060208201905061025f600083018461023b565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061029082610265565b9050919050565b6102a081610285565b82525050565b60006020820190506102bb6000830184610297565b92915050565b600082825260208201905092915050565b7f596f752063616e27742077697468647261772079657400000000000000000000600082015250565b60006103086016836102c1565b9150610313826102d2565b602082019050919050565b60006020820190508181036000830152610337816102fb565b9050919050565b7f596f75206172656e277420746865206f776e6572000000000000000000000000600082015250565b60006103746014836102c1565b915061037f8261033e565b602082019050919050565b600060208201905081810360008301526103a381610367565b9050919050565b60006040820190506103bf600083018561023b565b6103cc602083018461023b565b939250505056fea264697066735822122022a2b65355af697b0725f7bcddf1c94be908ee67893e84bd3442d61fdc82585064736f6c634300081800330000000000000000000000000000000000000000000000000000000070dbd880","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"1000000000"}},"type":"NETWORK_INTERACTION_REQUEST"}
{"futureId":"LockModule#Lock","networkInteractionId":1,"nonce":0,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"1180790232"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"1000000000"}},"hash":"0x020a3fdcb682695efec5a09075b7e388fb1b23d237c383fa4a93e949250f6c94"},"type":"TRANSACTION_SEND"}
{"futureId":"LockModule#Lock","hash":"0x020a3fdcb682695efec5a09075b7e388fb1b23d237c383fa4a93e949250f6c94","networkInteractionId":1,"receipt":{"blockHash":"0x97b9db9c522fb7a06904c208b788c21f4874e0e99508bbf3ab5e3ec2f3de8f6f","blockNumber":19,"contractAddress":"0x88a4fBB6fA59Cfc8eb00d030204DEC869d38906E","logs":[],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"}
{"futureId":"LockModule#Lock","result":{"address":"0x88a4fBB6fA59Cfc8eb00d030204DEC869d38906E","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"}

View file

@ -0,0 +1,15 @@
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");
const JAN_1ST_2030 = 1893456000;
const ONE_GWEI = 1_000_000_000n;
module.exports = buildModule("LockModule", (m) => {
const unlockTime = m.getParameter("unlockTime", JAN_1ST_2030);
const lockedAmount = m.getParameter("lockedAmount", ONE_GWEI);
const lock = m.contract("Lock", [unlockTime], {
value: lockedAmount,
});
return { lock };
});

10166
hardhat/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

11
hardhat/package.json Normal file
View file

@ -0,0 +1,11 @@
{
"name": "hardhat-project",
"devDependencies": {
"@nomicfoundation/hardhat-ignition": "^0.15.4",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6",
"ethers": "^6.13.0",
"hardhat": "^2.22.5"
}
}

126
hardhat/test/Lock.js Normal file
View file

@ -0,0 +1,126 @@
const {
time,
loadFixture,
} = require("@nomicfoundation/hardhat-toolbox/network-helpers");
const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs");
const { expect } = require("chai");
describe("Lock", function () {
// We define a fixture to reuse the same setup in every test.
// We use loadFixture to run this setup once, snapshot that state,
// and reset Hardhat Network to that snapshot in every test.
async function deployOneYearLockFixture() {
const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60;
const ONE_GWEI = 1_000_000_000;
const lockedAmount = ONE_GWEI;
const unlockTime = (await time.latest()) + ONE_YEAR_IN_SECS;
// Contracts are deployed using the first signer/account by default
const [owner, otherAccount] = await ethers.getSigners();
const Lock = await ethers.getContractFactory("Lock");
const lock = await Lock.deploy(unlockTime, { value: lockedAmount });
return { lock, unlockTime, lockedAmount, owner, otherAccount };
}
describe("Deployment", function () {
it("Should set the right unlockTime", async function () {
const { lock, unlockTime } = await loadFixture(deployOneYearLockFixture);
expect(await lock.unlockTime()).to.equal(unlockTime);
});
it("Should set the right owner", async function () {
const { lock, owner } = await loadFixture(deployOneYearLockFixture);
expect(await lock.owner()).to.equal(owner.address);
});
it("Should receive and store the funds to lock", async function () {
const { lock, lockedAmount } = await loadFixture(
deployOneYearLockFixture
);
expect(await ethers.provider.getBalance(lock.target)).to.equal(
lockedAmount
);
});
it("Should fail if the unlockTime is not in the future", async function () {
// We don't use the fixture here because we want a different deployment
const latestTime = await time.latest();
const Lock = await ethers.getContractFactory("Lock");
await expect(Lock.deploy(latestTime, { value: 1 })).to.be.revertedWith(
"Unlock time should be in the future"
);
});
});
describe("Withdrawals", function () {
describe("Validations", function () {
it("Should revert with the right error if called too soon", async function () {
const { lock } = await loadFixture(deployOneYearLockFixture);
await expect(lock.withdraw()).to.be.revertedWith(
"You can't withdraw yet"
);
});
it("Should revert with the right error if called from another account", async function () {
const { lock, unlockTime, otherAccount } = await loadFixture(
deployOneYearLockFixture
);
// We can increase the time in Hardhat Network
await time.increaseTo(unlockTime);
// We use lock.connect() to send a transaction from another account
await expect(lock.connect(otherAccount).withdraw()).to.be.revertedWith(
"You aren't the owner"
);
});
it("Shouldn't fail if the unlockTime has arrived and the owner calls it", async function () {
const { lock, unlockTime } = await loadFixture(
deployOneYearLockFixture
);
// Transactions are sent using the first signer by default
await time.increaseTo(unlockTime);
await expect(lock.withdraw()).not.to.be.reverted;
});
});
describe("Events", function () {
it("Should emit an event on withdrawals", async function () {
const { lock, unlockTime, lockedAmount } = await loadFixture(
deployOneYearLockFixture
);
await time.increaseTo(unlockTime);
await expect(lock.withdraw())
.to.emit(lock, "Withdrawal")
.withArgs(lockedAmount, anyValue); // We accept any value as `when` arg
});
});
describe("Transfers", function () {
it("Should transfer the funds to the owner", async function () {
const { lock, unlockTime, lockedAmount, owner } = await loadFixture(
deployOneYearLockFixture
);
await time.increaseTo(unlockTime);
await expect(lock.withdraw()).to.changeEtherBalances(
[owner, lock],
[lockedAmount, -lockedAmount]
);
});
});
});
});

29
node2/genesis.json Normal file
View file

@ -0,0 +1,29 @@
{
"config": {
"chainId": 2345,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 0
},
"nonce": "0x0",
"timestamp": "0x0",
"extraData": "0x3234220902fEf25df18475Ac772DbBE7d300cdC2",
"gasLimit": "0x8000000",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0x248fD25790319C25826ea76b26aA63B1127DF87a": { "balance": "100000000000000000000000000000000000000000000000000000000000000000000000" }
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

0
node2/geth/LOCK Normal file
View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
MANIFEST-000025

View file

@ -0,0 +1 @@
MANIFEST-000022

View file

109
node2/geth/chaindata/LOG Normal file
View file

@ -0,0 +1,109 @@
=============== Jun 11, 2024 (EEST) ===============
19:31:42.863291 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:31:42.867009 db@open opening
19:31:42.867396 version@stat F·[] S·0B[] Sc·[]
19:31:42.870682 db@janitor F·2 G·0
19:31:42.870713 db@open done T·3.680968ms
=============== Jun 11, 2024 (EEST) ===============
19:38:42.732239 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:38:42.732369 version@stat F·[] S·0B[] Sc·[]
19:38:42.732382 db@open opening
19:38:42.732429 journal@recovery F·1
19:38:42.732701 journal@recovery recovering @1
19:38:42.739752 version@stat F·[] S·0B[] Sc·[]
19:38:42.744512 db@janitor F·2 G·0
19:38:42.744539 db@open done T·12.142313ms
19:38:42.751503 db@close closing
19:38:42.751543 db@close done T·40.136µs
=============== Jun 11, 2024 (EEST) ===============
19:40:51.564744 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:40:51.564875 version@stat F·[] S·0B[] Sc·[]
19:40:51.564889 db@open opening
19:40:51.564937 journal@recovery F·1
19:40:51.565274 journal@recovery recovering @2
19:40:51.574834 memdb@flush created L0@4 N·13 S·1002B "H\xb95..\x8e\x960,v6":"\x7f\xc8\x00..^\xb4\x82,v2"
19:40:51.655272 version@stat F·[1] S·1002B[1002B] Sc·[0.25]
19:40:51.660030 db@janitor F·3 G·0
19:40:51.660047 db@open done T·95.15079ms
19:47:36.880567 db@close closing
19:47:36.880804 db@close done T·234.921µs
=============== Jun 11, 2024 (EEST) ===============
19:47:51.692141 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:47:51.692626 version@stat F·[1] S·1002B[1002B] Sc·[0.25]
19:47:51.692651 db@open opening
19:47:51.692713 journal@recovery F·1
19:47:51.693144 journal@recovery recovering @5
19:47:51.701697 memdb@flush created L0@7 N·13 S·696B "Dat..ion,v16":"unc..own,v21"
19:47:51.702102 version@stat F·[2] S·1KiB[1KiB] Sc·[0.50]
19:47:51.706739 db@janitor F·4 G·0
19:47:51.706763 db@open done T·14.098469ms
22:12:31.220876 db@close closing
22:12:31.221691 db@close done T·1.028513ms
=============== Jun 11, 2024 (EEST) ===============
22:13:01.954928 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:13:01.958550 version@stat F·[2] S·1KiB[1KiB] Sc·[0.50]
22:13:01.958585 db@open opening
22:13:01.958644 journal@recovery F·1
22:13:01.958985 journal@recovery recovering @8
22:13:01.969198 memdb@flush created L0@10 N·1601 S·91KiB "\x14\x1a\x04..L\n\x19,v1621":"\xf5\x18\x9e..ާi,v1626"
22:13:01.969570 version@stat F·[3] S·92KiB[92KiB] Sc·[0.75]
22:13:01.975545 db@janitor F·5 G·0
22:13:01.975634 db@open done T·17.026839ms
22:14:37.532461 db@close closing
22:14:37.532862 db@close done T·398.448µs
=============== Jun 11, 2024 (EEST) ===============
22:19:52.081569 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:19:52.081758 version@stat F·[3] S·92KiB[92KiB] Sc·[0.75]
22:19:52.081779 db@open opening
22:19:52.081827 journal@recovery F·1
22:19:52.082231 journal@recovery recovering @11
22:19:52.090666 memdb@flush created L0@13 N·135 S·12KiB "H\x13\xdd..\xd7^\xb6,v1689":"\xf1\xc0#..\xca?\x13,v1764"
22:19:52.091077 version@stat F·[4] S·104KiB[104KiB] Sc·[1.00]
22:19:52.100994 db@janitor F·6 G·0
22:19:52.101038 db@open done T·19.246656ms
22:19:52.102995 table@compaction L0·4 -> L1·0 S·104KiB Q·1766
22:19:52.109466 table@build created L1@16 N·1171 S·75KiB "\x14\x1a\x04..L\n\x19,v1621":"\xf5\x18\x9e..ާi,v1626"
22:19:52.109513 version@stat F·[0 1] S·75KiB[0B 75KiB] Sc·[0.00 0.00]
22:19:52.111515 table@compaction committed F-3 S-29KiB Ke·0 D·591 T·8.470847ms
22:19:52.111647 table@remove removed @10
22:19:52.111687 table@remove removed @7
22:19:52.111724 table@remove removed @4
22:30:21.784923 db@close closing
22:30:21.784974 db@close done T·50.455µs
=============== Jun 11, 2024 (EEST) ===============
22:40:45.664372 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:40:45.664548 version@stat F·[0 1] S·75KiB[0B 75KiB] Sc·[0.00 0.00]
22:40:45.664573 db@open opening
22:40:45.664618 journal@recovery F·1
22:40:45.664971 journal@recovery recovering @14
22:40:45.675422 memdb@flush created L0@17 N·7 S·6KiB "Sna..tor,v1771":"unc..own,v1768"
22:40:45.807502 version@stat F·[1 1] S·82KiB[6KiB 75KiB] Sc·[0.25 0.00]
22:40:45.819296 db@janitor F·5 G·1
22:40:45.819341 db@janitor removing table-13
22:40:45.819446 db@open done T·154.862506ms
22:53:38.139412 db@close closing
22:53:38.139756 db@close done T·343.435µs
=============== Jun 11, 2024 (EEST) ===============
22:54:20.754738 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:54:20.756215 version@stat F·[1 1] S·82KiB[6KiB 75KiB] Sc·[0.25 0.00]
22:54:20.756244 db@open opening
22:54:20.756293 journal@recovery F·1
22:54:20.756767 journal@recovery recovering @18
22:54:20.765195 memdb@flush created L0@20 N·848 S·49KiB "2\xc9\xf2..\x97\x8e%,v2619":"\xbe\xdb\xeb..&\x85\xbd,v2621"
22:54:20.769066 version@stat F·[2 1] S·132KiB[56KiB 75KiB] Sc·[0.50 0.00]
22:54:20.787452 db@janitor F·5 G·0
22:54:20.787486 db@open done T·31.22459ms
22:59:08.918853 db@close closing
22:59:08.920245 db@close done T·1.38095ms
=============== Jun 11, 2024 (EEST) ===============
22:59:37.329809 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:59:37.330192 version@stat F·[2 1] S·132KiB[56KiB 75KiB] Sc·[0.50 0.00]
22:59:37.330221 db@open opening
22:59:37.330268 journal@recovery F·1
22:59:37.330816 journal@recovery recovering @21
22:59:37.335844 memdb@flush created L0@23 N·5 S·6KiB "Sna..tor,v2626":"unc..own,v2625"
22:59:37.336588 version@stat F·[3 1] S·138KiB[63KiB 75KiB] Sc·[0.75 0.00]
22:59:37.342056 db@janitor F·6 G·0
22:59:37.342090 db@open done T·11.85183ms
22:59:37.453301 db@close closing
22:59:37.453345 db@close done T·43.813µs

Binary file not shown.

View file

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

View file

@ -0,0 +1 @@
<EFBFBD><01>

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

1
node2/geth/jwtsecret Normal file
View file

@ -0,0 +1 @@
0x992911517615802652b00c65b0a959db90fcb1584231d8a621566b62ab5997fc

Binary file not shown.

View file

@ -0,0 +1 @@
MANIFEST-000000

View file

View file

@ -0,0 +1,8 @@
=============== Jun 11, 2024 (EEST) ===============
19:38:42.752001 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:38:42.754783 db@open opening
19:38:42.755159 version@stat F·[] S·0B[] Sc·[]
19:38:42.757231 db@janitor F·2 G·0
19:38:42.757245 db@open done T·2.448251ms
19:38:42.766906 db@close closing
19:38:42.766946 db@close done T·40.116µs

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

View file

@ -0,0 +1 @@
<EFBFBD><01>

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

Binary file not shown.

View file

@ -0,0 +1 @@
<EFBFBD><01>

1
node2/geth/nodekey Normal file
View file

@ -0,0 +1 @@
2d1f1144f99c5231f355643d28903ee8361ff987185c64875167d4374419bece

BIN
node2/geth/nodes/000020.ldb Normal file

Binary file not shown.

BIN
node2/geth/nodes/000021.ldb Normal file

Binary file not shown.

BIN
node2/geth/nodes/000022.log Normal file

Binary file not shown.

1
node2/geth/nodes/CURRENT Normal file
View file

@ -0,0 +1 @@
MANIFEST-000023

View file

@ -0,0 +1 @@
MANIFEST-000019

0
node2/geth/nodes/LOCK Normal file
View file

108
node2/geth/nodes/LOG Normal file
View file

@ -0,0 +1,108 @@
=============== Jun 11, 2024 (EEST) ===============
19:40:51.667744 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:40:51.670215 db@open opening
19:40:51.672519 version@stat F·[] S·0B[] Sc·[]
19:40:51.673374 db@janitor F·2 G·0
19:40:51.673388 db@open done T·3.161192ms
19:47:36.881297 db@close closing
19:47:36.881339 db@close done T·41.859µs
=============== Jun 11, 2024 (EEST) ===============
19:47:51.715047 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
19:47:51.715160 version@stat F·[] S·0B[] Sc·[]
19:47:51.715173 db@open opening
19:47:51.715208 journal@recovery F·1
19:47:51.720612 journal@recovery recovering @1
19:47:51.724712 memdb@flush created L0@2 N·865 S·27KiB "loc..seq,v28":"version,v1"
19:47:51.727103 version@stat F·[1] S·27KiB[27KiB] Sc·[0.25]
19:47:51.740919 db@janitor F·3 G·0
19:47:51.740961 db@open done T·25.777661ms
22:12:33.732187 db@close closing
22:12:33.732861 db@close done T·666.633µs
=============== Jun 11, 2024 (EEST) ===============
22:13:02.035633 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:13:02.040439 version@stat F·[1] S·27KiB[27KiB] Sc·[0.25]
22:13:02.040488 db@open opening
22:13:02.040588 journal@recovery F·1
22:13:02.045477 journal@recovery recovering @3
22:13:02.171197 memdb@flush created L0@5 N·25589 S·551KiB "loc..seq,v7742":"n:\xff..ong,v10756"
22:13:02.173756 version@stat F·[2] S·578KiB[578KiB] Sc·[0.50]
22:13:02.178909 db@janitor F·4 G·0
22:13:02.178931 db@open done T·138.436642ms
22:13:02.202968 table@compaction L0·2 -> L1·0 S·578KiB Q·26457
22:13:02.336628 table@build created L1@8 N·10140 S·331KiB "loc..seq,v7742":"version,v1"
22:13:02.336688 version@stat F·[0 1] S·331KiB[0B 331KiB] Sc·[0.00 0.00]
22:13:02.367809 table@compaction committed F-1 S-246KiB Ke·0 D·16314 T·164.787021ms
22:13:02.368200 table@remove removed @2
22:14:41.463321 db@close closing
22:14:41.463455 db@close done T·135.294µs
=============== Jun 11, 2024 (EEST) ===============
22:19:52.160463 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:19:52.160645 version@stat F·[0 1] S·331KiB[0B 331KiB] Sc·[0.00 0.00]
22:19:52.160660 db@open opening
22:19:52.160705 journal@recovery F·1
22:19:52.163056 journal@recovery recovering @6
22:19:52.171445 memdb@flush created L0@9 N·429 S·13KiB "loc..seq,v26480":"n:\xf3..ong,v26633"
22:19:52.174439 version@stat F·[1 1] S·345KiB[13KiB 331KiB] Sc·[0.25 0.00]
22:19:52.180125 db@janitor F·5 G·1
22:19:52.180142 db@janitor removing table-5
22:19:52.180315 db@open done T·19.648302ms
22:19:52.229921 table@compaction L0·1 -> L1·1 S·345KiB Q·26887
22:19:52.320777 table@build created L1@12 N·10522 S·342KiB "loc..seq,v26480":"version,v1"
22:19:52.320857 version@stat F·[0 1] S·342KiB[0B 342KiB] Sc·[0.00 0.00]
22:19:52.355823 table@compaction committed F-1 S-2KiB Ke·0 D·47 T·125.816401ms
22:19:52.356069 table@remove removed @8
22:30:22.068703 db@close closing
22:30:22.068858 db@close done T·158.368µs
=============== Jun 11, 2024 (EEST) ===============
22:40:45.855273 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:40:45.855639 version@stat F·[0 1] S·342KiB[0B 342KiB] Sc·[0.00 0.00]
22:40:45.855663 db@open opening
22:40:45.855732 journal@recovery F·1
22:40:45.858574 journal@recovery recovering @10
22:40:45.875918 memdb@flush created L0@13 N·3995 S·115KiB "loc..seq,v26912":"n:\xff..ong,v29777"
22:40:45.878041 version@stat F·[1 1] S·457KiB[115KiB 342KiB] Sc·[0.25 0.00]
22:40:45.881877 db@janitor F·5 G·1
22:40:45.881891 db@janitor removing table-9
22:40:45.881958 db@open done T·26.287715ms
22:40:46.701717 table@compaction L0·1 -> L1·1 S·457KiB Q·30886
22:40:46.742973 table@build created L1@16 N·12877 S·421KiB "loc..seq,v26912":"version,v1"
22:40:46.743047 version@stat F·[0 1] S·421KiB[0B 421KiB] Sc·[0.00 0.00]
22:40:46.744238 table@compaction committed F-1 S-36KiB Ke·0 D·1640 T·42.482924ms
22:40:46.744434 table@remove removed @12
22:53:43.096783 db@close closing
22:53:43.097294 db@close done T·620.335µs
=============== Jun 11, 2024 (EEST) ===============
22:54:20.838183 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:54:20.844488 version@stat F·[0 1] S·421KiB[0B 421KiB] Sc·[0.00 0.00]
22:54:20.844561 db@open opening
22:54:20.844623 journal@recovery F·1
22:54:20.847877 journal@recovery recovering @14
22:54:20.878903 memdb@flush created L0@17 N·5553 S·148KiB "loc..seq,v30905":"n:\xfd..ong,v31740"
22:54:20.882175 version@stat F·[1 1] S·570KiB[148KiB 421KiB] Sc·[0.25 0.00]
22:54:20.888086 db@janitor F·5 G·1
22:54:20.888104 db@janitor removing table-13
22:54:20.888151 db@open done T·43.58251ms
22:54:22.292112 table@compaction L0·1 -> L1·1 S·570KiB Q·36443
22:54:22.306658 table@build created L1@20 N·15518 S·508KiB "loc..seq,v30905":"version,v1"
22:54:22.306709 version@stat F·[0 1] S·508KiB[0B 508KiB] Sc·[0.00 0.00]
22:54:22.307599 table@compaction committed F-1 S-62KiB Ke·0 D·2912 T·15.44288ms
22:54:22.307755 table@remove removed @16
22:59:09.984019 db@close closing
22:59:09.984261 db@close done T·302.197µs
=============== Jun 11, 2024 (EEST) ===============
22:59:37.360966 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
22:59:37.361123 version@stat F·[0 1] S·508KiB[0B 508KiB] Sc·[0.00 0.00]
22:59:37.361137 db@open opening
22:59:37.361225 journal@recovery F·1
22:59:37.363691 journal@recovery recovering @18
22:59:37.368706 memdb@flush created L0@21 N·1070 S·34KiB "loc..seq,v36461":"n:\xff..ong,v36862"
22:59:37.371841 version@stat F·[1 1] S·542KiB[34KiB 508KiB] Sc·[0.25 0.00]
22:59:37.375937 db@janitor F·5 G·1
22:59:37.375953 db@janitor removing table-17
22:59:37.376037 db@open done T·14.893746ms
22:59:37.955268 table@compaction L0·1 -> L1·1 S·542KiB Q·37508
22:59:37.965908 db@close closing
22:59:37.969811 table@build created L1@24 N·16369 S·536KiB "loc..seq,v36461":"version,v1"
22:59:37.969841 table@build exiting
22:59:37.969849 table@build revert @24
22:59:37.970114 db@close done T·4.207642ms

Binary file not shown.

View file

Binary file not shown.

Binary file not shown.

23
node2/history Normal file
View file

@ -0,0 +1,23 @@
miner.start(1)
miner.stop(0)
miner.stop()
miner.start(1)
eth.getBalance("0x248fD25790319C25826ea76b26aA63B1127DF87a")
eth
eth.getBalance(eth.accounts[0])
eth.getBalance(0)
eth.accounts(0)
eth.accounts[0]
miner.stop(1)
miner.stop()
eth.getbalance()
eth.getBalance()
eth.getBalance(1)
eth.getBalance(0)
eth.accounts(0)
eth.getBalance(eth.accounts[0])
eth.getBalance("0x248fD25790319C25826ea76b26aA63B1127DF87a")
miner.stop
miner.stop90
miner.stop()

View file

@ -0,0 +1 @@
{"address":"248fd25790319c25826ea76b26aa63b1127df87a","crypto":{"cipher":"aes-128-ctr","ciphertext":"3ad7af8328c813a5b86933f9a1c05ff4fae16b76c0608df88b5a6573c5fe2316","cipherparams":{"iv":"8ebe32f35583a44959a153f5edd8cf13"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"d5455f190a243a1b85d785524b99b3cbf69872d80d88ff0aa1f6d2ae6bb90900"},"mac":"c5a94ff36fb56f8b5004d8c300439e81f0cecc5c523fffb48b6b543c76ff4541"},"id":"fabcdfe0-4157-4a3a-ac98-6c0dc9d19745","version":3}

81
nohup.out Normal file
View file

@ -0,0 +1,81 @@
INFO [06-11|22:59:37.322] Maximum peer count ETH=50 LES=0 total=50
INFO [06-11|22:59:37.323] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
WARN [06-11|22:59:37.326] Sanitizing cache to Go's GC limits provided=1024 updated=653
INFO [06-11|22:59:37.326] Set global gas cap cap=50,000,000
INFO [06-11|22:59:37.329] Allocated trie memory caches clean=97.00MiB dirty=163.00MiB
INFO [06-11|22:59:37.329] Allocated cache and file handles database=/home/teodor/limechain/go-ethereum/node2/geth/chaindata cache=325.00MiB handles=524,288
INFO [06-11|22:59:37.345] Opened ancient database database=/home/teodor/limechain/go-ethereum/node2/geth/chaindata/ancient/chain readonly=false
INFO [06-11|22:59:37.346]
INFO [06-11|22:59:37.346] ---------------------------------------------------------------------------------------------------------------------------------------------------------
INFO [06-11|22:59:37.346] Chain ID: 2345 (unknown)
INFO [06-11|22:59:37.346] Consensus: unknown
INFO [06-11|22:59:37.346]
INFO [06-11|22:59:37.346] Pre-Merge hard forks:
INFO [06-11|22:59:37.346] - Homestead: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/homestead.md)
INFO [06-11|22:59:37.346] - Tangerine Whistle (EIP 150): 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/tangerine-whistle.md)
INFO [06-11|22:59:37.346] - Spurious Dragon/1 (EIP 155): 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md)
INFO [06-11|22:59:37.346] - Spurious Dragon/2 (EIP 158): 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md)
INFO [06-11|22:59:37.346] - Byzantium: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/byzantium.md)
INFO [06-11|22:59:37.346] - Constantinople: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/constantinople.md)
INFO [06-11|22:59:37.346] - Petersburg: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/petersburg.md)
INFO [06-11|22:59:37.346] - Istanbul: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/istanbul.md)
INFO [06-11|22:59:37.346] - Muir Glacier: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/muir-glacier.md)
INFO [06-11|22:59:37.346] - Berlin: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/berlin.md)
INFO [06-11|22:59:37.346] - London: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md)
INFO [06-11|22:59:37.346]
INFO [06-11|22:59:37.346] The Merge is not yet available for this network!
INFO [06-11|22:59:37.346] - Hard-fork specification: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md
INFO [06-11|22:59:37.346] ---------------------------------------------------------------------------------------------------------------------------------------------------------
INFO [06-11|22:59:37.346]
INFO [06-11|22:59:37.346] Disk storage enabled for ethash caches dir=/home/teodor/limechain/go-ethereum/node2/geth/ethash count=3
INFO [06-11|22:59:37.346] Disk storage enabled for ethash DAGs dir=/home/teodor/.ethash count=2
INFO [06-11|22:59:37.346] Initialising Ethereum protocol network=2345 dbversion=8
INFO [06-11|22:59:37.349] Loaded most recent local header number=282 hash=d70008..0b0722 td=37,826,996 age=6m16s
INFO [06-11|22:59:37.349] Loaded most recent local full block number=282 hash=d70008..0b0722 td=37,826,996 age=6m16s
INFO [06-11|22:59:37.349] Loaded most recent local fast block number=282 hash=d70008..0b0722 td=37,826,996 age=6m16s
INFO [06-11|22:59:37.359] Loaded local transaction journal transactions=0 dropped=0
INFO [06-11|22:59:37.359] Regenerated local transaction journal transactions=0 accounts=0
INFO [06-11|22:59:37.360] Gasprice oracle is ignoring threshold set threshold=2
WARN [06-11|22:59:37.360] Engine API enabled protocol=eth
WARN [06-11|22:59:37.360] Engine API started but chain not configured for merge yet
INFO [06-11|22:59:37.360] Starting peer-to-peer node instance=Geth/v1.10.26-stable-e5eb32ac/linux-amd64/go1.22.4
INFO [06-11|22:59:37.385] New local node record seq=1,718,124,051,689 id=ec6e7be280fcb04f ip=127.0.0.1 udp=30304 tcp=30304
INFO [06-11|22:59:37.386] IPC endpoint opened url=/home/teodor/limechain/go-ethereum/node2/geth.ipc
INFO [06-11|22:59:37.386] Loaded JWT secret file path=/home/teodor/limechain/go-ethereum/node2/geth/jwtsecret crc32=0xa11b7fc3
INFO [06-11|22:59:37.392] Started P2P networking self=enode://b36e7cc99fb3dbcbe4572eef9cf8aaf6477856e3e9f74c0bef84e4334cd1f72d4cad2a66edf3f7151230381b0d26384c00c2dea59691f6a2d512fd2c7706ad2c@127.0.0.1:30304
INFO [06-11|22:59:37.393] HTTP server started endpoint=127.0.0.1:8552 auth=false prefix= cors=* vhosts=localhost
INFO [06-11|22:59:37.393] WebSocket enabled url=ws://127.0.0.1:8553
INFO [06-11|22:59:37.393] HTTP server started endpoint=127.0.0.1:8553 auth=true prefix= cors=localhost vhosts=localhost
INFO [06-11|22:59:37.393] Transaction pool price threshold updated price=0
INFO [06-11|22:59:37.393] Updated mining threads threads=0
INFO [06-11|22:59:37.393] Transaction pool price threshold updated price=1,000,000,000
INFO [06-11|22:59:37.400] Commit new sealing work number=283 sealhash=e70ce6..aa04b3 uncles=0 txs=0 gas=0 fees=0 elapsed="179.096µs"
INFO [06-11|22:59:37.400] Commit new sealing work number=283 sealhash=e70ce6..aa04b3 uncles=0 txs=0 gas=0 fees=0 elapsed="335.069µs"
Welcome to the Geth JavaScript console!
instance: Geth/v1.10.26-stable-e5eb32ac/linux-amd64/go1.22.4
coinbase: 0x248fd25790319c25826ea76b26aa63b1127df87a
at block: 282 (Tue Jun 11 2024 22:53:21 GMT+0300 (EEST))
datadir: /home/teodor/limechain/go-ethereum/node2
modules: admin:1.0 debug:1.0 engine:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
To exit, press ctrl-d or type exit
>
WARN [06-11|22:59:37.450] HTTP server graceful shutdown timed out
INFO [06-11|22:59:37.450] HTTP server stopped endpoint=127.0.0.1:8552
WARN [06-11|22:59:37.450] HTTP server graceful shutdown timed out
INFO [06-11|22:59:37.450] HTTP server stopped endpoint=127.0.0.1:8553
INFO [06-11|22:59:37.450] IPC endpoint closed url=/home/teodor/limechain/go-ethereum/node2/geth.ipc
INFO [06-11|22:59:37.450] Ethereum protocol stopped
INFO [06-11|22:59:37.450] Transaction pool stopped
INFO [06-11|22:59:37.451] Writing cached state to disk block=282 hash=d70008..0b0722 root=32c9f2..978e25
INFO [06-11|22:59:37.451] Persisted trie from memory database nodes=0 size=0.00B time="2.986µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [06-11|22:59:37.451] Writing cached state to disk block=281 hash=618ece..755341 root=bedbeb..2685bd
INFO [06-11|22:59:37.451] Persisted trie from memory database nodes=0 size=0.00B time=691ns gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [06-11|22:59:37.451] Writing cached state to disk block=155 hash=c31364..b8a83c root=d5e95e..b52108
INFO [06-11|22:59:37.451] Persisted trie from memory database nodes=0 size=0.00B time=951ns gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [06-11|22:59:37.451] Writing snapshot state to disk root=7fc800..5eb482
INFO [06-11|22:59:37.451] Persisted trie from memory database nodes=0 size=0.00B time=622ns gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [06-11|22:59:37.451] Writing clean trie cache to disk path=/home/teodor/limechain/go-ethereum/node2/geth/triecache threads=1
INFO [06-11|22:59:37.453] Persisted the clean trie cache path=/home/teodor/limechain/go-ethereum/node2/geth/triecache elapsed=1.301ms
INFO [06-11|22:59:37.453] Blockchain stopped