Skip to content

Commit

Permalink
use rpc url instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bonedaddy committed Aug 16, 2021
1 parent be1d930 commit 6df5588
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Docker image for serum crank using maximal rust compiler optimizations. See [serum's licese file](https://github.com/project-serum/serum-dex/blob/v0.4.0/LICENSE) for the license of the source code.

# Differences From Upstream

* Specifies `--url` as the RPC to connect to instead of network which ends up using public rpc infra

# Docker Image

A docker image that allows running the crank service through a docker container. Image is designed to be used with docker buildkit to enable as much caching as possible to reduce build times. For those wishing to crank multiple markets at once, a docker compose file may be used.
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
MARKET: "8GufnKq7YnXKhnB3WNhgy5PzU9uvHbaaRrZWQK6ixPxW"
NUMACCOUNTS: 5
NUMWORKERS: 1
RPC_URL: "https://solana-api.projectserum.com"
volumes:
- ./payer.json:/tmp/payer.json
- ./tulip_crank_logs:/logdir
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /bin/bash

/usr/local/bin/crank \
--url "$RPC_URL" \
consume-events \
--coin-wallet "$COINWALLET" \
--pc-wallet "$PCWALLET" \
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ fn read_keypair_file(s: &str) -> Result<Keypair> {

#[derive(Clap, Debug)]
pub struct Opts {
#[clap(default_value = "mainnet")]
pub cluster: Cluster,
#[clap(short, long, default_value = "https://solana-api.projectserum.com")]
pub url: String,
#[clap(subcommand)]
pub command: Command,
}

impl Opts {
fn client(&self) -> RpcClient {
RpcClient::new(self.cluster.url().to_string())
RpcClient::new(self.url.to_string())
}
}

Expand Down

0 comments on commit 6df5588

Please sign in to comment.