iost-official / go-iost Goto Github PK
View Code? Open in Web Editor NEWOfficial Go implementation of the IOST blockchain
Home Page: https://developers.iost.io/
License: GNU Lesser General Public License v3.0
Official Go implementation of the IOST blockchain
Home Page: https://developers.iost.io/
License: GNU Lesser General Public License v3.0
I'm not found the swap interface from IOST project, Could you give some tips for swap from ERC20 to native token? any help that would be great, thanks!
@flybikeGx @sswsdsn
account.NewAccount
does not use a cryptographically secure pseudorandom number generator. This makes it possible to derive arbitrary keys generated by other users by brute forcing the randomSeckey
function with all values returned from time.UnixNano
in some time interval.
Please change the use of math.rand
to crypto.rand
. Consider using the go-ethereum accounts or keystore packages directly as they have seen extensive auditing and been used to generate keys used in live blockchain networks for a few years.
What I did
docker build -f Dockerfile .
What i saw
Sending build context to Docker daemon 11.29 MB
Step 1 : FROM golang:1.10
Trying to pull repository docker.io/library/golang ...
1.10: Pulling from docker.io/library/golang
cc1a78bfd46b: Pull complete
6861473222a6: Pull complete
7e0b9c3b5ae0: Pull complete
3ec98735f56f: Pull complete
32ecd1fcfe1a: Pull complete
9889d58a42e5: Pull complete
337bad6698be: Pull complete
Digest: sha256:2ffa2f093d20c46e86435626f11bf163797400cf8f7cf14ecdc6403f1930045c
Status: Downloaded newer image for docker.io/golang:1.10
---> 6b369f7eed80
Step 2 : RUN go get github.com/kardianos/govendor
---> Running in c91541522d0f
---> 934b979f0011
Removing intermediate container c91541522d0f
Step 3 : COPY . /go/src/github.com/iost-official/prototype/
---> e82b937c07b2
Removing intermediate container 35d3e5437db8
Step 4 : RUN cd /go/src/github.com/iost-official/prototype/ && govendor sync -v
---> Running in 532a28db72fe
fetch "github.com/ethereum/go-ethereum/crypto/secp256k1"
fetch "github.com/golang/mock/gomock"
fetch "github.com/spf13/viper"
---> 3776e61423f1
Removing intermediate container 532a28db72fe
Step 5 : RUN go get github.com/golang/protobuf/proto github.com/iost-official/gopher-lua github.com/mitchellh/go-homedir
---> Running in 00e8a97e7631
---> 6a998db1005c
Removing intermediate container 00e8a97e7631
Step 6 : RUN go get golang.org/x/net/context google.golang.org/grpc
---> Running in cc0bee3387df
---> e266d00eacab
Removing intermediate container cc0bee3387df
Step 7 : RUN go build -o $GOPATH/bin/iwallet github.com/iost-official/prototype/iwallet
---> Running in ef56899e32fd
src/github.com/iost-official/prototype/iwallet/main.go:3:8: cannot find package "github.com/spf13/cobra/cobra/cmd" in any of:
/go/src/github.com/iost-official/prototype/vendor/github.com/spf13/cobra/cobra/cmd (vendor tree)
/usr/local/go/src/github.com/spf13/cobra/cobra/cmd (from $GOROOT)
/go/src/github.com/spf13/cobra/cobra/cmd (from $GOPATH)
The command '/bin/sh -c go build -o $GOPATH/bin/iwallet github.com/iost-official/prototype/iwallet' returned a non-zero code: 1
unregister a producer who that is not registered
command
iwallet --account jerkyrs system unregister HyzGVMTTbo6N3hYhaQdFV7kpMMTNeookmjXXy2MmZLy
Error
exec tx failed: running action Action{Contract: vote_producer.iost, ActionName: applyUnregister, Data: ["jerkyrs"]}
error: Uncaught exception: Error: producer not exists
at _default_name.js:170:48
_IOSTInstruction_counter.incr(61.9);throw new Error('producer not exists');
^
Stack tree:
Error: producer not exists
at VoteContract.applyUnregister (_default_name.js:170:55)
at _default_name.js:825:14
full error information: {
"txHash": "85A2vrnokBhwsPZY8cRGNRXd13XMeD1kuWjXZpsY2mRH",
"gasUsage": 34299,
"ramUsage": {
},
"statusCode": "RUNTIME_ERROR",
"message": "running action Action{Contract: vote_producer.iost, ActionName: applyUnregister, Data: [\"jerkyrs\"]}\n error: Uncaught exception: Error: producer not exists\nat _default_name.js:170:48\n _IOSTInstruction_counter.incr(61.9);throw new Error('producer not exists');\n ^\nStack tree: \nError: producer not exists\n at VoteContract.applyUnregister (_default_name.js:170:55)\n at _default_name.js:825:14",
"returns": [
],
"receipts": [
]
}
running action Action{Contract: vote_producer.iost, ActionName: applyUnregister, Data: ["jerkyrs"]}
error: Uncaught exception: Error: producer not exists
at _default_name.js:170:48
_IOSTInstruction_counter.incr(61.9);throw new Error('producer not exists');
^
Stack tree:
Error: producer not exists
at VoteContract.applyUnregister (_default_name.js:170:55)
at _default_name.js:825:14
Hi guys,
Could you please tell me that is the IOST Developer Bounty Program still active?
I’m sorry to put this question here, maybe it’s better to ask in Slack or Telegram, I’ve tried but no response.
Attempt to exchange for rewards twice in a day
iwallet --account metanyx call "bonus.iost" "exchangeIOST" '["metanyx", "1000"]'
Stacktrace
the transaction hash is: 35CyBj3NZ8gb8bnBWZmz4kd4NmVXrHXms5R1HvYu5ekm
result not ready, please wait. Details: rpc error: code = Unknown desc = failed to Get the receipt: not found
result not ready, please wait. Details: rpc error: code = Unknown desc = failed to Get the receipt: not found
result not ready, please wait. Details: rpc error: code = Unknown desc = failed to Get the receipt: not found
result not ready, please wait. Details: rpc error: code = Unknown desc = failed to Get the receipt: not found
exec tx failed: running action Action{Contract: bonus.iost, ActionName: exchangeIOST, Data: ["metanyx", "1000"]}
error: Uncaught exception: Error: last exchange less than one day.
at _default_name.js:87:48
_IOSTInstruction_counter.incr(63.2);throw new Error('last exchange less than one day.');
^
Stack tree:
Error: last exchange less than one day.
at BonusContract.exchangeIOST (_default_name.js:87:55)
at _default_name.js:120:14
full error information: {
"txHash": "35CyBj3NZ8gb8bnBWZmz4kd4NmVXrHXms5R1HvYu5ekm",
"gasUsage": 34489,
"ramUsage": {
},
"statusCode": "RUNTIME_ERROR",
"message": "running action Action{Contract: bonus.iost, ActionName: exchangeIOST, Data: [\"metanyx\", \"1000\"]}\n error: Uncaught exception: Error: last exchange less than one day.\nat _default_name.js:87:48\n _IOSTInstruction_counter.incr(63.2);throw new Error('last exchange less than one day.');\n ^\nStack tree: \nError: last exchange less than one day.\n at BonusContract.exchangeIOST (_default_name.js:87:55)\n at _default_name.js:120:14",
"returns": [
],
"receipts": [
]
}
running action Action{Contract: bonus.iost, ActionName: exchangeIOST, Data: ["metanyx", "1000"]}
error: Uncaught exception: Error: last exchange less than one day.
at _default_name.js:87:48
_IOSTInstruction_counter.incr(63.2);throw new Error('last exchange less than one day.');
^
Stack tree:
Error: last exchange less than one day.
at BonusContract.exchangeIOST (_default_name.js:87:55)
at _default_name.js:120:14
This should be handled gracefully
IOST Java SDK:
Officially providing the Javascript version of SDK requires developers to develop the Java language.
Main Contents of Development:
Intelligent Contract Deployment Based on IOST Public Chain
Node communication information
Block Chain Information Interaction
Support wallet-related functions
Bounty interval;170,000——1,000,000 IOST
iTest needs to have he chain_id updated in 3.1.0. Running it gives the following error:
Error 2019-05-12 03:59:04.265 itest.go:116 Create account failed: rpc error: code = Unknown desc = VerifyError invalid chain_id, should be 1020, yours:1024
Does the IOST official provide TPS test methods?
apply as a producer then attempt to apply again,
exec tx failed: running action Action{Contract: vote_producer.iost, ActionName: applyRegister, Data: ["metanyx","HyzGVMTTbo6N3hYhaQ... error: Uncaught exception: E
rror: producer exists
at _default_name.js:144:48
_IOSTInstruction_counter.incr(61.5);throw new Error('producer exists');
^
Stack tree:
Error: producer exists
at VoteContract.applyRegister (_default_name.js:144:55)
at _default_name.js:825:14
full error information: {
"txHash": "3kU4pVvoSTF7xBwP9N3XZXxQ7FcmQsqfYtCbLXsN3VKe",
"gasUsage": 34890,
"ramUsage": {
},
"statusCode": "RUNTIME_ERROR",
"message": "running action Action{Contract: vote_producer.iost, ActionName: applyRegister, Data: [\"metanyx\",\"HyzGVMTTbo6N3hYhaQ... error: Uncaught exception:
Error: producer exists\nat _default_name.js:144:48\n _IOSTInstruction_counter.incr(61.5);throw new Error('producer exists');\n
^\nStack tree: \nError: producer exists\n at VoteContract.applyRegister (_default_name.js:144:55)\n at _default_name.js:825:14",
"returns": [
],
"receipts": [
]
}
running action Action{Contract: vote_producer.iost, ActionName: applyRegister, Data: ["metanyx","HyzGVMTTbo6N3hYhaQ... error: Uncaught exception: Error: producer ex
ists
at _default_name.js:144:48
_IOSTInstruction_counter.incr(61.5);throw new Error('producer exists');
^
Stack tree:
Error: producer exists
at VoteContract.applyRegister (_default_name.js:144:55)
at _default_name.js:825:14
This should be handled gracefully
In docker container 2.3.0 and 2.3.1
main.main()
/gopath/src/github.com/iost-official/go-iost/cmd/iserver/main.go:87 +0x21c
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xcaea7c]
The code change (8c99bb1) in response to the previous issue #7 does not check the return of https://golang.org/pkg/crypto/rand/#Read
As this function can return an error on some platforms, the private key would then be all zeroes. Please verify that the returned error value is always nil.
我构建使用的指令是“sudo docker run -it --rm -p 30000-30003:30000-30003 iostio/iost-node”
查询admin账号余额为0
Currently based on the documentation you can only build the docker container on Ubuntu Linux, the container should be able to built and run without reliance on the host installation so long as it has compatible Docker V18.06.0-ce+
https://developers.iost.io/docs/en/4-running-iost-node/Environment-Configuration/#ubuntu-linux
If you are running Centos/Fedora you have to effectively install Ubuntu in a Virtual Machine to then run Docker container build. It would be better that the Docker container compiles all necessary code within the base container image itself.
Consider using IPFS to store block data or file storage requirements so all nodes do not need to store all data. IPFS could also be used to store other data related to Dapps and could be closely linked to v8vm
https://ipfs.io/
https://ipld.io/
https://github.com/ipfs/js-ipfs
It is unclear from the whitepaper how exactly the past blockchain will be stored in its entirety
We mitigate this issue by moving the storage responsibility from past blockchains to the client. Since
latest epoch’s blocks is retained, clients can ask the validators of the shard to create existence proof
for transactions validated in epoch e during the next epoch.
How will the data actually be stored in what format
n(≧▽≦)n
iwallet --account admin call 'token.iost' 'transfer' '["iost","admin","lispczz3","100",""]'
Connecting to server localhost:30002 ...
Sending transaction...
Transaction:
{
"time": "1553158428340691035",
"expiration": "1553158518340691035",
"gasRatio": 1,
"gasLimit": 1000000,
"delay": "0",
"chainId": 1024,
"actions": [
{
"contract": "token.iost",
"actionName": "transfer",
"data": "[\"iost\",\"admin\",\"lispczz3\",\"100\",\"\"]"
}
],
"amountLimit": [
{
"token": "*",
"value": "unlimited"
}
],
"signers": [
],
"signatures": [
],
"publisher": "admin",
"publisherSigs": [
{
"algorithm": "ED25519",
"signature": "8EqHTWgSs82vb6avxpmITYkilTDIXU2KG4YlLRlh2vb1JJw4J6sQmzmPKd+6qFSPpiz/A4IAdOUztzZIaYbTAw==",
"publicKey": "VzGt610agH7JxDglOJ5e3/cEEuRkOpRimmUq8b/PLwg="
}
]
}
Transaction has been sent.
The transaction hash is: 291uAGsdW5po2iLgUteRhB8HCuKRXhkZrFwBZTwB8MEb
Checking transaction receipt...
ERROR: rpc error: code = Unknown desc = tx not found
what i did is :
iserver -f config/iserver.yml
iwallet account import admin 1rANSfcRzr4HkhbUFZ7L1Zp69JZZHiDDq5v7dNSbbEqeU4jxy3fszV4HGiaLQEyqVpS1dKT9g7zCVRxBVzuiUzB
iwallet --account admin call 'token.iost' 'transfer' '["iost","admin","lispczz3","100",""]'
and then, i get this error, anyone knows the reason?
THE netflix of IOST: THE Decentralized of IP MOVIE MEDIA CHIAN will coem true? welcome to the Utopia time
First: something related with the DAO: The investment mechanism works in this way: users can propose a Proposal to invest in a project. If the proposal is approved by more than half of the users, the virtual VC will put some money into the project. The invested projects need to be guaranteed that their business will continue to be returned to the organization through this contract in the future. Each LP in the virtual VC will be fairly distributed to the corresponding revenue.
Then: THE IP MOVE CHAIN in THE DAO contract
LP and Project Investors Jointly Achieve Return of Contract Joint Principal and Profit
Proposal
LP participation
Crowdsourcing Phase 1
LP investment
Virtual VC calculates the total investment of LP and determines the first investment fund.
Enter the second stage
loop
The higher the clicks, the higher the ratings, the higher the earnings of LP and investors
go-iost/core/block/pb/block.proto
Lines 7 to 10 in e07f6d7
UNSET
etc or done with oneof
. Latter case could be done completely different so you'll have two different classes intead of switch-case
stuff
so If oneof
is not used this switch will have default case
Line 183 in 18e0b52
Error 2019-05-12 03:59:04.265 itest.go:116 Create account failed: rpc error: code = Unknown desc = VerifyError invalid chain_id, should be 1020, yours:1024
issue:
when i want to sign my smart contract , it throw me a error:
sudo ./build/iwallet sign test/test.lua -k ~/.ssh/id_secp
Password:
file broken: runtime error: index out of range
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x44f18f1]
goroutine 1 [running]:
github.com/iost-official/Go-IOS-Protocol/core/tx.(*Tx).BaseHash(0xc4201dd8b0, 0xc4200baa20, 0x21, 0x21)
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/core/tx/tx.go:71 +0x31
github.com/iost-official/Go-IOS-Protocol/core/tx.SignContract(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/core/tx/tx.go:34 +0x67
github.com/iost-official/Go-IOS-Protocol/iwallet/cmd.glob..func7(0x4b66c60, 0xc420190d50, 0x1, 0x3)
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/iwallet/cmd/sign.go:78 +0x32a
github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra.(*Command).execute(0x4b66c60, 0xc420190cc0, 0x3, 0x3, 0x4b66c60, 0xc420190cc0)
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x4b66a00, 0x6, 0x474f74b, 0x1)
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra.(*Command).Execute(0x4b66a00, 0xc420088058, 0x0)
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/iost-official/Go-IOS-Protocol/iwallet/cmd.Execute()
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/iwallet/cmd/root.go:27 +0x2d
main.main()
/Users/lizhipeng/go/src/github.com/iost-official/Go-IOS-Protocol/iwallet/main.go:6 +0x20
获取充值只能一个块一个块的扫描吗?
还是有类似EOS的方式获取账户充值信息?
the following error is prompted when run the test case of genesis_test.go on mac 10.13.6, any hint would be appreciated
# github.com/iost-official/go-iost/vm/v8vm ld: warning: ignoring file ../../vm/v8vm/v8/libv8/_darwin_amd64/libvm.dylib, file was built for unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F ) which is not the architecture being linked (x86_64): ../../vm/v8vm/v8/libv8/_darwin_amd64/libvm.dylib Undefined symbols for architecture x86_64: "_Execute", referenced from: __cgo_6cadb3e0a99b_Cfunc_Execute in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_Execute) "_InitGoBlockchain", referenced from: __cgo_6cadb3e0a99b_Cfunc_InitGoBlockchain in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_InitGoBlockchain) "_InitGoConsole", referenced from: __cgo_6cadb3e0a99b_Cfunc_InitGoConsole in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_InitGoConsole) "_InitGoCrypto", referenced from: __cgo_6cadb3e0a99b_Cfunc_InitGoCrypto in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_InitGoCrypto) "_InitGoStorage", referenced from: __cgo_6cadb3e0a99b_Cfunc_InitGoStorage in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_InitGoStorage) "_compile", referenced from: __cgo_6cadb3e0a99b_Cfunc_compile in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_compile) "_createCompileStartupData", referenced from: __cgo_6cadb3e0a99b_Cfunc_createCompileStartupData in _x008.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_createCompileStartupData) "_createStartupData", referenced from: __cgo_6cadb3e0a99b_Cfunc_createStartupData in _x008.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_createStartupData) "_init", referenced from: __cgo_6cadb3e0a99b_Cfunc_init in _x008.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_init, __cgo_wait_runtime_init_done ) "_loadVM", referenced from: __cgo_6cadb3e0a99b_Cfunc_loadVM in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_loadVM) "_lowMemoryNotification", referenced from: __cgo_6cadb3e0a99b_Cfunc_lowMemoryNotification in _x008.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_lowMemoryNotification) "_newIsolate", referenced from: __cgo_6cadb3e0a99b_Cfunc_newIsolate in _x008.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_newIsolate) "_newSandbox", referenced from: __cgo_6cadb3e0a99b_Cfunc_newSandbox in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_newSandbox) "_releaseIsolate", referenced from: __cgo_6cadb3e0a99b_Cfunc_releaseIsolate in _x008.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_releaseIsolate) "_releaseSandbox", referenced from: __cgo_6cadb3e0a99b_Cfunc_releaseSandbox in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_releaseSandbox) "_setJSPath", referenced from: __cgo_6cadb3e0a99b_Cfunc_setJSPath in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_setJSPath) "_setSandboxGasLimit", referenced from: __cgo_6cadb3e0a99b_Cfunc_setSandboxGasLimit in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_setSandboxGasLimit) "_validate", referenced from: __cgo_6cadb3e0a99b_Cfunc_validate in _x006.o (maybe you meant: __cgo_6cadb3e0a99b_Cfunc_validate) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
in local server, update error
iwallet --account testuser3 publish --update helloworld.js helloworld.abi ContractEtD1q8XA3qiLmojuY4XfZVXJyMFZbHnwixUucD5DqaGE
Transaction executed err
ERROR: running action Action{Contract: system.iost, ActionName: updateCode, Data: ["{"ID":"ContractE6YZDg8YmSFM5hGgcg6t... error: update refused
contract have this function
can_update(data) {
return blockchain.requireAuth(blockchain.contractOwner(), "active");
}
Command works as expected transfering 500 metanyx tokens from jerkyrs to metanyx
iwallet --account jerkyrs call 'token.iost' 'transfer' '["metanyx","jerkyrs","metanyx","500","jerkyrs gives metanyx some tokens"]'
Response
{
"txHash": "HoyEuoQ54zj7uA3oT1HjRntsvKuvFbyJKZQ84FgTcEA8
![selection_999 188](https://user-images.githubusercontent.com/10046115/52440970-5ada2a00-2b17-11e9-8d9b-adbc25394bf4.png)
",
"gasUsage": 8978,
"ramUsage": {
},
"statusCode": "SUCCESS",
"message": "",
"returns": [
"[]"
],
"receipts": [
{
"funcName": "token.iost/transfer",
"content": "[\"metanyx\",\"jerkyrs\",\"metanyx\",\"500\",\"jerkyrs gives metanyx some tokens\"]"
}
]
}
However the Explorer is not rendering this correctly (see to address).
Transaction itself is correct
{
"status": "IRREVERSIBLE",
"transaction": {
"hash": "HoyEuoQ54zj7uA3oT1HjRntsvKuvFbyJKZQ84FgTcEA8",
"time": "1549571324869336355",
"expiration": "1549571624869336355",
"gasRatio": 1,
"gasLimit": 1000000,
"delay": "0",
"chainId": 1024,
"actions": [
{
"contract": "token.iost",
"actionName": "transfer",
"data": "[\"metanyx\",\"jerkyrs\",\"metanyx\",\"500\",\"jerkyrs gives metanyx some tokens\"]"
}
],
"signers": [
],
"publisher": "jerkyrs",
"referredTx": "",
"amountLimit": [
{
"token": "*",
"value": "unlimited"
}
],
"txReceipt": {
"txHash": "HoyEuoQ54zj7uA3oT1HjRntsvKuvFbyJKZQ84FgTcEA8",
"gasUsage": 8978,
"ramUsage": {
},
"statusCode": "SUCCESS",
"message": "",
"returns": [
"[]"
],
"receipts": [
{
"funcName": "token.iost/transfer",
"content": "[\"metanyx\",\"jerkyrs\",\"metanyx\",\"500\",\"jerkyrs gives metanyx some tokens\"]"
}
]
}
}
}
I did some contract actions and scan the block before irreversible, recorded the block id,sometime the block id of transactions change after irreversible… is it forks?
How can i verify the transactions before irreversible?
Http Node: https://api.iost.io
go-iost/vm/test_data/lucky_bet.js
Line 27 in d08eba0
Blockchain.deposit
seems return 0, when it successes to deposit.
However, if not, what values will be returned from Blockchain.deposit, does it return some error code explaining cause of error? ex:) 107: 'user already bet', 108: 'user doesn't exist..' etc..
The new command is not sufficient
iwallet --account jerkyrs sys register HLHz1nFi62XXzoVtyNbhDcC7iCSHo44ZhAavoFbVoEKJ
Example in document is like this https://developers.iost.io/docs/en/4-running-iost-node/Become-Servi-Node.html
iwallet sys register <pubkey> --net_id <network-id> --account <your-account>
The --net-id is not listed in the help as additional flags, are there more ? like --loc? if so they should be documented
Need full command like call has
iwallet --account metanyx call 'vote_producer.iost' 'applyRegister' '["metanyx","Go4Pe9XHVMHjWTn88e5eC68VcKbL8pAnBvLHhWct45ap","UK","https://metanyx.com","12D3KooWSAQrb46y92zAhccxED8FtxEA4qXipyfr7Mk37TjdxK1E",true]'
ERROR: send tx error rpc error: code = Unknown desc = VerifyError invalid chain_id, should be 1020, yours:1024
https://github.com/iost-official/go-iost/blob/master/iwallet/root.go#L83
rootCmd.PersistentFlags().Uint32VarP(&chainID, "chain_id", "", uint32(1024), "chain id which distinguishes different network")
at root.go chainId should be 1020
IOST online ISE
Intelligent Contract Development Framework
Multilingual SDK
Document translation
Hardware Wallet
MAC/PC wallet
IOS/Android Wallet
DAPP memo and Courses
developers are welcome to join our Slack communityCourse:
INvite.iost.io
Developer Incentive Plan Application Link; https://ks.wjx.top/jp/31561630.aspx
itest give authorization to 8576WBfDJ5FjQ92KN2jCZXFScJwrf3XWLrCQHMaiAF8b, while 8576WBfDJ5FjQ92KN2jCZXFScJwrf3XWLrCQHMaiAF8b is also iuser of activie key. when transaction packaged by Iwallet and send by iuser, publisher is shown as iuser. This is confusing. Is authorized user and pk equivalent in implementation? An unauthorized account becomes publisher, even if the signature key is consistent.
in testnet
network_id 12D3KooWQwH8BTC4QMpTxm7u4Bj38ZdaCLSA1uJ4io3o1j8FCqYE
itest -> 8576WBfDJ5FjQ92KN2jCZXFScJwrf3XWLrCQHMaiAF8b
iuser: active_public_key : 8576WBfDJ5FjQ92KN2jCZXFScJwrf3XWLrCQHMaiAF8b
iwallet --account iuser call 'token.iost' 'transfer' '["iost","itest","ireceive","1.0","”]’
# hash: 9WKZi3qZqG13iw8wbGKx9X7eBteSYNhY19YvdoaeDggy
9WKZi3qZqG13iw8wbGKx9X7eBteSYNhY19YvdoaeDggy data :
...
"signers": [
],
"publisher": "iuser",
"referredTx": "",
"amountLimit": [
...
Ran this
docker run -it --rm -v $(pwd):/gopath/src/github.com/iost-official/go-iost iostio/iost-dev:1.0.0 make build
Got this
# github.com/iost-official/go-iost/vm/v8vm
/usr/bin/ld:/gopath/src/github.com/iost-official/go-iost/vm/v8vm/v8/libv8/_linux_amd64/libvm.so: file format not recognized; treating as linker script
/usr/bin/ld:/gopath/src/github.com/iost-official/go-iost/vm/v8vm/v8/libv8/_linux_amd64/libvm.so:1: syntax error
collect2: error: ld returned 1 exit status
Makefile:29: recipe for target 'iserver' failed
make: *** [iserver] Error 2```
ggv22LFw4nAkA6bmrVsmCo
2018-06-29 10:34:58.001 I/consensus.log: CBC ConfirmedLength: 53, block Number: 54, witness: bj38rN9xdqBa4eiMi1vPjcUwdMyZmQhvYbVA6cnHyQCH
2018-06-29 10:34:58.002 I/consensus.log: CBC ConfirmedLength: 53, block Number: 53, witness: 281pWKbjMYGWKf2QHXUKDy4rVULbF61WGCZoi4PiKhbEk
2018-06-29 10:34:58.003 I/consensus.log: PendingTransactions Begin...
2018-06-29 10:34:58.004 I/consensus.log: PendingTransactions End.
2018-06-29 10:34:58.005 I/consensus.log: PendingTransactions Size: 0.
2018-06-29 10:34:58.006 I/consensus.log: Generating block, current timestamp: {510089499} number: 55
2018-06-29 10:34:58.007 I/consensus.log: Block size: 238, TrNum: 0
2018-06-29 10:34:58.008 I/consensus.log: Broadcasted block, current timestamp: {510089499} number: 55
2018-06-29 10:34:58.009 I/consensus.log: Received block:55 ,from=, timestamp: 510089499, Witness: iWgLQj3VTPN4dZnomuJMMCggv22LFw4nAkA6bmrVsmCo, trNum: 0
2018-06-29 10:34:58.009 D/consensus.log: [net] broad msg: type= 3, from=10.0.3.69:30302,to=10.0.3.69:30312,time=0, to node: 10.0.3.69:30312
2018-06-29 10:34:58.012 D/consensus.log: [net] broad msg: type= 3, from=10.0.3.69:30302,to=10.0.3.69:30322,time=0, to node: 10.0.3.69:30322
2018-06-29 10:34:58.012 E/consensus.log: [block] lengthAdd length:53 block num:53
2018-06-29 10:34:58.019 I/consensus.log: Link it onto cached chain
2018-06-29 10:35:00.680 I/consensus.log: Received block:56 ,from=10.0.3.69:30312, timestamp: 510089500, Witness: 281pWKbjMYGWKf2QHXUKDy4rVULbF61WGCZoi4PiKhbEk, trNum: 0
2018-06-29 10:35:00.683 E/consensus.log: [block] lengthAdd length:54 block num:54
2018-06-29 10:35:00.686 I/consensus.log: Link it onto cached chain
2018-06-29 10:35:00.687 I/consensus.log: Received block:56 ,from=10.0.3.69:30312, timestamp: 510089500, Witness: 281pWKbjMYGWKf2QHXUKDy4rVULbF61WGCZoi4PiKhbEk, trNum: 0
2018-06-29 10:35:00.688 I/consensus.log: Error: block duplicate
2018-06-29 10:35:03.733 D/consensus.log: [net] broad msg: type= 3, from=10.0.3.69:30322,to=10.0.3.69:30312,time=0, to node: 10.0.3.69:30312
2018-06-29 10:35:03.733 I/consensus.log: Received block:57 ,from=10.0.3.69:30322, timestamp: 510089501, Witness: bj38rN9xdqBa4eiMi1vPjcUwdMyZmQhvYbVA6cnHyQCH, trNum: 0
2018-06-29 10:35:03.736 D/consensus.log: [net] broad msg: type= 3, from=10.0.3.69:30322,to=10.0.3.69:30312,time=0, to node: 10.0.3.69:30312
2018-06-29 10:35:03.737 E/consensus.log: [block] lengthAdd length:55 block num:55
2018-06-29 10:35:03.741 I/consensus.log: Link it onto cached chain
2018-06-29 10:35:03.742 I/consensus.log: Received block:57 ,from=10.0.3.69:30322, timestamp: 510089501, Witness: bj38rN9xdqBa4eiMi1vPjcUwdMyZmQhvYbVA6cnHyQCH, trNum: 0
2018-06-29 10:35:03.743 I/consensus.log: Error: block duplicate
2018-06-29 10:35:06.010 I/consensus.log: currentTimestamp: {510089502}, wid: iWgLQj3VTPN4dZnomuJMMCggv22LFw4nAkA6bmrVsmCo, p.account.ID: iWgLQj3VTPN4dZnomuJMMCggv22LFw4nAkA6bmrVsmCo
2018-06-29 10:35:06.011 I/consensus.log: CBC ConfirmedLength: 56, block Number: 57, witness: bj38rN9xdqBa4eiMi1vPjcUwdMyZmQhvYbVA6cnHyQCH
2018-06-29 10:35:06.013 I/consensus.log: CBC ConfirmedLength: 56, block Number: 56, witness: 281pWKbjMYGWKf2QHXUKDy4rVULbF61WGCZoi4PiKhbEk
2018-06-29 10:35:06.014 I/consensus.log: PendingTransactions Begin...
2018-06-29 10:35:06.015 I/consensus.log: PendingTransactions End.
2018-06-29 10:35:06.016 I/consensus.log: PendingTransactions Size: 0.
2018-06-29 10:35:06.017 I/consensus.log: Generating block, current timestamp: {510089502} number: 58
2018-06-29 10:35:06.018 I/consensus.log: Block size: 238, TrNum: 0
2018-06-29 10:35:06.019 I/consensus.log: Broadcasted block, current timestamp: {510089502} number: 58
2018-06-29 10:35:06.019 I/consensus.log: Received block:58 ,from=, timestamp: 510089502, Witness: iWgLQj3VTPN4dZnomuJMMCggv22LFw4nAkA6bmrVsmCo, trNum: 0
2018-06-29 10:35:06.019 D/consensus.log: [net] broad msg: type= 3, from=10.0.3.69:30302,to=10.0.3.69:30322,time=0, to node: 10.0.3.69:30322
2018-06-29 10:35:06.023 E/consensus.log: [block] lengthAdd length:56 block num:56
2018-06-29 10:35:06.023 D/consensus.log: [net] broad msg: type= 3, from=10.0.3.69:30302,to=10.0.3.69:30312,time=0, to node: 10.0.3.69:30312
2018-06-29 10:35:06.030 I/consensus.log: Link it onto cached chain
2018-06-29 10:35:06.820 D/consensus.log: [net] 10.0.3.69:30302 request node table from 10.0.3.69:30304
2018-06-29 10:35:06.824 D/consensus.log: [net] response node table: 10.0.3.69:30312,10.0.3.69:30322
Uncaught exception when attempting to create an account without enough balance
To create
iwallet account create test9999 --account nobalanceaccount
Stacktrace
"message": "running action Action{Contract: auth.iost, ActionName: signUp, Data: [\"test99999\", \"9pRGe2VHTYyLNBtVqhenTX9MoUZJ7FELc... error: Uncaught exception: Error: balance not enough 0 \u003c 10\nat blockchain.js:66:33\n return JSON.parse(bc.callWithAuth(contract, api, args));\n ^\nStack tree: \nError: balance not enough 0 \u003c 10\n at Object.callWithAuth (blockchain.js:66:34)\n at Account.signUp (_default_name.js:131:60)\n at _default_name.js:352:14",
"returns": [
],
"receipts": [
]
}
This should be handled gracefully
What IS dpos.go for? IOST does not or should not rely on voted delegates for consensus implementing PoB instead?
https://medium.com/@iostoken/iost-weekly-update-april-30th-may-7th-b0604c14e1d6
It appears you can not register, unregister and re-register the same or a new producer
full error information: {
"txHash": "FduEFM6ySYdbwJieUgi2Arg4WBoFot6ZPVnc2M9kVxsk",
"gasUsage": 71856,
"ramUsage": {
},
"statusCode": "RUNTIME_ERROR",
"message": "running action Action{Contract: vote_producer.iost, ActionName: applyRegister, Data: [\"jerkyrs\",\"HyzGVMTTbo6N3hYhaQ... error: Uncaught exception: Error: Uncaught exception: Error: option already exist.\nat _default_name.js:228:52\n _IOSTInstruction_counter.incr(62.1);throw new Error('option already exist.');\n ^\nStack tree: \nError: option already exist.\n at VoteCommonContract.addOption (_default_name.js:228:59)\n at _default_name.js:477:14\nat blockchain.js:66:33\n return JSON.parse(bc.callWithAuth(contract, api, args));\n ^\nStack tree: \nError: Uncaught exception: Error: option already exist.\nat _default_name.js:228:52\n _IOSTInstruction_counter.incr(62.1);throw new Error('option already exist.');\n ^\nStack tree: \nError: option already exist.\n at VoteCommonContract.addOption (_default_name.js:228:59)\n at _default_name.js:477:14\n at Object.callWithAuth (blockchain.js:66:34)\n at VoteContract.applyRegister (_default_name.js:161:56)\n at _default_name.js:825:14",
"returns": [
],
"receipts": [
]
}
running action Action{Contract: vote_producer.iost, ActionName: applyRegister, Data: ["jerkyrs","HyzGVMTTbo6N3hYhaQ... error: Uncaught exception: Error: Uncaught exception: Error: option already exist.
at _default_name.js:228:52
_IOSTInstruction_counter.incr(62.1);throw new Error('option already exist.');
^
Stack tree:
Error: option already exist.
at VoteCommonContract.addOption (_default_name.js:228:59)
at _default_name.js:477:14
at blockchain.js:66:33
return JSON.parse(bc.callWithAuth(contract, api, args));
^
Stack tree:
Error: Uncaught exception: Error: option already exist.
at _default_name.js:228:52
_IOSTInstruction_counter.incr(62.1);throw new Error('option already exist.');
^
Stack tree:
Error: option already exist.
at VoteCommonContract.addOption (_default_name.js:228:59)
at _default_name.js:477:14
at Object.callWithAuth (blockchain.js:66:34)
at VoteContract.applyRegister (_default_name.js:161:56)
at _default_name.js:825:14
If no producers are registered to a user they should be able to register a new one , if there is delay between operations the request should be handled gracefully
Following the instructions in: https://developers.iost.io/docs/en/4-running-iost-node/Building-IOST.html
Everything works fine, including the last step, which is: make build install
I can run iwallet
and itest
with no issues. However when I try to run iserver
or iserver -f ./config/iserver.yml
I get:
dyld: Library not loaded: libvm.dylib
Referenced from: /Users/XXX/go/bin/iserver
Reason: image not found
Abort trap: 6
Not sure how to load / install this library so that I can run the local node.
This issue cause by mainnet & testnet share same account name. For my case I use whitematrix for both mainnet & testnet. After I import whitematrix for testnet, I cannot import it for mainnet.
Attempt to vote for a producer without enough balance to cast that vote
iwallet --account metanyx system vote metanyx 99999
Error is unhandled stack trace
running action Action{Contract: vote_producer.iost, ActionName: vote, Data: ["metanyx","metanyx","99999"]}
error: Uncaught exception: Error: Uncaught exception: Error: balance not enough 1111.09 < 99999
at blockchain.js:21:29
return JSON.parse(bc.callWithAuth("token.iost", "transfer", JSON.stringify(args)));
^
Stack tree:
Error: balance not enough 1111.09 < 99999
at transfer (blockchain.js:21:30)
at Object.deposit (blockchain.js:32:20)
at VoteCommonContract.voteFor (_default_name.js:329:54)
at VoteCommonContract.vote (_default_name.js:360:47)
at _default_name.js:477:14
at blockchain.js:66:33
return JSON.parse(bc.callWithAuth(contract, api, args));
^
Stack tree:
Error: Uncaught exception: Error: balance not enough 1111.09 < 99999
at blockchain.js:21:29
return JSON.parse(bc.callWithAuth("token.iost", "transfer", JSON.stringify(args)));
^
Stack tree:
Error: balance not enough 1111.09 < 99999
at transfer (blockchain.js:21:30)
at Object.deposit (blockchain.js:32:20)
at VoteCommonContract.voteFor (_default_name.js:329:54)
at VoteCommonContract.vote (_default_name.js:360:47)
at _default_name.js:477:14
at Object.callWithAuth (blockchain.js:66:34)
at VoteContract.vote (_default_name.js:547:70)
at _default_name.js:825:14
This should be handled gracefully
Hi, I read the whitepaper of iost. And it turns out that your project really contains some advanced technology. I have interests in DRP and EDS. But when I try to find this part of code, I can't really find them in go-iost. I've spent some time on the codes under consensus dir. So this part of code is not released yet?
Error seen when a user with same handle is attempted to be created again, this should be handled gracefully
" failed, status &{4 running action Action{Contract: auth.iost, ActionName: signUp, Data: ["iost2222", "D9cPjR8cxiZqiSP3XikkNZvLLxiQnsx1... error: Uncaught exception: Error: id existed > iost2222"
go-iost/vm/test_data/lucky_bet.js
Line 40 in d08eba0
Is it ok to count up userNumber even if same account bet twice?
Is there any logic in contract to prevent betting twice per user?
Are the nodes using local time of server, i can see it is in Unix Epoch time, what is repercussion of incorrect time on server. Many virtual machines will use the hardware clock and may not have correctly configured time locally.
Warn 2018-12-31 16:35:54.091 isolator.go:250 isolator run action Action{Contract: base.iost, ActionName: Exec, Data: [{"parent":["IOSTowEse8dXYV7cSM7y8VMCWsvWnZAKDc9GmW9yGyBihphVMhbSF", "19557600"]}]}
failed, status &{5 execution killed, current time : 1546274154053207760 , expireTime: 1546274154053178358}, will rollback
Error 2018-12-31 16:35:54.091 pob.go:436 verify block failed, blockNum:4046447, blockHash:4YxSxSsi8eXM8DR8JvwXh8vfcc8Uk8CmirtFyGQCSyeY. err=execution killed, current time : 1546274154053207760 , expireTime: 1546274154053178358
According to current design of PoB there is a limit of 10 times the Vote count for servi balance
https://medium.com/iost/introducing-pob-how-to-design-a-more-decentralized-consensus-bfe2ff82b485
- In most cases the candidate with the most Servi will become a member of the committee. To limit this, we set a rule that prevents Servi balances to be more than ten times the total amount of votes cast.
In the current situation top nodes are 150 million votes, 17th node is around 10 million and bottom nodes 2 million. Lets assume vote is 1.5 billion total, so 10x of this is 15 billion.
There are 144 rounds a day, assume no deductions at all(17th node deduction) a top node will have a server balance of 150,000,000(150 million) x 144 = 21,600,000,000 (21.6 billion) . There will be deductions during each round that are not calculated in above but within one day they are at more then 10x total votes available (equivalent servi node balance)
As a Servi node to get into round you do not need to beat number 1 just number 17, so predicting 17th spot in comparison, so for example current 17th spot is 10 million votes.
144 x 10,000,000 = 1,440,000,000 (1.4 billion) total assuming no deductions
It is very difficult to predict but on average lets assume the first node will never be deducted by more then the maximum daily accumulation of the 17th node.
In this respect the total to get into a round might very well move into the range of a couple hundred million, for arguments sake lets assume 100 million.
For a node at bottom with 2 million votes they will need to wait 50 rounds (~2-3 rounds a day) to gain 100 million, if the bottom bracket is 1 billion, they would need to wait 500 rounds (1 round every 3 days)
They payout per round is 210,000,000 / 365 / 144 / 17 = 235 IOST per Servi Node (In a round)
To make it more likely for nodes to participate the restriction should should be 1x-5x rather then 10x
根据官方文档的 go get github.com/iost-official/go-iost/cmd/iwallet
无法安装,执行命令毫无反应。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.