Skip to content

Commit

Permalink
update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Spark committed Mar 17, 2023
1 parent 06296b3 commit cab2713
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "btcdomain_resolver"
version = "0.1.0"
version = "0.1.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ docker run -itd --name ${image_name} -p $port:$port -v table.sql:/docker-entrypo
docker start ${image_name}

export RUST_LOG=info
export database=mysql://root:$pwd@localhost:$pord/domain_inscription_data

wget https://github.com/btcdomain/btcdomain_resolver/releases/download/untagged-58d18276a8ca3da2ef4b/btcdomain_resolver
export database=mysql://root:$pwd@localhost:$port/domain_inscription_data

wget https://github.com/btcdomain/btcdomain_resolver/releases/download/v0.1.0/btcdomain_resolver

chmod +x btcdomain_resolver

nohup ./btcdomain_resolver > btcdomain_resolver.log &
10 changes: 9 additions & 1 deletion src/db.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Duration;
use std::thread;
use mysql::{*, prelude::{Queryable}};
use log::info;
use lazy_static::lazy_static;
Expand All @@ -10,7 +12,13 @@ lazy_static!{

fn get_pool() -> Pool {
let url = get_database_url();
Pool::new(url.as_str()).unwrap()
let pool = Pool::new(url.as_str());
if pool.is_ok() {
pool.unwrap()
}else {
thread::sleep(Duration::from_secs(5));
get_pool()
}
}

pub fn insert_inscribe_info(info: InscribeInfo) -> Result<()> {
Expand Down
14 changes: 0 additions & 14 deletions src/table.sql

This file was deleted.

2 changes: 1 addition & 1 deletion table.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
create database if not exists domain_inscription_data;
use domain_inscription_data;

create table domain_inscription_info(
create table if not exists domain_inscription_info(
id bigint primary key auto_increment,
inscribe_num bigint,
inscribe_id varchar(200),
Expand Down

0 comments on commit cab2713

Please sign in to comment.