Skip to content

Commit

Permalink
-Added block chain name as a configurable parameter for Chainquery.
Browse files Browse the repository at this point in the history
  • Loading branch information
tiger5226 committed Mar 1, 2019
1 parent 007bb78 commit 84f875b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const ( // config setting keys
smsfromphonenumber = "smsfromphonenumber"
apikeys = "apikeys"
maxfailures = "maxfailures"
blockchainname = "blockchainname"
)

const (
Expand Down Expand Up @@ -138,6 +139,7 @@ func initDefaults() {
viper.SetDefault(smsrecipients, []string{})
viper.SetDefault(smsfromphonenumber, "")
viper.SetDefault(maxfailures, 1000)
viper.SetDefault(blockchainname, "lbrycrd_main")
}

func processConfiguration() {
Expand Down Expand Up @@ -166,6 +168,7 @@ func processConfiguration() {
lbrycrd.LBRYcrdURL = GetLBRYcrdURL()
auth.APIKeys = viper.GetStringSlice(apikeys)
processing.MaxFailures = viper.GetInt(maxfailures)
global.BlockChainName = viper.GetString(blockchainname)

}

Expand Down
7 changes: 6 additions & 1 deletion config/default/chainqueryconfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,9 @@
#transaction processing which puts a transaction to the back of the processing queue if it fails. It can fail say if its
#source output to spend is not already processed.
#DEFAULT: 1000
#maxfailures=
#maxfailures=

#Block Chain Name - Specifies the chain params for parsing blocks, transactions, claims, and addresses. valid choices are
#lbrycrd_main, lbrycrd_testnet, and lbrycrd_regtest.
#DEFAULT: "lbrycrd_main"
#blockchainname=
1 change: 1 addition & 0 deletions e2e/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mkdir test
cd test
echo 'lbrycrdurl="rpc://lbry:lbry@localhost:11337"' > chainqueryconfig.toml
echo 'mysqldsn="lbry:lbry@tcp(localhost:3306)/chainquery_e2e_test"' >> chainqueryconfig.toml
echo 'blockchainname="lbrycrd_regtest"' >> chainqueryconfig.toml
docker pull tiger5226/regtest
curl https://raw.githubusercontent.com/lbryio/lbry-docker/master/lbrycrd/regtest/docker-compose.yml > docker-compose.yml
docker-compose up -d lbrycrd
Expand Down
4 changes: 2 additions & 2 deletions global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ type DaemonSettings struct {
IsReIndex bool
}

//BlockChainName is the name of the blockchain. It is used to decode protobuf claims.
const BlockChainName = "lbrycrd_main"
// BlockChainName is the name of the blockchain. It is used to decode protobuf claims.
var BlockChainName = "lbrycrd_main"

0 comments on commit 84f875b

Please sign in to comment.