Skip to content

Commit 9476800

Browse files
Add Build Script
1 parent 5753727 commit 9476800

File tree

6 files changed

+50
-11
lines changed

6 files changed

+50
-11
lines changed

build.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
echo $1
2+
3+
if [ -z $1 ]; then
4+
SUBDIR="testnet"
5+
elif [ $1 = "testnet" ]; then
6+
SUBDIR="testnet"
7+
elif [ $1 = "mainnet" ]; then
8+
SUBDIR="mainnet"
9+
else
10+
echo Usage:
11+
echo "\tbuild [args]"
12+
echo
13+
echo args: \(Default is testnet\)
14+
echo "\ttestnet\t\tbuild testnet"
15+
echo "\tmainnet\t\tbuild mainnet"
16+
fi
17+
18+
echo ${SUBDIR}
19+
20+
if [ ${SUBDIR} = "mainnet" ]; then
21+
echo install mainnet config
22+
\cp ./src/config.mainnet.json ./src/config.json
23+
elif [ ${SUBDIR} = "testnet" ]; then
24+
echo install testnet config
25+
\cp ./src/config.testnet.json ./src/config.json
26+
fi
27+
npm run build

public/ks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"start_time": "2017-10-07T18:17:00.588208",
3-
"end_time": "2017-10-07T18:18:00.588221",
2+
"start_time": "2018-11-27T09:00:00.000000Z",
3+
"end_time": "2018-11-27T11:01:00.000000Z",
44
"message": {
55
"en": "<div style='margin-bottom: 2em; font-size: 25px;'>I'm sorry.<br>Regular inspection is scheduled until 10:00 a.m. tomorrow.</div><div><a href='https://google.com' target='_blank'><button class='blue-button big'>Learn more</button></a></div>",
66
"ko": "<div style='margin-bottom: 2em; font-size: 25px;'>이용에 불편을 드려 죄송합니다.<br>내일 오전 10시까지 정기점검합니다.</div><div><a href='https://google.com' target='_blank'><button class='blue-button big'>상세내용보기</button></a></div>",

src/App.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ class App extends Component {
7373
T.setTexts( require( './languages/' + lang + '.json' ) );
7474
}
7575

76+
7677
checkKillSwitch = () => {
7778
const queue = [];
7879
queue.push( callback => {
79-
axios.get( config.ks_url + '?' + Math.random() )
80+
axios.get( config.ks_url + '?' + Math.random())
8081
.then( response => {
8182
if ( response.data !== undefined ) {
8283
callback( null, response.data );
@@ -97,15 +98,17 @@ class App extends Component {
9798
return;
9899
}
99100
const now = moment();
100-
const start = killSwitch.start_time;
101-
const end = killSwitch.end_time;
101+
const start = new Date(killSwitch.start_time);
102+
const end = new Date(killSwitch.end_time);
103+
console.log(end);
102104
const result = {
103105
start_time: start,
104106
end_time: end,
105107
onMaintenance: false,
106108
message: null,
107109
};
108110

111+
109112
if ( 0 <= now.diff( start ) && now.diff( end ) < 0 ) {
110113
result.onMaintenance = true;
111114
result.message = killSwitch.message;

src/components/HistoryTable.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class HistoryTable extends Component {
4747
})
4848
.then(response => response.json())
4949
.then((data) => {
50+
console.log(data);
5051
let { records } = data._embedded;
5152
records = records.map(e => ({
5253
created: e.confirmed,
@@ -71,6 +72,7 @@ class HistoryTable extends Component {
7172
})
7273
.then(response => response.json())
7374
.then((data) => {
75+
console.log(data);
7476
let { records } = data._embedded;
7577
if( records && records.length > 0) {
7678
records = records.map(e => ({
@@ -84,11 +86,16 @@ class HistoryTable extends Component {
8486
}))
8587

8688
this.props.streamOperations(records);
87-
}
8889

89-
this.setState({
90-
prev: data._links.prev.href,
91-
});
90+
this.setState({
91+
prev: data._links.prev.href,
92+
});
93+
} else {
94+
this.setState({
95+
prev: null,
96+
});
97+
98+
}
9299
})
93100
})
94101
.then(() => {

src/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"passphrases": "Test BOS Token Network ; tokennet.test; September 2017",
77
"transaction_fee": 0.001,
88
"minimum_balance": 0.1,
9-
"ks_url": "/ks.json",
9+
"ks_url": "http://testnet-congress-voting-result.blockchainos.org/sebak/ks.json",
1010
"ks_interval": 5,
1111
"active_make_a_new_key": true,
1212
"active_create_test_account": true,

src/libs/newTransaction.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ const makeTransaction = (keypair, target, amount, type, lastSequenceId) => {
6565
};
6666

6767

68+
const nid = config.test_mode ? config.network_id : config.main_network_id;
69+
6870
const RDPData = makeRLPData(HType, body.B);
6971
const hash = sebakjs.hash(RDPData);
70-
const sig = sebakjs.sign(hash, config.network_id, keypair.secret());
72+
const sig = sebakjs.sign(hash, nid, keypair.secret());
7173

7274
body.H.hash = hash;
7375
body.H.signature = sig;

0 commit comments

Comments
 (0)