Skip to content

Commit

Permalink
Added shardnet
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorJTClarke committed Jul 19, 2022
1 parent 90cff8c commit 9af60f6
Show file tree
Hide file tree
Showing 7 changed files with 15,212 additions and 3,156 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ HEARTBEAT_URL=
# Example: RPC_MAINNET_PROVIDERS="https://rpc.mainnet.near.org,http://localhost:3030"
RPC_MAINNET_PROVIDERS="https://mainnet-rpc.openshards.io,https://rpc.mainnet.near.org"
RPC_TESTNET_PROVIDERS="https://rpc.testnet.near.org,https://testnet-rpc.openshards.io"
RPC_SHARDNET_PROVIDERS="https://rpc.shardnet.near.org"
RPC_GUILDNET_PROVIDERS="https://rpc.openshards.io,https://guildnet-rpc.openshards.io"
RPC_BETANET_PROVIDERS="https://rpc.betanet.near.org"

Expand Down
11,996 changes: 11,996 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "croncat",
"version": "1.7.1",
"version": "1.8.0",
"description": "cron.cat CLI and Agent Runner",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { utils } from 'near-api-js'

export const RPC_MAINNET = process.env.RPC_MAINNET_PROVIDERS ? process.env.RPC_MAINNET_PROVIDERS.split(',') : ['https://rpc.mainnet.near.org']
export const RPC_TESTNET = process.env.RPC_TESTNET_PROVIDERS ? process.env.RPC_TESTNET_PROVIDERS.split(',') : ['https://rpc.testnet.near.org']
export const RPC_SHARDNET = process.env.RPC_SHARDNET_PROVIDERS ? process.env.RPC_SHARDNET_PROVIDERS.split(',') : ['https://rpc.shardnet.near.org']
export const RPC_GUILDNET = process.env.RPC_GUILDNET_PROVIDERS ? process.env.RPC_GUILDNET_PROVIDERS.split(',') : ['https://rpc.openshards.io']
export const RPC_BETANET = process.env.RPC_BETANET_PROVIDERS ? process.env.RPC_BETANET_PROVIDERS.split(',') : ['https://rpc.betanet.near.org']
export const RPC_API_KEY = process.env.RPC_API_KEY ? process.env.RPC_API_KEY : null

export const rpcs = {
mainnet: RPC_MAINNET,
testnet: RPC_TESTNET,
shardnet: RPC_SHARDNET,
guildnet: RPC_GUILDNET,
betanet: RPC_BETANET,
}
Expand Down Expand Up @@ -60,6 +62,8 @@ export const getConfig = (env, options = {}) => {
case 'development':
case 'testnet':
return getConfigByType('testnet', options)
case 'shardnet':
return getConfigByType('shardnet', options)
case 'betanet':
return getConfigByType('betanet', options)
case 'guildnet':
Expand Down
3 changes: 3 additions & 0 deletions src/contract_abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"testnet": {
"manager": "manager_v1.croncat.testnet"
},
"shardnet": {
"manager": "manager_v1.croncat.shardnet.near"
},
"guildnet": {
"manager": "manager_v1.croncat.guildnet"
},
Expand Down
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const atob = (base64) => {

// TODO: Multiple based on RPC providers
export const Near = new NearProvider({
networkId: config.NODE_ENV === 'production' ? 'mainnet' : 'testnet',
networkId: config.NODE_ENV === 'production' ? 'mainnet' : config.NODE_ENV || 'testnet',
accountId: config.AGENT_ACCOUNT_ID,
})

Expand Down
6,360 changes: 3,206 additions & 3,154 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 9af60f6

Please sign in to comment.