Skip to content

Commit

Permalink
Merge pull request #25 from zksync-sdk/develop
Browse files Browse the repository at this point in the history
Changed public urls of ZkSync testnet servers
  • Loading branch information
MaximFischuk authored Aug 11, 2022
2 parents e7a4da8 + 382aa5a commit eb60604
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
9 changes: 7 additions & 2 deletions src/main/java/io/zksync/domain/ChainId.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ public enum ChainId {
Rinkeby(4),
/// Ethereum Ropsten testnet.
Ropsten(3),
/// Optimism Goerli Testnet
Goerli(420),
/// Ethereum Sepolia Testnet
Sepolia(11155111),

/// Self-hosted Ethereum & zkSync networks.
Localhost(9);

private long id;
private final long id;

private ChainId(long id) {
ChainId(long id) {
this.id = id;
}
}
13 changes: 7 additions & 6 deletions src/main/java/io/zksync/provider/AsyncProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,22 @@ public interface AsyncProvider {
* @return ZkSync provider object
*/
static AsyncProvider defaultProvider(ChainId chainId) {
HttpTransport transport = null;
HttpTransport transport;
switch (chainId) {
case Mainnet: transport = new HttpTransport("https://api.zksync.io/jsrpc"); break;
case Rinkeby: transport = new HttpTransport("https://rinkeby-api.zksync.io/jsrpc"); break;
case Ropsten: transport = new HttpTransport("https://ropsten-api.zksync.io/jsrpc"); break;
case Sepolia: transport = new HttpTransport("https://sepolia-api.zksync.io/jsrpc"); break;
case Goerli: transport = new HttpTransport("https://goerli-api.zksync.io/jsrpc"); break;
case Localhost: transport = new HttpTransport("http://127.0.0.1:3030"); break;
default: throw new IllegalArgumentException("Unsupported beta network for given chain id");
}
return new DefaultAsyncProvider(transport);
}

static AsyncProvider betaProvider(ChainId chainId) {
HttpTransport transport = null;
HttpTransport transport;
switch (chainId) {
case Rinkeby: transport = new HttpTransport("https://rinkeby-beta-api.zksync.io/jsrpc"); break;
case Ropsten: transport = new HttpTransport("https://ropsten-beta-api.zksync.io/jsrpc"); break;
case Sepolia: transport = new HttpTransport("https://sepolia-api.zksync.io/jsrpc"); break;
case Goerli: transport = new HttpTransport("https://goerli-api.zksync.io/jsrpc"); break;
default: throw new IllegalArgumentException("Unsupported beta network for given chain id");
}
return new DefaultAsyncProvider(transport);
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/io/zksync/provider/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,22 @@ public interface Provider {
* @return ZkSync provider object
*/
static Provider defaultProvider(ChainId chainId) {
HttpTransport transport = null;
HttpTransport transport;
switch (chainId) {
case Mainnet: transport = new HttpTransport("https://api.zksync.io/jsrpc"); break;
case Rinkeby: transport = new HttpTransport("https://rinkeby-api.zksync.io/jsrpc"); break;
case Ropsten: transport = new HttpTransport("https://ropsten-api.zksync.io/jsrpc"); break;
case Sepolia: transport = new HttpTransport("https://sepolia-api.zksync.io/jsrpc"); break;
case Goerli: transport = new HttpTransport("https://goerli-api.zksync.io/jsrpc"); break;
case Localhost: transport = new HttpTransport("http://127.0.0.1:3030"); break;
default: throw new IllegalArgumentException("Unsupported network for given chain id");
}
return new DefaultProvider(transport);
}

static Provider betaProvider(ChainId chainId) {
HttpTransport transport = null;
HttpTransport transport;
switch (chainId) {
case Rinkeby: transport = new HttpTransport("https://rinkeby-beta-api.zksync.io/jsrpc"); break;
case Ropsten: transport = new HttpTransport("https://ropsten-beta-api.zksync.io/jsrpc"); break;
case Sepolia: transport = new HttpTransport("https://sepolia-beta-api.zksync.io/jsrpc"); break;
case Goerli: transport = new HttpTransport("https://goerli-beta-api.zksync.io/jsrpc"); break;
default: throw new IllegalArgumentException("Unsupported beta network for given chain id");
}
return new DefaultProvider(transport);
Expand Down

0 comments on commit eb60604

Please sign in to comment.