Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/PRNET orchestrator integration #501

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions services/community-site/src/services/useDpos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function useDpos() {
'function getTotalEligibleVotesCount() view returns (uint64)',
'function getUndelegations(address delegator, uint32 batch) view returns (tuple(uint256 stake, uint64 block, address validator)[] undelegations, bool end)',
'function getValidator(address validator) view returns (tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) validator_info)',
'function getExternalValidator(address validator) view returns (tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) validator_info)',
'function getValidatorEligibleVotesCount(address validator) view returns (uint64)',
'function getValidators(uint32 batch) view returns (tuple(address account, tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) info)[] validators, bool end)',
'function getValidatorsFor(address owner, uint32 batch) view returns (tuple(address account, tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) info)[] validators, bool end)',
Expand All @@ -26,6 +27,7 @@ function useDpos() {
'function setCommission(address validator, uint16 commission)',
'function setValidatorInfo(address validator, string description, string endpoint)',
'function undelegate(address validator, uint256 amount)',
'function registerExternalValidator(address validator, bytes proof, bytes vrf_key, uint16 commission, string description, string endpoint) payable',
];

const mainnetDpos = useMemo(() => {
Expand All @@ -37,7 +39,7 @@ function useDpos() {

try {
const contract = new ethers.Contract(
'0x00000000000000000000000000000000000000fe',
'0xC403E07453693aD68A939fB909D36d87d8682Fe5',
abi,
mainnetProvider,
);
Expand All @@ -57,7 +59,7 @@ function useDpos() {
return instance;
}
const contract = new ethers.Contract(
'0x00000000000000000000000000000000000000fe',
'0xC403E07453693aD68A939fB909D36d87d8682Fe5',
abi,
browserProvider,
);
Expand Down
2 changes: 1 addition & 1 deletion services/community-site/src/services/useValidators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default () => {
description: string,
endpoint: string,
): Promise<ethers.providers.TransactionResponse> => {
return await browserDpos!.registerValidator(
return await browserDpos!.registerExternalValidator(
validator,
proof,
vrfKey,
Expand Down
12 changes: 12 additions & 0 deletions services/community-site/src/utils/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ export const networks: Networks = {
},
indexerUrl: 'https://indexer.devnet.taraxa.io',
},
200: {
chainName: 'Taraxa PRNET-2460',
rpcUrl: 'https://rpc-pr-2460.prnet.taraxa.io/',
iconUrl: 'https://community.taraxa.io/logo192.png',
blockExplorerUrl: 'https://explorer-pr-2460.prnet.taraxa.io/',
nativeCurrency: {
name: 'TARA',
symbol: 'TARA',
decimals: 18,
},
indexerUrl: 'https://indexer-pr-2460.prnet.taraxa.io',
},
};