iost

Account

기본적으로 public-private key pairs 를 사용한다.

사용자는 owner key와, active key 세팅을 통해서 여러 계정 시스템을 관리할 수 있으며, 이는 새로운 permission 을 추가하고 관리방식을 customize 할 수 있다.

IOST 에서 계정은 id와 permissions 를 가지고 만들어지며, 복수개의 permissions 를 가질 수 있다. 각 permission 은 여러개의 item 을 등록하는데, 각 item 은 base58로 encode 된 public key 이거나 account_name@permission_name 형태의 permission pair 이다.

각 permission은 threshold 를 가지는데, 만약 사이닝한 transaction item 의 weight 의 합이 threshold 보다 큰 값을 가지면 transaction 은 승인되는 것으로 본다.

Javascript SDK

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const IOST = require('iost')

// use RPC
const rpc = new IOST.RPC(new IOST.HTTPProvider("http://localhost:30001"));
rpc.blockchain.getChainInfo().then(console.log);

// init iost sdk
let iost = new IOST({ // will use default setting if not set
gasRatio: 100,
gasLimit: 2000000,
delay:0,
}, new IOST.HTTPProvider('http://localhost:30001'));

let account = "abc";
let kp = new IOST.KeyPair(/* your private key in type Buffer */);

iost.setPublisher(account, kp);

// send a call
let handler = iost.callABI("iost.token", "transfer", ["iost", "form", "to", "1000.000"]);

handler
.onPending(console.log)
.onSuccess(console.log)
.onFailed(console.log)
.send()
.listen(); // if not listen, only onPending or onFailed (at sending tx) will be called

Command line wallet tool

iwallet 설치

1
go get github.com/iost-official/go-iost/cmd/iwallet

Operating node

Deployment of full node

스크립트로 설치하기

아래처럼 환경변수를 사용자의 기호에 따라 설정할 수 있다.

1
curl https://raw.githubusercontent.com/iost-official/go-iost/master/script/boot.sh | PREFIX=/data/iserver bash

위 스크립트를 실행하면 필요한 도커 이미지를 받아오고 아래 커맨드로 도커 이미지를 실행시킨다.

1
2
3
4
5
6
7
8
9
10
## start
docker start iserver

## stop
docker stop iserver

## restart
docker restart iserver

docker run --rm -p 30000-30003:30000-30003 -d iostio/iost-node

Checking node

로그는 $PREFIX/logs/iost.log 에 기록되며 도커 컨테이너 로그 확인을 다음과 같이 수행 할 수 도 있다. docker logs -f isserver

블록체인 데이터는 $PREFIX/storage 에 저장된다.

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×