From 00a83c5606127c0cf6a3849a058cba5846f05bea Mon Sep 17 00:00:00 2001 From: ak Date: Fri, 1 Feb 2019 14:37:55 -0800 Subject: [PATCH] basic skeleton of beaconchain consensus --- beacon/beacon.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 beacon/beacon.go diff --git a/beacon/beacon.go b/beacon/beacon.go new file mode 100644 index 000000000..3a6b2fa7c --- /dev/null +++ b/beacon/beacon.go @@ -0,0 +1,27 @@ +package beacon + +import ( + "github.com/harmony-one/harmony/consensus" + "github.com/harmony-one/harmony/node" +) + +//References +// https://medium.com/prysmatic-labs/ethereum-2-0-development-update-20-prysmatic-labs-e42724a2ba44 +// +const ( + NumShards = 10 + BeaconChainShardNum = 0 + DepositContractAddress = 1234567 //Currently a regular address, later to be replaced by a smart contract address. + MinDepositAmount = 10 //Minimum Threshold for depositing +) + +type BeaconchainConsensus struct { + beaconconsensus *consensus.consensus //beaconchain consensus piggybacks on + waiting_nodes *node.Node[] + active_nodes *node.Node[] +} + + +func (bc *BeaconchainConsensus) UpdateWaitingNodes() { + //Interacts with blockchain/smartcontract to add new nodes +}