Skip to content

Commit

Permalink
Feature/v1.1.0 (#1154)
Browse files Browse the repository at this point in the history
* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Reduced wait for block completion to 1 second (#984)

* changed tolerance flag type to uint32 (#983)

* Removed ethBalanceCheck (#982)

* Moved constant values to constants.go (#987)

* moved gasLimitMultiplier as constant in constants.go

* Moved path.go strings to constants.go

* Replaced common.Hash{0x00} with core.NilHash

* Update geth version to v1.10.25 and updated depreciated bindings (#985)

* Updated geth version

* Updated depriciated bindings

* updated go.sum to fix tests

* Replaced errors package

* Validate contract calls (Changes from v1-audit) (#981)

* Added retry mechanism for fetchBalance

* Added ETA for unlockWithdraw

* Added check of staker is slashed for stake

* Added valid ERC20 check for addresses

* Changed name from IsValidErc20Address to IsValidAddress

* Functions Refactor (#989)

* changed state name to Buffer instead of -1

* CalculateBlockNumberAtEpochBeginning cleanup

* Renamed functions in array.go

* ApproveUnstake sends StakerTokenAddress instead of StakerStruct

* Returned error from getMerkleTree()

* Returned error from getMerkleRoot()

* Removed unused functions

* Added tree is nil condition in GetMerkleRoot()

* fixed BenchmarkGenerateTreeRevealData

* Code CleanUp (Issues from v1-audit) (#990)

* Renamed getDelayedState to getBufferedState

* remove uint64 from block time

* Renamed handleRevealState to CheckForLastCommitted

* CalculateBlockNumberAtEpochBeginning renamed to EstimateBlockNumberAtEpochBeginning

* Renamed claimStakeReward to ClaimStakerReward

* Renamed GetStatesAllowed to GetFormattedStateNames

* GetSalt clean up

* changed int64 to uint64 in constants

* Used block.Time directly instead of blockTime variable

* Txn hash made consistent in logging

* remove redundant uint64 typecast from GetEpoch()

* Rename coinContract to erc20contract

* Updated mocks after renaming coinContract to erc20Contract

* Removed redundant code in logger.go

* Removed space from xhtml job result (#991)

* Log changes from v1-audit (#994)

* Renamed eth balance to sFuel balance

* used log.Info instead of fmt.Println for contractAddresses

* Added do not mopdify note in constants.go

* Added a warning for low ethBalance

* replaced path.join with filepath.join (#992)

* Removed redundant cmd/utilsInterface (#997)

* Removed UtilsInterface in cmd package

* Compilation successful for tests

* replaced utils.UtilsInterface with razorUtils

* Included CheckAmountAndBalance in utils/utilsInterface

* Fixed tests

* Fixed benchmark

* Fixed MakeBlock benchmark

* Moved waitForAppropriateState after epoch check (#1008)

* Implemented timeout for logger on fetching blockNumber (#1009)

* Implemented timeout for logger on fethcing blockNumber

* Added comments

* updated dockerfile and readme for non-root user (#1014)

* Moved Lumberjack constants to config (#1011)

* Added logFile parameters to config

* Initialised logger with getting parameters from config

* Added logFile paramters in config set up script

* Added config as a parameter in AssignLogFile()

* Fixed tests

* Avoided passing nil types.Configurations{]

* Passed types.Configuations{} for setConfig

* updated readme for expose metric and running cmd in background (#1015)

* Cached API Response (#1016)

* Added cache package containing caching utils

* Used cache to get data from API

* Fixed tests

* Fixed test

* minor fixes

* removed unwanted test

* Added condition to fetch value only if the key is present in json (#1028)

* Added support for Post Requests (#1020)

* Added POST request support

* datasource URL struct support

* Updated createJob command and new format for assets.json file

* Fixed tests

* Fixed URlStruct in test

* Removed unwanted comment

* Backwards compatible

* Removed unwanted logs

* Merge `v1.0.5`into `v1.0.6` (#1031)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch1 Ready (#1022)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Log corrections

* updated release

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Calculated blockNumber in a separate go-routine for logging (#1025)

* Cached block number in logger

* Revert "Cached block number in logger"

This reverts commit 760e3adf38f106bd444ef2d64494565d9bd6dae1.

* Added block/block.go for calculating latestBlock in a seperate goroutine

* Fetched block number from block package

* log corrections

* Increased max size of file to 182MB (#1027)

* renamed variable correctly

Co-authored-by: Shrikant upadhyay <[email protected]>

* Refactor utilsInterface (#1024)

* FileUtils, GasUtils, ClientUtils

* Added test_utils.go to initialiase all the mocked interface

* test_utils.go support for all tests

* Initialised new utils interfaces

* Fetched v1.0.5 updates to v1.0.6 (#1045)

* Fetched the updated changes from v1.0.5

* Staging deployement parameters (#1046)

* Added http timeout as a config parameter (#1055)

* added http timeout as a config parameter

* Fixed and Added tests

* added httpTimeout in config

* Added logFile config parameters to readMe

* Fixed comments

* Fetched API key from env file (#1048)

* Added dot env file utils

* Fetched API key from .env file when required

* updated dependencies

* Changed API key regex

* Added name field in customJob struct

* Replaced content-type field with headers in dataSourceURLStruct

* Updated post request creation

* picked API Regex from constants.go

* Removed unwanted field from header

* returned error as well from GetkeywordAndAPIKey

* replaces regexp.Match() with strings.Contains()

* support for headers in GET requests

* Refactored GetDataFromAPI

* Added processRequest retry constants

* Added condition to check if there was a value in previous block (#1056)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Merge v1.0.5 to main (#1038)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch1 Ready (#1022)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Log corrections

* updated release

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Calculated blockNumber in a separate go-routine for logging (#1025)

* Cached block number in logger

* Revert "Cached block number in logger"

This reverts commit 760e3adf38f106bd444ef2d64494565d9bd6dae1.

* Added block/block.go for calculating latestBlock in a seperate goroutine

* Fetched block number from block package

* log corrections

* Increased max size of file to 182MB (#1027)

* V1.0.5 beta ready (#1032)

* Production support

* Updated release version

* Updated maxSize of log file to 200MB

* Added mutex lock in blockNumber calculation (#1035)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Added mutex lock in blockNumber calculation

* Added new staging addresses and chainId

* updated version

Co-authored-by: Shrikant upadhyay <[email protected]>

* v1.0.5-beta-patch1 (#1037)

* Updated depolyment paramters to prod

* updated version to v1.0.5-beta-patch1

* Updated version to v1.0.5 (#1033)

* Made v1.0.5 branch in sync with main branch (#1039)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Deleted password file (#1040)

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>
Co-authored-by: Shrikant upadhyay <[email protected]>

* Releases/v1.0.5 (#1043)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch1 Ready (#1022)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Log corrections

* updated release

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Calculated blockNumber in a separate go-routine for logging (#1025)

* Cached block number in logger

* Revert "Cached block number in logger"

This reverts commit 760e3adf38f106bd444ef2d64494565d9bd6dae1.

* Added block/block.go for calculating latestBlock in a seperate goroutine

* Fetched block number from block package

* log corrections

* Increased max size of file to 182MB (#1027)

* V1.0.5 beta ready (#1032)

* Production support

* Updated release version

* Updated maxSize of log file to 200MB

* Added mutex lock in blockNumber calculation (#1035)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Added mutex lock in blockNumber calculation

* Added new staging addresses and chainId

* updated version

Co-authored-by: Shrikant upadhyay <[email protected]>

* v1.0.5-beta-patch1 (#1037)

* Updated depolyment paramters to prod

* updated version to v1.0.5-beta-patch1

* Updated version to v1.0.5 (#1033)

* Made v1.0.5 branch in sync with main branch (#1039)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Deleted password file (#1040)

* Added sleep time to reduce amount of RPC calls to get blockNumber (#1042)

add sleep after client call to get blockNumber

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Yashk767 <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>
Co-authored-by: Shrikant upadhyay <[email protected]>
Co-authored-by: YashK <[email protected]>

* updated CI for dockerhub token. (#1052)

* added condition to check if there was a value in previous block

* changed error messaged

---------

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shrikant upadhyay <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Checked password is correct at the immediate start of command (#1069)

* Added function CheckPassword()

* Checked password at immediate start of command

* Added CheckPassword in UtilsInterface

* fixed tests

* Fetch `main` branch into `v1.0.6` (#1076)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Merge v1.0.5 to main (#1038)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch1 Ready (#1022)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Log corrections

* updated release

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Calculated blockNumber in a separate go-routine for logging (#1025)

* Cached block number in logger

* Revert "Cached block number in logger"

This reverts commit 760e3adf38f106bd444ef2d64494565d9bd6dae1.

* Added block/block.go for calculating latestBlock in a seperate goroutine

* Fetched block number from block package

* log corrections

* Increased max size of file to 182MB (#1027)

* V1.0.5 beta ready (#1032)

* Production support

* Updated release version

* Updated maxSize of log file to 200MB

* Added mutex lock in blockNumber calculation (#1035)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Added mutex lock in blockNumber calculation

* Added new staging addresses and chainId

* updated version

Co-authored-by: Shrikant upadhyay <[email protected]>

* v1.0.5-beta-patch1 (#1037)

* Updated depolyment paramters to prod

* updated version to v1.0.5-beta-patch1

* Updated version to v1.0.5 (#1033)

* Made v1.0.5 branch in sync with main branch (#1039)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Deleted password file (#1040)

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>
Co-authored-by: Shrikant upadhyay <[email protected]>

* Releases/v1.0.5 (#1043)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch1 Ready (#1022)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Log corrections

* updated release

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Calculated blockNumber in a separate go-routine for logging (#1025)

* Cached block number in logger

* Revert "Cached block number in logger"

This reverts commit 760e3adf38f106bd444ef2d64494565d9bd6dae1.

* Added block/block.go for calculating latestBlock in a seperate goroutine

* Fetched block number from block package

* log corrections

* Increased max size of file to 182MB (#1027)

* V1.0.5 beta ready (#1032)

* Production support

* Updated release version

* Updated maxSize of log file to 200MB

* Added mutex lock in blockNumber calculation (#1035)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Added mutex lock in blockNumber calculation

* Added new staging addresses and chainId

* updated version

Co-authored-by: Shrikant upadhyay <[email protected]>

* v1.0.5-beta-patch1 (#1037)

* Updated depolyment paramters to prod

* updated version to v1.0.5-beta-patch1

* Updated version to v1.0.5 (#1033)

* Made v1.0.5 branch in sync with main branch (#1039)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Deleted password file (#1040)

* Added sleep time to reduce amount of RPC calls to get blockNumber (#1042)

add sleep after client call to get blockNumber

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Yashk767 <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>
Co-authored-by: Shrikant upadhyay <[email protected]>
Co-authored-by: YashK <[email protected]>

* updated CI for dockerhub token. (#1052)

* updated CI for tests (#1075)

* updated CI for tests

* removed docker from test ci

* Merge `v1.0.5-patch2` to main  (#1073)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch1 Ready (#1022)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Log corrections

* updated release

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Calculated blockNumber in a separate go-routine for logging (#1025)

* Cached block number in logger

* Revert "Cached block number in logger"

This reverts commit 760e3adf38f106bd444ef2d64494565d9bd6dae1.

* Added block/block.go for calculating latestBlock in a seperate goroutine

* Fetched block number from block package

* log corrections

* Increased max size of file to 182MB (#1027)

* V1.0.5 beta ready (#1032)

* Production support

* Updated release version

* Updated maxSize of log file to 200MB

* Added mutex lock in blockNumber calculation (#1035)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

* Added mutex lock in blockNumber calculation

* Added new staging addresses and chainId

* updated version

Co-authored-by: Shrikant upadhyay <[email protected]>

* v1.0.5-beta-patch1 (#1037)

* Updated depolyment paramters to prod

* updated version to v1.0.5-beta-patch1

* Updated version to v1.0.5 (#1033)

* Made v1.0.5 branch in sync with main branch (#1039)

* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edbdc1c2963077805a9da6b0b5aa7e4c0f22.

Co-authored-by: Shrikant upadhyay <[email protected]>

* Deleted password file (#1040)

* Added sleep time to reduce amount of RPC calls to get blockNumber (#1042)

add sleep after client call to get blockNumber

* Merge `V1.0.5-gasLimitFix` to `releases/v1.0.5` (#1062)

* Hardcoded gas limit for reveal (#1060)

* Updated version to v1.0.5-patch2 (#1061)

* Added gasLimit to override as a config parameter (#1063)

* Added gasLimitOverride config parameter

* Taking the gas limit value from config if present

* Added tests

* Added default gas limit override value

* Added gas limit overridr in readMe

* Updated deployment parameters to staging for `v1.0.5-patch2-alpha` (#1065)

* Updated deployment parameters to staging

* updated version

* Updated to v1.0.5-patch2-beta (#1066)

* Updated version to v1.0.5-patch2-beta

* Updated deployement parameters to prod

* Updated version to `v1.0.5-patch2` release (#1067)

* Merge v1.0.5 to main (#1038)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Merged `v1.3.0-alpha` into `v1.0.5` (#973)

* Merged `v1` into `v1.3.0-aplha` with hotfixes (#966)

* Hotfix-proposed data (#913)

* Updated propose data global variables correctly

* Fixed tests

* Returned correct waitForBlockCompletion error

* coverage increase

* GetLocalData returns type types.ProposeFileData

* fixed benchmark

* Fetched Last proposed from contracts (#917)

* fetched getLastProposedEpoch from contracts and tests for it

* typo fix

* V1 propose hotfix (#918)

* Change propose.go to get sorted proposed block ids.
* Fix sorted proposed block issue.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* allow stakers to addStake < minSafeRazor (#928)

* Call claimStakerReward only if there reward to claim (#926)

* Make contract call only if there is commission to claim

* Add tests for claimCommission file

* update check

* Hotfix-giveSorted (#921)

* ResetDispute only done after FinalizeDispute

* Fixed tests

* Update README (#931)

* Update README

* Update logs path

* Fix home dir path

* Add logs to vote.go and commit.go

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Add logs for dispute and propose.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Fix tests.

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Suppress unneccessary error logs. (#935)

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* changed http timeout to 30 sec (#943)

* saving commit data only after successfull commit (#947)

* Added password flag (#946)

* added password flag

* README updated

* Hotfix-giveSorted (new implementation) (#953)

* GiveSorted linear recursion

* Added backupNode flag

* Compilation success for tests

* Fixed tests

* removed recusrsion, called giveSorted linearly

* fixed tests

* Added leafId to giveSortedLeafIds[] on successful giveSorted

* Hotfix-sortedProposedBlocks (#957)

* Shuffled copied slice instead of original slice

* returned error from giveSorted when len(sortedValues)=0

* Fixed dispute tests

* Changed pending nonce at to nonce at. (#948)

* Changed pending nonce at to nonce at.
* Update mockery

Signed-off-by: Ashish Kumar Mishra <[email protected]>

* Hotfix -RPCTimeout (#955)

* Added a generic function with timeout for contract calls

* Moved generic function to utils and implemented to all contract getter calls

* Implemented timeout for contract setter functions

* rpc timeout custom error

* type asserting structs from contract mappings

* Shifted timeout to constants

* passed timeout in int in constants.go

* Added rpcTimeout as config

* Removed errorIndex paramter from CheckIfAnyError()

* Function renamed

* Fixed tests

* Unrequired change

* Added backup node info in readme (#963)

* Passed a initialized varible instead of nil value as a parameter

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* Updated `v1.3.0` branch to staging parameters for v1.3.0-alpha version (#967)

* Updated contract addresses and chainId to staging

* Updated razor-go version to v1.3.0-alpha

* Fixed `CheckIfAnyError()` on RPCTimeout. (#974)

* Added errorIndexInReturnedValues as a parameter in  function

* Fixed comparios of error data type from returned values

* Added a check if config key is present in yaml file before fetching value (#975)

* Added default values for config parameters

* Checked if config key is present in yaml file before fetching

* Fixed tests

* returned default values uniformly

Signed-off-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shekhar Gaur <[email protected]>
Co-authored-by: Ashish Kumar Mishra <[email protected]>
Co-authored-by: Shyam Patel <[email protected]>
Co-authored-by: Raj Kharvar <[email protected]>
Co-authored-by: Skanda Bhat <[email protected]>

* updated version to v1.0.5-alpha (#978)

* Changes Requested in v1.0.5 Review (#1006)

* updated logs and readMe for v1.0.5

* Canges string formater for errors to %v

* Inserted Logs in the entire codebase (#1018)

* Inserted Logs

* Corrected logs

* Modified lumberJack constants

* V1.0.5-alpha-patch…
  • Loading branch information
10 people authored Oct 18, 2023
1 parent f1d7d35 commit 211182d
Show file tree
Hide file tree
Showing 35 changed files with 6,203 additions and 11,809 deletions.
161 changes: 98 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Official node for running stakers in Golang.

### Linux quick start

Install `razor-go` pre build binary directly from github and configure into host.
Install the pre-built razor-go binary directly from GitHub and configure it on the host.

For linux-amd64

Expand All @@ -30,7 +30,7 @@ Check installation
razor -v
```

> **_NOTE:_** To install the version you want, you can set VERSION:<git-tag> environment variable before running above command.
> **_NOTE:_** To install a specific version, set the VERSION:<git-tag> environment variable before running the command above.
## Docker quick start

Expand All @@ -48,7 +48,7 @@ docker network create razor_network
docker run -d -it --entrypoint /bin/sh --network=razor_network --name razor-go -v "$(echo $HOME)"/.razor:/root/.razor razornetwork/razor-go:v1.0.0-mainnet
```

> **_NOTE:_** we are leveraging docker bind-mounts to mount `.razor` directory so that we have a shared mount of `.razor` directory between the host and the container. The `.razor` directory holds keys to the addresses that we use in `razor-go`, along with logs and config. We do this to persist data in the host machine, otherwise you would lose your keys once you delete the container.
> **_NOTE:_** We leverage Docker bind-mounts to mount the .razor directory, ensuring a shared mount between the host and the container. The `.razor` directory holds keys to the addresses that we use in `razor-go`, along with logs and config. We do this to persist data in the host machine, otherwise you would lose your keys once you delete the container.
You need to set a provider before you can operate razor-go cli on docker:

Expand All @@ -64,9 +64,9 @@ docker exec -it razor-go razor <command>

### Prerequisites to building the source

- Golang 1.15 or later must be installed.
- Golang 1.21.1 or later must be installed.
- Latest stable version of node is required.
- Silicon chip based Mac users must go for node 15.3.0+
- Mac users with Silicon chips should use Node 18.18.0 LTS or later versions
- `geth` and `abigen` should be installed. (Skip this step if you don't want to fetch the bindings and build from scratch)
- `solc` and `jq` must be installed.

Expand Down Expand Up @@ -127,7 +127,7 @@ Example:
$ ./razor setConfig --provider https://mainnet.skalenodes.com/v1/turbulent-unique-scheat --alternateProvider https://ce2m-skale.chainode.tech:10200/ --gasmultiplier 1 --buffer 20 --wait 30 --gasprice 0 --logLevel debug --gasLimit 2 --rpcTimeout 10 --httpTimeout 10 --logFileMaxSize 200 --logFileMaxBackups 52 --logFileMaxAge 365
```

Other than setting these parameters in the config, you can use different values of these parameters in different command. Just add the same flag to any command you want to use and the new config changes will appear for that command.
Besides, setting these parameters in the config, you can use different values for these parameters in various commands. Just add the same flag to any command you want to use and the new config changes will appear for that command.

Example:

Expand Down Expand Up @@ -165,7 +165,7 @@ Password:

### Import Account

If you already have an account created, and have its private key, that account can be imported into the `razor-go` client.
If you already have an account and its private key, you can import that account into the `razor-go` client.
To do that, you can use the `import` command. You'll be asked the private key first and then the password which you want to encrypt your keystore file with.

razor cli
Expand All @@ -188,7 +188,7 @@ $ ./razor import
Password:
```

_Before staking on Razor Network, please ensure your account has eth and RAZOR. For testnet RAZOR, please contact us on Discord._
_Before staking on Razor Network, please ensure your account has sFUEL and RAZOR. For testnet RAZOR, please contact us on Discord._

### Stake

Expand All @@ -214,15 +214,15 @@ $ ./razor addStake --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value

_Note: --weiRazor flag can be passed to provide values in wei_

If you have a 1000.25 razors in your account, you can stake those using the stake command with weiRazor flag.
If you have 1000.25 razors in your account, you can stake those using the stake command with weiRazor flag.

Example:

```
$ razor addStake --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value 1000250000000000000000 --weiRazor true
$ ./razor addStake --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value 1000250000000000000000 --weiRazor true
```

If you have a 5678.1001 razors in your account, you can stake those using the stake command with weiRazor flag.
If you have 5678.1001 razors in your account, you can stake those using the stake command with weiRazor flag.

Example:

Expand Down Expand Up @@ -254,8 +254,7 @@ $ ./razor stakerInfo --stakerId 2

### Set Delegation

If you are a staker you can accept delegation from delegators and charge a commission from them.

If you are a staker, you can accept delegations from delegators and charge them a commission.
razor cli

```
Expand Down Expand Up @@ -321,7 +320,7 @@ $ ./razor delegate --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --value

### Claim Commission

Staker can claim the rewards earned from delegator's pool share as commission using `claimCommission`
Stakers can claim the rewards earned from a delegator's pool share as commission using `claimCommission`

razor cli

Expand All @@ -343,7 +342,7 @@ $ ./razor claimCommission --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c

### Vote

You can start voting once you've staked some razors
You can start voting once you've staked some RAZORs.

razor cli

Expand Down Expand Up @@ -449,7 +448,7 @@ $ ./razor unlockWithdraw --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --

### Extend Lock

If the withdrawal period is over, then extendLock can be called to extend the lock period.
If the withdrawal period has ended, you can use the extendLock command to extend the lock period.

razor cli

Expand All @@ -473,10 +472,10 @@ $ ./razor extendLock --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --stak

If you want to claim your bounty after disputing a rogue staker, you can run `claimBounty` command

> **_NOTE:_** bountyIds are stored in .razor directory with file name in format `YOUR_ADDRESS_disputeData.json file.`
>
> **_NOTE:_** Bounty IDs are stored in the .razor directory with filenames in the format `YOUR_ADDRESS_disputeData.json file.`
> e.g: `0x2EDc3c6F93e4e20590F480272AB490D2620557xY_disputeData.json`
> If you know the bountyId, you can pass the value to `bountyId` flag.
If you know the bountyId, you can pass the value to `bountyId` flag.

razor cli

Expand Down Expand Up @@ -512,7 +511,7 @@ docker exec -it razor-go razor claimBounty --address <address>

### Transfer

Transfers razor to other accounts.
Transfers RAZOR to other accounts.

razor cli

Expand All @@ -534,9 +533,9 @@ $ ./razor transfer --value 100 --to 0x91b1E6488307450f4c0442a1c35Bc314A505293e -

### Create Job

Create new jobs using `createJob` command.
Create new jobs using the `createJob` command.

_Note: This command is restricted to "Admin Role"_
_Note: This command is restricted to users with the "Admin Role"_

razor cli

Expand All @@ -559,12 +558,12 @@ $ ./razor createJob --url https://www.alphavantage.co/query\?function\=GLOBAL_QU
OR

```
$ ./razor createJob --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c -n btc_gecko --power 2 -s 'table tbody tr td span[data-coin-id="1"][data-target="price.price"] span' -u https://www.coingecko.com/en --selectorType 0 --weight 100
$ ./razor createJob --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c -n btc_gecko --power 2 -s 'table tbody tr td span[data-coin-id="1"][data-target="price.price"] span' -u https://www.coingecko.com/en --selectorType 0 --weight 100
```

### Create Collection

Create new collections using `createCollection` command.
Create new collections using the `createCollection` command.

_Note: This command is restricted to "Admin Role"_

Expand Down Expand Up @@ -612,7 +611,7 @@ $ ./razor modifyCollectionStatus --collectionId 1 --address 0x5a0b54d5dc17e0aadc

### Update Collection

Update the collection using `updateCollection` command.
Update the collection using the `updateCollection` command.

_Note: This command is restricted to "Admin Role"_

Expand All @@ -636,7 +635,7 @@ $ ./razor updateCollection -a 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --colle

### Update Job

Update the existing parameters of the Job using `updateJob` command.
Update the existing parameters of the Job using the `updateJob` command.

_Note: This command is restricted to "Admin Role"_

Expand Down Expand Up @@ -694,7 +693,7 @@ docker
docker exec -it razor-go razor collectionList
```

Note : _All the commands have an additional --password flag that you can provide with the file path from which password must be picked._
Note : _All commands include an additional --password flag. You can specify a file path to retrieve the password._

### Expose Metrics

Expand Down Expand Up @@ -728,18 +727,18 @@ docker exec -it razor-go razor setConfig --exposeMetrics 2112 --certFile /cert/f

#### Configuration

Clone repo and setup monitoring and alerting using Prometheus/Grafana
Clone the repo and setup monitoring and alerting using Prometheus/Grafana

```
git clone https://github.com/razor-network/monitoring.git
cd monitoring
```

- If your staker is running via binary, then
- If your staker runs via binary, then

1. In `./configs/prometheus.yml`, replace `"razor-go:2112"` with `"<private/public address of host>:2112"`

- For alerting you can add webhook in `./configs/alertmanager.yml`, replace `http://127.0.0.1:5001/` with your webhook URL. This will send you an alert in every 5min if metrics stops.
- For alerting, you can add a webhook in `./configs/alertmanager.yml`. Replace `http://127.0.0.1:5001/` with your webhook URL. This will send an alert every 5 minutes if the metrics stop.

- If you are running multiple stakers and want to monitor via single grafana dashboard

Expand Down Expand Up @@ -835,44 +834,71 @@ cd monitoring

### Override Job and Adding Your Custom Jobs

Jobs URLs are a placeholder from where to fetch values from. There is a chance that these URLs might either fail, or get razor nodes blacklisted, etc.
Job URLs act as placeholders indicating where values should be fetched from. There is a chance that these URLs might either fail, or get razor nodes blacklisted, etc.
You can override the existing job and also add your custom jobs by adding `assets.json` file in `.razor` directory so that razor-nodes can fetch data directly from the provided jobs.

Shown below is an example of how your `assets.json` file should be -

``` json
{
"assets": {
"collection": {
"ethCollectionMean": {
"power": 2,
"official jobs": {
"1": {
"URL": "https://data.messari.io/api/v1/assets/eth/metrics",
"selector": "[`data`][`market_data`][`price_usd`]",
"power": 2,
"weight": 2
"assets": {
"collection": {
"ETHUSD": {
"official jobs": {
"1": {
"URL": "https://data.messari.io/api/v1/assets/eth/metrics",
"selector": "[`data`][`market_data`][`price_usd`]",
"power": 2,
"weight": 2
}
},
},
"custom jobs": [
{
"URL": "https://api.lunarcrush.com/v2?data=assets&symbol=ETH",
"selector": "[`data`][`0`][`price`]",
"power": 3,
"weight": 2
},
]
"custom jobs": [
{
"URL": "https://api.kucoin.com/api/v1/prices?base=USD&currencies=ETH",
"name": "eth_kucoin_usd",
"selector": "data.ETH",
"power": 3,
"weight": 1
},
{
"URL": {
"type": "POST",
"url": "https://rpc.ankr.com/eth",
"body": {
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6",
"data": "0xf7729d43000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000"
},
"latest"
],
"id": 5
},
"header": {
"content-type": "application/json"
},
"returnType": "hex"
},
"name": "eth_postJob_usd",
"power": -4,
"selectorType": 0,
"selector": "result",
"weight": 1
}
]
}
}
}
}
}
```

Breaking down into components

- The existing jobs that you want to override should be included in `official jobs` and fields like URL, selector should be replaced with your provided inputs respectively.

In the above example for the collection `ethCollectionMean`, job having `jobId:1` is override by provided URL, selector, power and weight.
In the above example for the collection `ethCollectionMean`, the job with `jobId:1` is overriden by provided URL, selector, power and weight.

```
"official jobs": {
Expand All @@ -886,22 +912,31 @@ In the above example for the collection `ethCollectionMean`, job having `jobId:1

- Additional jobs that you want to add to a collection should be added in `custom jobs` field with their respective URLs and selectors.

In the above example for the collection `ethCollectionMean`, new custom job having URL `https://api.lunarcrush.com/v2?data=assets&symbol=ETH` is added.
In the above example for the collection `ethCollectionMean` new custom jobs are as shown below,
1. Job following GET request having URL `https://api.kucoin.com/api/v1/prices?base=USD&currencies=ETH` and
2. Job following POST request having URL `"https://rpc.ankr.com/eth"` with respective `body` and `header` will be added in jobs array.

If any custom job requires authentication via an API key or headers, the staker can export the key using the method shown below:

If the job is:
```
"custom jobs": [
{
"URL": "https://api.lunarcrush.com/v2?data=assets&symbol=ETH",
"selector": "[`data`][`0`][`price`]",
"power": 3,
"weight": 2
},
]
https://api.gemini.com/v1/pubticker/v1/exchangerate/BTC?apikey=YOUR_AUTH_KEY
```

you can change the above job url to
```
https://api.gemini.com/v1/pubticker/v1/exchangerate/BTC?apikey=${AUTH_KEY}
```

Now staker needs to use the same keyword defined inside `${...}` as an environment variable using `export` command and assigning it a value as users API key as shown below,

```
export AUTH_KEY="YOUR_AUTH_KEY"
```

### Logs

User can pass a separate flag --logFile followed with any name for log file along with command. The logs will be stored in `.razor/logs` directory.
Users can pass a separate `--logFile` flag followed by any desired log file name when executing a command. The logs will be stored in `.razor/logs` directory.

razor cli

Expand All @@ -915,7 +950,7 @@ docker
docker exec -it razor-go razo addStake --address <address> --value <value> --logFile stakingLogs
```

_The logs for above command will be stored at "$HOME/.razor/logs/stakingLogs.log" path_
_The logs for the above command will be stored at the "$HOME/.razor/logs/stakingLogs.log" path_

razor cli

Expand Down
20 changes: 10 additions & 10 deletions addresses.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"Governance": "0xAc40E8dA38B5a381008059a38bb9bf45f0D3C4e2",
"BlockManager": "0x11aB70d78f1Dd2c3F967180d8A64858Db03A0aBa",
"CollectionManager": "0x367962d1462C568A0dDd0e2448311469451bF5a3",
"StakeManager": "0xe0bC695203d9C9f379bcdE9260B9F71B64B85298",
"RewardManager": "0x301779E4c95f951D2E17B4c3EdDC717551df2EBb",
"VoteManager": "0x641BAD0641eB5B94B19568C0a22a55AEbDAF1870",
"Delegator": "0xC74745eA5a3fac1864FAcd8f48d72C21A4ab883D",
"RAZOR": "0xcbf70914Fae03B3acB91E953De60CfDAaCA8145f",
"StakedTokenFactory": "0xEffA78888Dc1b6033286E5dF9b170bc5223178AB",
"RandomNoManager": "0xC6eF45F5Add040800D30FE6dEe01b4EBC4BfC467"
"Governance": "0xD2A74B7A962FFc85827da0124A4278e731D15464",
"BlockManager": "0x096e44B0d8b68376C8Efe40F28C3857951f03069",
"CollectionManager": "0x3b76eB8c0282dAf531D7C507E4f3143A9A9c38b1",
"StakeManager": "0x9f55a2C6C1F1Be8B01562cEae2df2F22931C7a46",
"RewardManager": "0x07875369943951b1Af9c37f4ea137dcED9d9181d",
"VoteManager": "0x11995b74D6d07a6Edc05653a71F3e8B3354caBF0",
"Delegator": "0xe295863DF95AaAeC66E7de11D3aD0C35698d0fE9",
"RAZOR": "0x4500E10fEb89e46E9fb642D0c62b1a761278155D",
"StakedTokenFactory": "0xe20e11687F269fE9e356da92C4B15aBF98BbC9ff",
"RandomNoManager": "0x31463bC4D5E67Bca623fFc6152D253Ea17216fA9"
}
Loading

0 comments on commit 211182d

Please sign in to comment.