diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..1fd2495eb8 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch", + "type": "go", + "request": "launch", + "mode": "debug", + "remotePath": "", + "port": 2345, + "host": "127.0.0.1", + "program": "${fileDirname}", + "env": {}, + "args": [], + "showLog": true + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 9533f89b64..de96ace780 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Go Ethereum -消品链GO-thereum项目 +应链GO-thereum项目 ## 源码创建 diff --git a/cmd/abigen/abigen.exe b/cmd/abigen/abigen.exe new file mode 100644 index 0000000000..614369b436 Binary files /dev/null and b/cmd/abigen/abigen.exe differ diff --git a/cmd/geth/geth.exe b/cmd/geth/geth.exe index c670004a07..ea1d1f001f 100644 Binary files a/cmd/geth/geth.exe and b/cmd/geth/geth.exe differ diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 15947c2e0b..50316f0c90 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -39,12 +39,14 @@ import ( "gopkg.in/urfave/cli.v1" ) + const ( clientIdentifier = "geth" // Client identifier to advertise over the network ) var ( // Git SHA1 commit hash of the release (set via linker flags) + gitCommit = "" // Ethereum address of the Geth release oracle. relOracle = common.HexToAddress("0xfa7b9770ca4cb04296cac84f37736d4041251cdf") diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 55f72ee238..694ba1c9fd 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -31,6 +31,8 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/log" + set "gopkg.in/fatih/set.v0" ) @@ -38,9 +40,9 @@ import ( var ( //BlockReward *big.Int = big.NewInt(4e+18) // Block reward in wei for successfully mining a block //lockReward *big.Int = big.NewInt(2e+18) // Block reward in wei for successfully mining a block upward from Byzantium - blockReward *big.Int = big.NewInt(18e17) // Block reward in wei for successfully mining a block - XF_reward *big.Int = big.NewInt(9e17) - KY_reward *big.Int = big.NewInt(3e17) // Block reward in wei for successfully mining a block + blockReward *big.Int = big.NewInt(8e+18) // Block reward in wei for successfully mining a block + //XF_reward *big.Int = big.NewInt(9e17) + //KY_reward *big.Int = big.NewInt(3e17) // Block reward in wei for successfully mining a block //KY_blockReward *big.Int = big.NewInt(1e0) maxUncles = 2 // Maximum number of uncles allowed in a single block ) @@ -512,7 +514,7 @@ func (ethash *Ethash) VerifySeal(chain consensus.ChainReader, header *types.Head if new(big.Int).SetBytes(result).Cmp(target) > 0 { return errInvalidPoW } - //log.Info("消品链验证","区块号",header.Number, "消品权重",header.Tokentime,"封装难度",header.Difficulty) + //log.Info("应链验证","区块号",header.Number, "应链权重",header.Tokentime,"封装难度",header.Difficulty) return nil } @@ -550,30 +552,8 @@ var ( // included uncles. The coinbase of each uncle block is also rewarded. // TODO (karalabe): Move the chain maker into this package and make this private! func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header *types.Header, uncles []*types.Header) { - // Select the correct block reward based on chain progression - //blockReward := FrontierBlockReward - //if config.IsByzantium(header.Number) { - // blockReward = ByzantiumBlockReward - //} - // Accumulate the rewards for the miner and any included uncles - //reward := new(big.Int).Set(blockReward) - //r := new(big.Int) - //for _, uncle := range uncles { - // r.Add(uncle.Number, big8) - // r.Sub(r, header.Number) - // r.Mul(r, blockReward) - // r.Div(r, big8) - // state.AddBalance(uncle.Coinbase, r) - - // r.Div(blockReward, big32) - // reward.Add(reward, r) - //} - //state.AddBalance(header.Coinbase, reward) - + //挖矿成功,将1%奖励给矿池,将99%存入挖矿合约帐户 reward := new(big.Int).Set(blockReward) - //var XP_GD = common.HexToAddress("0xf933b0CF38a270938B9D6bb41f004374363C3EC0") - var XP_XF = params.XP_XF - var XP_KY = params.XP_KY r := new(big.Int) for _, uncle := range uncles { r.Add(uncle.Number, big8) @@ -585,12 +565,21 @@ func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header r.Div(blockReward, big32) reward.Add(reward, r) } - state.AddBalance(header.Coinbase, reward) - // log.Info("计算挖矿", "算力帐号:", header.Coinbase, "奖励数量", XP_blockReward, "单位", "XPing") - //state.AddBalance(XP_GD, reward) - // log.Info("投资挖矿", "股东帐号:", XP_GD, "奖励数量", XP_blockReward, "单位", "XPing") - state.AddBalance(XP_XF, XF_reward) - // log.Info("消费挖矿", "基金帐号:", XP_XF, "奖励数量", XP_blockReward, "单位", "XPing") - state.AddBalance(XP_KY, KY_reward) - // log.Info("技术挖矿", "科研帐号:", XP_KY, "奖励数量", KY_blockReward, "单位", "XPing") + TotalReward:=new(big.Int).Set(reward.Mul(reward,big.NewInt(100))) + Reward_justnum:=new(big.Int).Set(header.Number) + Reward_justnum.Div(header.Number, big.NewInt(50000000)) //计算调整系数,每隔五千万个区块减半发行 + //log.Info("参数变量","TotalReward",TotalReward,"Reward_Justnum",Reward_justnum) + TotalReward.Div(TotalReward,math.Exp(big.NewInt(2),Reward_justnum)) // reward/2**justnum + //log.Info("参数变量","TotalReward",TotalReward) + if header.Number.Cmp(big.NewInt(100))>0 { //必须在区块号100以前完成挖矿智能合约的部署。 + minerpool:=TotalReward.Div(TotalReward,big.NewInt(100)) + state.AddBalance(header.Coinbase, minerpool) + // log.Info("参数变量","minerpool",minerpool) + // reward.Sub(reward,minerpool) + state.AddBalance(params.PosMinerContractAddr, TotalReward.Mul(TotalReward,big.NewInt(99))) + log.Info("参数变量","TotalReward",TotalReward) + }else{ + state.AddBalance(header.Coinbase, TotalReward) + log.Info("参数变量","TotalReward",TotalReward) + } } diff --git a/contracts/posminer/PosmMiner.go b/contracts/posminer/PosmMiner.go new file mode 100644 index 0000000000..c25a96e120 --- /dev/null +++ b/contracts/posminer/PosmMiner.go @@ -0,0 +1,377 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package posminer + +import ( + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" +) + + + //定义POSMINER访问客户端 +var( + PosConn *ethclient.Client +) + +// PosminerABI is the input ABI used to generate the binding from. +const PosminerABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"MinerPool\",\"type\":\"address\"},{\"name\":\"RegisterFingure\",\"type\":\"string\"}],\"name\":\"MinerRegistry\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"MPools\",\"outputs\":[{\"name\":\"status\",\"type\":\"uint256\"},{\"name\":\"AppAddr\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"Manager\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"Registers\",\"outputs\":[{\"name\":\"MinerPool\",\"type\":\"address\"},{\"name\":\"RegistryTime\",\"type\":\"uint256\"},{\"name\":\"PayTime\",\"type\":\"uint256\"},{\"name\":\"Register\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"MinerPool\",\"type\":\"address\"},{\"name\":\"status\",\"type\":\"uint256\"},{\"name\":\"AppAddr\",\"type\":\"string\"}],\"name\":\"MinerPoolSetting\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ActiveUsers\",\"outputs\":[{\"name\":\"LastTime\",\"type\":\"uint256\"},{\"name\":\"ActiveNum\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"transferManagement\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]" + +// PosminerBin is the compiled bytecode used for deploying new contracts. +const PosminerBin = `{ + "linkReferences": {}, + "object": "6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a228061005e6000396000f300606060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680635b86b6c814610088578063654ca9d91461011157806378357e53146101e75780637b3d32ce1461023c578063a8bfb8c61461034c578063ccf7fd8d146103d1578063e4edf85214610401575b600080fd5b6100f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061043a565b604051808215151515815260200191505060405180910390f35b341561011c57600080fd5b610148600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061072c565b60405180838152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156101d75780601f106101ac576101008083540402835291602001916101d7565b820191906000526020600020905b8154815290600101906020018083116101ba57829003601f168201915b5050935050505060405180910390f35b34156101f257600080fd5b6101fa61074f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561024757600080fd5b610273600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610774565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018060200182810382528381815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561033a5780601f1061030f5761010080835404028352916020019161033a565b820191906000526020600020905b81548152906001019060200180831161031d57829003601f168201915b50509550505050505060405180910390f35b341561035757600080fd5b6103cf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506107c3565b005b34156103dc57600080fd5b6103e46108a1565b604051808381526020018281526020019250505060405180910390f35b341561040c57600080fd5b610438600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108b3565b005b60006001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541415156104915760009050610726565b4262015180600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201540110156105ed573373ffffffffffffffffffffffffffffffffffffffff166108fc6001600360010154013073ffffffffffffffffffffffffffffffffffffffff163181151561052457fe5b049081150290604051600060405180830381858888f19350505050151561054a57600080fd5b42600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555042620151806003600001540110156105d75760408051908101604052804281526020016001815250600360008201518160000155602082015181600101559050506105ec565b60016003600101600082825401925050819055505b5b6080604051908101604052808473ffffffffffffffffffffffffffffffffffffffff168152602001428152602001600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200183815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301908051906020019061071d929190610951565b50905050600190505b92915050565b600260205280600052604060002060009150905080600001549080600101905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201549080600301905084565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561081e57600080fd5b604080519081016040528083815260200182815250600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001019080519060200190610898929190610951565b50905050505050565b60038060000154908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561090e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061099257805160ff19168380011785556109c0565b828001600101855582156109c0579182015b828111156109bf5782518255916020019190600101906109a4565b5b5090506109cd91906109d1565b5090565b6109f391905b808211156109ef5760008160009055506001016109d7565b5090565b905600a165627a7a72305820325342257ec0d1a0612a67caf8a6c7f3f3042f95625e591222db3fafdf8e0f900029", + "opcodes": "PUSH1 0x60 PUSH1 0x40 MSTORE CALLVALUE ISZERO PUSH2 0xF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0xA22 DUP1 PUSH2 0x5E PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x60 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x83 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x5B86B6C8 EQ PUSH2 0x88 JUMPI DUP1 PUSH4 0x654CA9D9 EQ PUSH2 0x111 JUMPI DUP1 PUSH4 0x78357E53 EQ PUSH2 0x1E7 JUMPI DUP1 PUSH4 0x7B3D32CE EQ PUSH2 0x23C JUMPI DUP1 PUSH4 0xA8BFB8C6 EQ PUSH2 0x34C JUMPI DUP1 PUSH4 0xCCF7FD8D EQ PUSH2 0x3D1 JUMPI DUP1 PUSH4 0xE4EDF852 EQ PUSH2 0x401 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xF7 PUSH1 0x4 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP1 POP POP PUSH2 0x43A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x11C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x148 PUSH1 0x4 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP2 SWAP1 POP POP PUSH2 0x72C JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x1D7 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1AC JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1D7 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1BA JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP4 POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x1F2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x1FA PUSH2 0x74F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x247 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x273 PUSH1 0x4 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP2 SWAP1 POP POP PUSH2 0x774 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x33A JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x30F JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x33A JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x31D JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP SWAP6 POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x357 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x3CF PUSH1 0x4 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP3 ADD DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY DUP3 ADD SWAP2 POP POP POP POP POP POP SWAP2 SWAP1 POP POP PUSH2 0x7C3 JUMP JUMPDEST STOP JUMPDEST CALLVALUE ISZERO PUSH2 0x3DC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x3E4 PUSH2 0x8A1 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE ISZERO PUSH2 0x40C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x438 PUSH1 0x4 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP2 SWAP1 POP POP PUSH2 0x8B3 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 ADD SLOAD EQ ISZERO ISZERO PUSH2 0x491 JUMPI PUSH1 0x0 SWAP1 POP PUSH2 0x726 JUMP JUMPDEST TIMESTAMP PUSH3 0x15180 PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x2 ADD SLOAD ADD LT ISZERO PUSH2 0x5ED JUMPI CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH2 0x8FC PUSH1 0x1 PUSH1 0x3 PUSH1 0x1 ADD SLOAD ADD ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND BALANCE DUP2 ISZERO ISZERO PUSH2 0x524 JUMPI INVALID JUMPDEST DIV SWAP1 DUP2 ISZERO MUL SWAP1 PUSH1 0x40 MLOAD PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP9 DUP9 CALL SWAP4 POP POP POP POP ISZERO ISZERO PUSH2 0x54A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST TIMESTAMP PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x2 ADD DUP2 SWAP1 SSTORE POP TIMESTAMP PUSH3 0x15180 PUSH1 0x3 PUSH1 0x0 ADD SLOAD ADD LT ISZERO PUSH2 0x5D7 JUMPI PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 TIMESTAMP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 DUP2 MSTORE POP PUSH1 0x3 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD SSTORE PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE SWAP1 POP POP PUSH2 0x5EC JUMP JUMPDEST PUSH1 0x1 PUSH1 0x3 PUSH1 0x1 ADD PUSH1 0x0 DUP3 DUP3 SLOAD ADD SWAP3 POP POP DUP2 SWAP1 SSTORE POP JUMPDEST JUMPDEST PUSH1 0x80 PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP5 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD TIMESTAMP DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x2 ADD SLOAD DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 MSTORE POP PUSH1 0x1 PUSH1 0x0 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE PUSH1 0x40 DUP3 ADD MLOAD DUP2 PUSH1 0x2 ADD SSTORE PUSH1 0x60 DUP3 ADD MLOAD DUP2 PUSH1 0x3 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x71D SWAP3 SWAP2 SWAP1 PUSH2 0x951 JUMP JUMPDEST POP SWAP1 POP POP PUSH1 0x1 SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x2 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD SLOAD SWAP1 DUP1 PUSH1 0x1 ADD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 DUP1 PUSH1 0x2 ADD SLOAD SWAP1 DUP1 PUSH1 0x3 ADD SWAP1 POP DUP5 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x81E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 DUP4 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP2 MSTORE POP PUSH1 0x2 PUSH1 0x0 DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD SSTORE PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x898 SWAP3 SWAP2 SWAP1 PUSH2 0x951 JUMP JUMPDEST POP SWAP1 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x3 DUP1 PUSH1 0x0 ADD SLOAD SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO ISZERO PUSH2 0x90E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x992 JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x9C0 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x9C0 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x9BF JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x9A4 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x9CD SWAP2 SWAP1 PUSH2 0x9D1 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x9F3 SWAP2 SWAP1 JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x9EF JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x9D7 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 ORIGIN MSTORE8 TIMESTAMP 0x25 PUSH31 0xC0D1A0612A67CAF8A6C7F3F3042F95625E591222DB3FAFDF8E0F9000290000 ", + "sourceMap": "28:2509:0:-;;;844:69;;;;;;;;894:10;886:7;;:18;;;;;;;;;;;;;;;;;;28:2509;;;;;;" +}` + +// DeployPosminer deploys a new Ethereum contract, binding an instance of Posminer to it. +func DeployPosminer(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Posminer, error) { + parsed, err := abi.JSON(strings.NewReader(PosminerABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(PosminerBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Posminer{PosminerCaller: PosminerCaller{contract: contract}, PosminerTransactor: PosminerTransactor{contract: contract}}, nil +} + +// Posminer is an auto generated Go binding around an Ethereum contract. +type Posminer struct { + PosminerCaller // Read-only binding to the contract + PosminerTransactor // Write-only binding to the contract +} + +// PosminerCaller is an auto generated read-only Go binding around an Ethereum contract. +type PosminerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PosminerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type PosminerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PosminerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type PosminerSession struct { + Contract *Posminer // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PosminerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type PosminerCallerSession struct { + Contract *PosminerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// PosminerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type PosminerTransactorSession struct { + Contract *PosminerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PosminerRaw is an auto generated low-level Go binding around an Ethereum contract. +type PosminerRaw struct { + Contract *Posminer // Generic contract binding to access the raw methods on +} + +// PosminerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type PosminerCallerRaw struct { + Contract *PosminerCaller // Generic read-only contract binding to access the raw methods on +} + +// PosminerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type PosminerTransactorRaw struct { + Contract *PosminerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewPosminer creates a new instance of Posminer, bound to a specific deployed contract. +func NewPosminer(address common.Address, backend bind.ContractBackend) (*Posminer, error) { + contract, err := bindPosminer(address, backend, backend) + if err != nil { + return nil, err + } + return &Posminer{PosminerCaller: PosminerCaller{contract: contract}, PosminerTransactor: PosminerTransactor{contract: contract}}, nil +} + +// NewPosminerCaller creates a new read-only instance of Posminer, bound to a specific deployed contract. +func NewPosminerCaller(address common.Address, caller bind.ContractCaller) (*PosminerCaller, error) { + contract, err := bindPosminer(address, caller, nil) + if err != nil { + return nil, err + } + return &PosminerCaller{contract: contract}, nil +} + +// NewPosminerTransactor creates a new write-only instance of Posminer, bound to a specific deployed contract. +func NewPosminerTransactor(address common.Address, transactor bind.ContractTransactor) (*PosminerTransactor, error) { + contract, err := bindPosminer(address, nil, transactor) + if err != nil { + return nil, err + } + return &PosminerTransactor{contract: contract}, nil +} + +// bindPosminer binds a generic wrapper to an already deployed contract. +func bindPosminer(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(PosminerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Posminer *PosminerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Posminer.Contract.PosminerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Posminer *PosminerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Posminer.Contract.PosminerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Posminer *PosminerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Posminer.Contract.PosminerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Posminer *PosminerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Posminer.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Posminer *PosminerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Posminer.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Posminer *PosminerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Posminer.Contract.contract.Transact(opts, method, params...) +} + +// ActiveUsers is a free data retrieval call binding the contract method 0xccf7fd8d. +// +// Solidity: function ActiveUsers() constant returns(LastTime uint256, ActiveNum uint256) +func (_Posminer *PosminerCaller) ActiveUsers(opts *bind.CallOpts) (struct { + LastTime *big.Int + ActiveNum *big.Int +}, error) { + ret := new(struct { + LastTime *big.Int + ActiveNum *big.Int + }) + out := ret + err := _Posminer.contract.Call(opts, out, "ActiveUsers") + return *ret, err +} + +// ActiveUsers is a free data retrieval call binding the contract method 0xccf7fd8d. +// +// Solidity: function ActiveUsers() constant returns(LastTime uint256, ActiveNum uint256) +func (_Posminer *PosminerSession) ActiveUsers() (struct { + LastTime *big.Int + ActiveNum *big.Int +}, error) { + return _Posminer.Contract.ActiveUsers(&_Posminer.CallOpts) +} + +// ActiveUsers is a free data retrieval call binding the contract method 0xccf7fd8d. +// +// Solidity: function ActiveUsers() constant returns(LastTime uint256, ActiveNum uint256) +func (_Posminer *PosminerCallerSession) ActiveUsers() (struct { + LastTime *big.Int + ActiveNum *big.Int +}, error) { + return _Posminer.Contract.ActiveUsers(&_Posminer.CallOpts) +} + +// MPools is a free data retrieval call binding the contract method 0x654ca9d9. +// +// Solidity: function MPools( address) constant returns(status uint256, AppAddr string) +func (_Posminer *PosminerCaller) MPools(opts *bind.CallOpts, arg0 common.Address) (struct { + Status *big.Int + AppAddr string +}, error) { + ret := new(struct { + Status *big.Int + AppAddr string + }) + out := ret + err := _Posminer.contract.Call(opts, out, "MPools", arg0) + return *ret, err +} + +// MPools is a free data retrieval call binding the contract method 0x654ca9d9. +// +// Solidity: function MPools( address) constant returns(status uint256, AppAddr string) +func (_Posminer *PosminerSession) MPools(arg0 common.Address) (struct { + Status *big.Int + AppAddr string +}, error) { + return _Posminer.Contract.MPools(&_Posminer.CallOpts, arg0) +} + +// MPools is a free data retrieval call binding the contract method 0x654ca9d9. +// +// Solidity: function MPools( address) constant returns(status uint256, AppAddr string) +func (_Posminer *PosminerCallerSession) MPools(arg0 common.Address) (struct { + Status *big.Int + AppAddr string +}, error) { + return _Posminer.Contract.MPools(&_Posminer.CallOpts, arg0) +} + +// Manager is a free data retrieval call binding the contract method 0x78357e53. +// +// Solidity: function Manager() constant returns(address) +func (_Posminer *PosminerCaller) Manager(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _Posminer.contract.Call(opts, out, "Manager") + return *ret0, err +} + +// Manager is a free data retrieval call binding the contract method 0x78357e53. +// +// Solidity: function Manager() constant returns(address) +func (_Posminer *PosminerSession) Manager() (common.Address, error) { + return _Posminer.Contract.Manager(&_Posminer.CallOpts) +} + +// Manager is a free data retrieval call binding the contract method 0x78357e53. +// +// Solidity: function Manager() constant returns(address) +func (_Posminer *PosminerCallerSession) Manager() (common.Address, error) { + return _Posminer.Contract.Manager(&_Posminer.CallOpts) +} + +// Registers is a free data retrieval call binding the contract method 0x7b3d32ce. +// +// Solidity: function Registers( address) constant returns(MinerPool address, RegistryTime uint256, PayTime uint256, Register string) +func (_Posminer *PosminerCaller) Registers(opts *bind.CallOpts, arg0 common.Address) (struct { + MinerPool common.Address + RegistryTime *big.Int + PayTime *big.Int + Register string +}, error) { + ret := new(struct { + MinerPool common.Address + RegistryTime *big.Int + PayTime *big.Int + Register string + }) + out := ret + err := _Posminer.contract.Call(opts, out, "Registers", arg0) + return *ret, err +} + +// Registers is a free data retrieval call binding the contract method 0x7b3d32ce. +// +// Solidity: function Registers( address) constant returns(MinerPool address, RegistryTime uint256, PayTime uint256, Register string) +func (_Posminer *PosminerSession) Registers(arg0 common.Address) (struct { + MinerPool common.Address + RegistryTime *big.Int + PayTime *big.Int + Register string +}, error) { + return _Posminer.Contract.Registers(&_Posminer.CallOpts, arg0) +} + +// Registers is a free data retrieval call binding the contract method 0x7b3d32ce. +// +// Solidity: function Registers( address) constant returns(MinerPool address, RegistryTime uint256, PayTime uint256, Register string) +func (_Posminer *PosminerCallerSession) Registers(arg0 common.Address) (struct { + MinerPool common.Address + RegistryTime *big.Int + PayTime *big.Int + Register string +}, error) { + return _Posminer.Contract.Registers(&_Posminer.CallOpts, arg0) +} + +// MinerPoolSetting is a paid mutator transaction binding the contract method 0xa8bfb8c6. +// +// Solidity: function MinerPoolSetting(MinerPool address, status uint256, AppAddr string) returns() +func (_Posminer *PosminerTransactor) MinerPoolSetting(opts *bind.TransactOpts, MinerPool common.Address, status *big.Int, AppAddr string) (*types.Transaction, error) { + return _Posminer.contract.Transact(opts, "MinerPoolSetting", MinerPool, status, AppAddr) +} + +// MinerPoolSetting is a paid mutator transaction binding the contract method 0xa8bfb8c6. +// +// Solidity: function MinerPoolSetting(MinerPool address, status uint256, AppAddr string) returns() +func (_Posminer *PosminerSession) MinerPoolSetting(MinerPool common.Address, status *big.Int, AppAddr string) (*types.Transaction, error) { + return _Posminer.Contract.MinerPoolSetting(&_Posminer.TransactOpts, MinerPool, status, AppAddr) +} + +// MinerPoolSetting is a paid mutator transaction binding the contract method 0xa8bfb8c6. +// +// Solidity: function MinerPoolSetting(MinerPool address, status uint256, AppAddr string) returns() +func (_Posminer *PosminerTransactorSession) MinerPoolSetting(MinerPool common.Address, status *big.Int, AppAddr string) (*types.Transaction, error) { + return _Posminer.Contract.MinerPoolSetting(&_Posminer.TransactOpts, MinerPool, status, AppAddr) +} + +// MinerRegistry is a paid mutator transaction binding the contract method 0x5b86b6c8. +// +// Solidity: function MinerRegistry(MinerPool address, RegisterFingure string) returns(success bool) +func (_Posminer *PosminerTransactor) MinerRegistry(opts *bind.TransactOpts, MinerPool common.Address, RegisterFingure string) (*types.Transaction, error) { + return _Posminer.contract.Transact(opts, "MinerRegistry", MinerPool, RegisterFingure) +} + +// MinerRegistry is a paid mutator transaction binding the contract method 0x5b86b6c8. +// +// Solidity: function MinerRegistry(MinerPool address, RegisterFingure string) returns(success bool) +func (_Posminer *PosminerSession) MinerRegistry(MinerPool common.Address, RegisterFingure string) (*types.Transaction, error) { + return _Posminer.Contract.MinerRegistry(&_Posminer.TransactOpts, MinerPool, RegisterFingure) +} + +// MinerRegistry is a paid mutator transaction binding the contract method 0x5b86b6c8. +// +// Solidity: function MinerRegistry(MinerPool address, RegisterFingure string) returns(success bool) +func (_Posminer *PosminerTransactorSession) MinerRegistry(MinerPool common.Address, RegisterFingure string) (*types.Transaction, error) { + return _Posminer.Contract.MinerRegistry(&_Posminer.TransactOpts, MinerPool, RegisterFingure) +} + +// TransferManagement is a paid mutator transaction binding the contract method 0xe4edf852. +// +// Solidity: function transferManagement(newManager address) returns() +func (_Posminer *PosminerTransactor) TransferManagement(opts *bind.TransactOpts, newManager common.Address) (*types.Transaction, error) { + return _Posminer.contract.Transact(opts, "transferManagement", newManager) +} + +// TransferManagement is a paid mutator transaction binding the contract method 0xe4edf852. +// +// Solidity: function transferManagement(newManager address) returns() +func (_Posminer *PosminerSession) TransferManagement(newManager common.Address) (*types.Transaction, error) { + return _Posminer.Contract.TransferManagement(&_Posminer.TransactOpts, newManager) +} + +// TransferManagement is a paid mutator transaction binding the contract method 0xe4edf852. +// +// Solidity: function transferManagement(newManager address) returns() +func (_Posminer *PosminerTransactorSession) TransferManagement(newManager common.Address) (*types.Transaction, error) { + return _Posminer.Contract.TransferManagement(&_Posminer.TransactOpts, newManager) +} diff --git a/core/blockchain.go b/core/blockchain.go index e32d8506aa..b595c7e7ec 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -42,6 +42,9 @@ import ( "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/contracts/posminer" + "github.com/ethereum/go-ethereum/ethclient" + ) var ( @@ -606,7 +609,7 @@ func (bc *BlockChain) Stop() { atomic.StoreInt32(&bc.procInterrupt, 1) bc.wg.Wait() - log.Info("消品链管理器停止工作") + log.Info("应链管理器停止工作") } func (bc *BlockChain) procFutureBlocks() { @@ -854,20 +857,66 @@ func (bc *BlockChain) WriteBlockAndState(block *types.Block, receipts []*types.R return status, nil } -//计算币龄的函数,根据收币数量与时间计算当前币量的币龄,传入参数:待计算地址及起始时间 +//统计移动应用权重帐户的用户权重 func (bc *BlockChain) CalcTokenTime(Coinbase common.Address) (Tokentime *big.Int) { //var sumToken *big.Int = big.NewInt(0) //var Tokentime *big.Int = big.NewInt(0) - statedb, _ := state.New(bc.GetBlockByHash(bc.currentBlock.Hash()).Root(), bc.stateCache) - - //bc, _ := - //log.Error("所查帐号的余额为", "ETHER", statedb.GetBalance(common.HexToAddress("0x3656E9cE021f6454906687FF615915235f8E510f"))) - //取出待查币龄值帐号的帐户余额 - Tokentime = statedb.GetBalance(Coinbase) - Tokentime.Div(Tokentime, new(big.Int).Mul(big.NewInt(1), big.NewInt(1e18))) + var exist bool + exist=false + Tokentime=big.NewInt(0) + var ActiveMiners []common.Address + State,_:=bc.State() + if State.Exist(params.PosMinerContractAddr)!=true{ + //log.Info("警告","RPC未使能",Tokentime) + return Tokentime + } + //log.Info("posminer.PosConn",posminer.PosConn) + if posminer.PosConn==nil { + posminer.PosConn, _ = ethclient.Dial("//./pipe/geth.ipc") + log.Info("AppChain连接", "连接IPC服务") + } + //if err != nil { + // log.Info("警告", "设置了ipcdisable,不能使用权重挖矿!",err) + // return Tokentime + //} + PosMiner, err := posminer.NewPosminer(params.PosMinerContractAddr, posminer.PosConn) + //log.Info("错误码","err",err,"PosMiner",PosMiner) + if err !=nil{ + log.Info("调用挖矿智能合约posminer失败","错误",err) + return Tokentime + } + //M,err:=PosMiner.RegLength(nil) + for i:=uint64(0);i0 &&CmpMiner.MinerPool==Coinbase { + for j:=0;j 0 { context = append(context, []interface{}{"忽略", st.ignored}...) } - log.Info("导入消品新链块", context...) + log.Info("导入应链新区块", context...) *st = insertStats{startTime: now, lastIndex: index + 1} } @@ -1270,7 +1314,7 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e receiptString += fmt.Sprintf("\t%v\n", receipt) } log.Error(fmt.Sprintf(` -########## 不符合消品链规则的区块 ######### +########## 不符合应链规则的区块 ######### 区块链配置: %v 区块编号: %v diff --git a/core/chain_indexer.go b/core/chain_indexer.go index a342a74ab1..60c5440ae3 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -279,7 +279,7 @@ func (c *ChainIndexer) updateLoop() { if time.Since(updated) > 8*time.Second { if c.knownSections > c.storedSections+1 { updating = true - c.log.Info("更新消品链索引", "百分比", c.storedSections*100/c.knownSections) + c.log.Info("更新应链索引", "百分比", c.storedSections*100/c.knownSections) } updated = time.Now() } @@ -303,7 +303,7 @@ func (c *ChainIndexer) updateLoop() { c.setValidSections(section + 1) if c.storedSections == c.knownSections && updating { updating = false - c.log.Info("完成消品链索引更新") + c.log.Info("完成应链索引更新") } c.cascadedHead = c.storedSections*c.sectionSize - 1 diff --git a/core/state_transition.go b/core/state_transition.go index 200aea3cc5..40215f67d5 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -212,8 +212,8 @@ func (st *StateTransition) preCheck() error { func (st *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *big.Int, failed bool, err error) { // var XP_GD = common.HexToAddress("0xf933b0CF38a270938B9D6bb41f004374363C3EC0") - var XP_XF = params.XP_XF - var XP_KY = params.XP_KY + //var XP_XF = params.XP_XF + //var XP_KY = params.XP_KY if err = st.preCheck(); err != nil { @@ -261,20 +261,18 @@ func (st *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *big requiredGas = new(big.Int).Set(st.gasUsed()) st.refundGas() - // 在算力、股东、消费、科研帐户之间分配交易费。 - XP_gas := new(big.Int).Mul(st.gasUsed(), st.gasPrice) - XP_KYgas := new(big.Int).Div(XP_gas, big.NewInt(10)) - XP_Minergas := new(big.Int).Mul(XP_KYgas, big.NewInt(6)) - XP_XFgas := new(big.Int).Mul(XP_KYgas, big.NewInt(3)) - st.state.AddBalance(st.evm.Coinbase, XP_Minergas) //为算力帐户支付交易费的60% - //st.state.AddBalance(XP_GD, XP_GDgas) //为股东帐户支付交易费30% - st.state.AddBalance(XP_XF, XP_XFgas) //为消费帐户支付交易费的30% - st.state.AddBalance(XP_KY, XP_KYgas) //为科研帐户支付交易费的10% - - + Total_gas := new(big.Int).Mul(st.gasUsed(), st.gasPrice) + //检查合约帐号是否存在 + if st.evm.BlockNumber.Cmp(big.NewInt(100))>0 { //必须在区块号100以前完成挖矿智能合约的部署。 + MinerPool_gas := new(big.Int).Div(Total_gas, big.NewInt(100)) //计算总交易费的1%; + Miners_gas := new(big.Int).Mul(MinerPool_gas, big.NewInt(99)) //计算总交易费的99% + st.state.AddBalance(st.evm.Coinbase, MinerPool_gas) //为矿池帐户支付交易费的1% + st.state.AddBalance(params.PosMinerContractAddr, Miners_gas)//将交易费的99%存入挖矿合约帐号 + }else { + st.state.AddBalance(st.evm.Coinbase, Total_gas) //矿池合约未建立,全部支付给矿工。 + } //st.state.AddBalance(st.evm.Coinbase, new(big.Int).Mul(st.gasUsed(), st.gasPrice)) - return ret, requiredGas, st.gasUsed(), vmerr != nil, err } diff --git a/eth/backend.go b/eth/backend.go index 8b434a3560..3d18470de8 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -117,7 +117,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { if _, ok := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !ok { return nil, genesisErr } - log.Info("初始化消品链配置", "配置", chainConfig) + log.Info("初始化应链配置", "配置", chainConfig) eth := &Ethereum{ config: config, @@ -135,7 +135,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { bloomIndexer: NewBloomIndexer(chainDb, params.BloomBitsBlocks), } - log.Info("初始化消品链协议", "版本号", ProtocolVersions, "网络", config.NetworkId) + log.Info("初始化应链协议", "版本号", ProtocolVersions, "网络", config.NetworkId) if !config.SkipBcVersionCheck { bcVersion := core.GetBlockChainVersion(chainDb) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index fb848a20d9..f97ac4d98a 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -598,10 +598,12 @@ func (d *Downloader) fetchHeight(p *peerConnection) (*types.Header, error) { // on the correct chain, checking the top N links should already get us a match. // In the rare scenario when we ended up on a long reorganisation (i.e. none of // the head links match), we do a binary search to find the common ancestor. +//此处检查远端同步节点与本地区块链的匹配,一般情况下,节点处于同步状态并处于正确的链上,只需检查 +//最上面的N个链接就可区得一个匹配。如果未能找到匹配,说明本地节点与远端节点之间已处于分叉,并且时间较 +//久,此时,仅同删除数据,重新同步。 func (d *Downloader) findAncestor(p *peerConnection, height uint64) (uint64, error) { // Figure out the valid ancestor range to prevent rewrite attacks floor, ceil := int64(-1), d.lightchain.CurrentHeader().Number.Uint64() - p.log.Debug("Looking for common ancestor", "local", ceil, "remote", height) if d.mode == FullSync { ceil = d.blockchain.CurrentBlock().NumberU64() @@ -620,7 +622,7 @@ func (d *Downloader) findAncestor(p *peerConnection, height uint64) (uint64, err if from < 0 { from = 0 } - // Span out with 15 block gaps into the future to catch bad head reports +// Span out with 15 block gaps into the future to catch bad head reports limit := 2 * MaxHeaderFetch / 16 count := 1 + int((int64(ceil)-from)/16) if count > limit { @@ -630,7 +632,6 @@ func (d *Downloader) findAncestor(p *peerConnection, height uint64) (uint64, err // Wait for the remote response to the head fetch number, hash := uint64(0), common.Hash{} - ttl := d.requestTTL() timeout := time.After(ttl) diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index a4aa861146..95259bd258 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -32,7 +32,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" -) + ) const ( maxLackingHashes = 4096 // Maximum number of entries allowed on the list or lacking items diff --git a/eth/handler.go b/eth/handler.go index 7eeded00d4..4347dde89e 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -116,7 +116,7 @@ func NewProtocolManager(config *params.ChainConfig, mode downloader.SyncMode, ne } // Figure out whether to allow fast sync or not if mode == downloader.FastSync && blockchain.CurrentBlock().NumberU64() > 0 { - log.Warn("消品链非空, 快速同步失效") + log.Warn("应链非空, 快速同步失效") mode = downloader.FullSync } if mode == downloader.FastSync { diff --git a/genesis.json b/genesis.json index 1a4b5fc4ca..60b72e4135 100644 --- a/genesis.json +++ b/genesis.json @@ -1,6 +1,6 @@ { "config": { - "chainId": 20180101, + "chainId": 20180401, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 @@ -15,7 +15,7 @@ "gasLimit": "0x8000000", "alloc": { "0xf933b0cf38a270938b9d6bb41f004374363c3ec0": - { "balance": "100000000000000000000000000" } + { "balance": "8000000000000000000000000000" } } } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 025f426177..2d542b39b5 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -45,7 +45,8 @@ import ( const ( defaultGas = 90000 - defaultGasPrice = 50 * params.Shannon + //defaultGasPrice = 50 * params.Shannon + defaultGasPrice = 5000 * params.Shannon //此处增加100倍 ) // PublicEthereumAPI provides an API to access Ethereum related information. @@ -1117,7 +1118,7 @@ func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c addr := crypto.CreateAddress(from, tx.Nonce()) log.Info("Submitted contract creation", "fullhash", tx.Hash().Hex(), "contract", addr.Hex()) } else { - log.Info("Submitted transaction", "fullhash", tx.Hash().Hex(), "recipient", tx.To()) + log.Info("提交交易", "交易哈希码", tx.Hash().Hex(), "目标帐号", tx.To()) } return tx.Hash(), nil } diff --git a/les/backend.go b/les/backend.go index cdc6b60638..b5124fb846 100644 --- a/les/backend.go +++ b/les/backend.go @@ -86,7 +86,7 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) { if _, isCompat := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !isCompat { return nil, genesisErr } - log.Info("初始化消品链配置", "配置", chainConfig) + log.Info("初始化应链配置", "配置", chainConfig) peers := newPeerSet() quitSync := make(chan struct{}) diff --git a/light/lightchain.go b/light/lightchain.go index e3afa22cad..12194a069b 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -313,7 +313,7 @@ func (bc *LightChain) Stop() { atomic.StoreInt32(&bc.procInterrupt, 1) bc.wg.Wait() - log.Info("消品链管理器停止工作") + log.Info("应链管理器停止工作") } // Rollback is designed to remove a chain of links from the database that aren't diff --git a/miner/agent.go b/miner/agent.go index 4f0ea78e91..1b26e7f394 100644 --- a/miner/agent.go +++ b/miner/agent.go @@ -101,7 +101,7 @@ out: func (self *CpuAgent) mine(work *Work, stop <-chan struct{}) { if result, err := self.engine.Seal(self.chain, work.Block, stop); result != nil { - log.Info("新区块封装成功", "区块号", result.Number(), "哈希码", result.Hash()) + log.Info("成功封装一个新的区块", "区块号", result.Number(), "哈希码", result.Hash()) self.returnCh <- &Result{work, result} } else { if err != nil { diff --git a/miner/unconfirmed.go b/miner/unconfirmed.go index eea6f6edbb..40dd0d8b7e 100644 --- a/miner/unconfirmed.go +++ b/miner/unconfirmed.go @@ -101,9 +101,9 @@ func (set *unconfirmedBlocks) Shift(height uint64) { case header == nil: log.Warn("检索已挖矿块头失败", "区块号", next.index, "哈希码", next.hash) case header.Hash() == next.hash: - log.Info("🔗 区块已成功编入消品链", "区块号", next.index, "哈希码", next.hash) + log.Info("🔗 区块已编入应链主链", "区块号", next.index, "哈希码", next.hash) default: - log.Info("⑂ 区块未能编入消品链", "区块号", next.index, "哈希码", next.hash) + log.Info("⑂ 区块未编入应链主链", "区块号", next.index, "哈希码", next.hash) } // Drop the block out of the ring if set.blocks.Value == set.blocks.Next().Value { diff --git a/miner/worker.go b/miner/worker.go index ef09e2a860..9fd660843a 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -311,7 +311,7 @@ func (self *worker) wait() { } stat, err := self.chain.WriteBlockAndState(block, work.receipts, work.state) if err != nil { - log.Error("区块写入消品链失败", "错误", err) + log.Error("区块写入应链失败", "错误", err) continue } // check if canon block and write transactions @@ -488,7 +488,7 @@ func (self *worker) commitNewWork() { } // We only care about logging if we're actually mining. if atomic.LoadInt32(&self.mining) == 1 { - log.Info("执行新的挖矿任务", "区块号", work.Block.Number(), "消品权重", header.Tokentime,"交易数", work.tcount, "叔块", len(uncles), "耗时", common.PrettyDuration(time.Since(tstart))) + log.Info("开始新的挖矿任务", "区块号", work.Block.Number(), "挖矿权重", header.Tokentime,"交易数", work.tcount, "叔块", len(uncles), "耗时", common.PrettyDuration(time.Since(tstart))) self.unconfirmed.Shift(work.Block.NumberU64() - 1) } self.push(work) diff --git a/node/node.go b/node/node.go index 5af9cf515a..25ad4a9f38 100644 --- a/node/node.go +++ b/node/node.go @@ -163,7 +163,7 @@ func (n *Node) Start() error { n.serverConfig.NodeDatabase = n.config.NodeDB() } running := &p2p.Server{Config: n.serverConfig} - n.log.Info("启动消品链P2P节点", "instance", n.serverConfig.Name) + n.log.Info("启动应链P2P节点", "instance", n.serverConfig.Name) // Otherwise copy and specialize the P2P configuration services := make(map[reflect.Type]Service) @@ -314,6 +314,7 @@ func (n *Node) startIPC(apis []rpc.API) error { return err } n.log.Debug(fmt.Sprintf("IPC registered %T under '%s'", api.Service, api.Namespace)) + //log.Info("RPCAPI",api) } // All APIs registered, start the IPC listener var ( @@ -340,7 +341,8 @@ func (n *Node) startIPC(apis []rpc.API) error { n.log.Error(fmt.Sprintf("IPC accept failed: %v", err)) continue } - go handler.ServeCodec(rpc.NewJSONCodec(conn), rpc.OptionMethodInvocation|rpc.OptionSubscriptions) + go handler.ServeCodec(rpc.NewJSONCodec(conn), rpc.OptionMethodInvocation|rpc.OptionSubscriptions) + // log.Info("服务端接收新的COMM",conn) } }() // All listeners booted successfully diff --git a/p2p/server.go b/p2p/server.go index 401b49d912..42be71ff8a 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -367,7 +367,7 @@ func (srv *Server) Start() (err error) { if srv.log == nil { srv.log = log.New() } - srv.log.Info("启动消品链P2P网络") + srv.log.Info("启动应链P2P网络") // static fields if srv.PrivateKey == nil { diff --git a/params/config.go b/params/config.go index 63d5dacb73..8b9aaf3fa6 100644 --- a/params/config.go +++ b/params/config.go @@ -27,11 +27,11 @@ var ( MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") // Mainnet genesis hash to enforce below configs on TestnetGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") // Testnet genesis hash to enforce below configs on ) +//POSMINER相关定义 var ( - XP_XF = common.HexToAddress ("0xeD867421dabc9dC2785E54411497ae2327f28dfe") - XP_KY = common.HexToAddress("0x52F1433De32f47D9611CA50aF34b7965aE038f91") + PosMinerContractAddr = common.HexToAddress ("0x8C00B660792b235d4382368299E77C8c04ED4754") //POSMINER合约地址 ) - + var ( // MainnetChainConfig is the chain parameters to run a node on the main network. MainnetChainConfig = &ChainConfig{ diff --git a/params/protocol_params.go b/params/protocol_params.go index b7da63b685..f1e4b6bcc3 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -76,8 +76,8 @@ var ( MinGasLimit = big.NewInt(5000) // Minimum the gas limit may ever be. GenesisGasLimit = big.NewInt(4712388) // Gas limit of the Genesis block. TargetGasLimit = new(big.Int).Set(GenesisGasLimit) // The artificial target - DifficultyBoundDivisor = big.NewInt(256) //big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. - GenesisDifficulty = big.NewInt(13107200) // 此处增加100倍Difficulty of the Genesis block. - MinimumDifficulty = big.NewInt(13107200) // 此处增加100倍The minimum that the difficulty may ever be. + DifficultyBoundDivisor = big.NewInt(512) //big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. + GenesisDifficulty = big.NewInt(1310720) // 此处增加100倍Difficulty of the Genesis block. + MinimumDifficulty = big.NewInt(1310720) // 此处增加100倍The minimum that the difficulty may ever be. DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. ) diff --git a/params/version.go b/params/version.go index c081c17e79..c8cead3668 100644 --- a/params/version.go +++ b/params/version.go @@ -22,9 +22,9 @@ import ( const ( VersionMajor = 1 // Major version component of the current release - VersionMinor = 8 // Minor version component of the current release + VersionMinor = 0 // Minor version component of the current release VersionPatch = 0 // Patch version component of the current release - VersionMeta = "shopok" // Version metadata to append to the version string + VersionMeta = "AppChain" // Version metadata to append to the version string ) // Version holds the textual version string.